The Capability Boundary of AI Coding Tools: Why Models and Engineering Harnesses Multiply

    This article breaks down the vague question of what makes AI coding tools effective into three independent layers: model capability, the execution harness, and state management. It explains why a capable model sets the floor, how permission rules and pre-execution hooks make generated changes safe to apply, and why long sessions need externalized constraints and version control rather than session checkpoints. It also covers how lenient clients can degrade tool-calling behavior, and closes with a practical checklist for engineering teams.

    1. First, Unpack “Strong”: A Vague Question Cannot Be Answered Seriously

    “Why are AI coding tools so useful — is it because the underlying model is strong, or because the surrounding engineering is well built?” This question tends to trigger camps and arguments, because “strong” is itself a composite concept. Split it into three independent things, none of which can be missing, and the answer emerges on its own:

    1. Can it write the code? — Does the model understand the requirement, locate the relevant code, and generate a correct modification?
    2. Can it land safely on disk without causing an incident? — Can the generated result be executed, validated, and rolled back under control?
    3. Can it finish a long task? — As multiple turns accumulate and context keeps expanding, do the constraints still hold and can state still be recovered?

    These three layers map to model capability, the execution framework (referred to below as the harness), and the state management layer. Discuss them as one blended topic and you end up with the uninformative conclusion that “everything matters anyway.”

    2. Layer One: Can It Write the Code — the Model’s Floor

    Code comprehension, cross-file reasoning, and imitation of an existing style come mainly from pre-training and post-training, and have nothing to do with the surrounding framework. A weaker model in an unfamiliar repository often cannot even tell what a test file is meant to verify. At that point, discussing sandbox isolation, permission approval, or operation auditing is pointless — it never reaches the step where any of that control would apply.

    So we have to admit it: the model is the prerequisite. An engineering framework cannot “manufacture” a capability the model lacks; it can only reduce the probability that an existing capability is wasted.

    3. Layer Two: Landing Safely on Disk — the Harness’s Job

    This layer addresses the case where “the code was generated correctly, but the execution went wrong.” Mature industry solutions typically break it into an explicit rule table plus a few fallback mechanisms.

    3.1 Three-Tier Permission Rules

    • allow: explicitly permitted, for example running test commands or reading a specific directory;
    • ask: requires human confirmation;
    • deny: rejected outright, typically for sensitive paths and destructive commands.

    Rules are generally written as prefix matches, with wildcards permitted only at the end to avoid semantic ambiguity:

    1. allow: Bash(npm run test:*), Read(src/**)
    2. ask: Bash(git push:*), Edit(config/**)
    3. deny: Read(.env*), Bash(rm -rf:*)

    Priority is hard-coded: ask overrides allow, and deny overrides both. When no rule matches, execution falls back to the default mode; in a read-only planning mode, neither file edits nor command execution are permitted. This “deny by default, allow explicitly” structure is far more reliable than depending on the model’s own judgment.

    3.2 Pre-Execution Hooks

    Inserting a pre-hook after the tool arguments have been generated but before anything actually executes is the cheapest line of defense. The conventional approach: the hook signals a block with a non-zero exit code and pipes its standard error back to the model verbatim, so the model can correct itself and retry. Compared with terminating on a hard error, this closed loop of “handing the failure reason back to the model” noticeably improves the single-run completion rate.

    It is worth stressing that these mechanisms do not make the model smarter. They simply reduce the frequency of “it runs, but in the wrong direction” mistakes — editing the wrong file, touching an interface that should not be touched, deleting instead of fixing.

    4. Layer Three: Finishing a Long Task — a State Problem

    4.1 Context Compaction Is Lossy

    Long sessions inevitably trigger context compaction, and what gets dropped first is usually the constraints written down earliest: which files must not be touched, which interface signature must not change, backward compatibility must be preserved. Those constraints are exactly the ones needed late in the task.

    The engineering response is to move constraints out of the context: put them in a convention file at the repository root (common plain-text conventions include CLAUDE.md and AGENTS.md), versioned along with the codebase. Compaction cannot erase it, and a new session loads it automatically. In essence, this hedges a finite context window with externalized state.

    4.2 Checkpoints Are Not Version Control

    A common implementation of session-level checkpoints takes a snapshot of internal files before each turn, keeping only the most recent few within the session (for example, 100). Its boundaries are clear:

    • Files modified purely through the command line are usually not tracked;
    • Changes made by most sub-agents are also outside the tracking scope;
    • It covers files only, not external side effects (requests already sent, data already written to a remote system, migrations already applied).

    So it is suitable for quick rollback within a session and cannot replace version control. Treating it as version control is a frequent cause of long-task incidents. Scenarios that genuinely need strongly consistent rollback should still rely on branches, commits, and remote hosting, with object storage for build artifacts where necessary, and logging services plus monitoring and alerting to track side effects.

    5. Conclusion: Multiplication, Not Addition

    The model determines the floor; the execution framework determines whether that floor can be cashed out as a deliverable result. The two multiply: if either approaches zero, the overall result approaches zero. A strong model in an uncontrolled execution environment races forward in the wrong direction; a complete execution framework paired with a model that cannot read code will reliably accomplish nothing.

    6. The Reverse Effect: Engineering Frameworks Shape the Model

    More concerning is the reverse influence, which is precisely the source of the misjudgment that “the model seems to have gotten stronger.”

    One repeatedly observed phenomenon: connect the same batch of new models to a more permissive in-house editing tool, and tool-call quality actually drops — keys that are not defined in the schema appear out of nowhere in the argument JSON. The content itself is correct; there are just extra fields that should not exist. A plausible explanation is that the model effectively underwent reinforcement learning inside a lenient client: the server performs no strict validation, automatically filters unfamiliar keys, and accepts synonymous parameter names, so “writing a few extra fields” still earns a reward, and no gradient corrects the drift.

    Put differently, a client’s leniency becomes internalized as the model’s output habit. This gives engineering implementers a direct takeaway: strict validation is not only about system safety — it also supplies the model with the correct training signal. Validating arguments against the schema, explicitly erroring on unknown fields, and returning validation failures in a structured form will, over time, improve the model’s tool-calling behavior.

    7. A Practical Checklist

    • Use read-only planning mode to produce the plan first, then open up write permissions after confirmation;
    • Keep permission rules to “deny by default + trailing wildcards + fixed priority,” and avoid complex regular expressions;
    • Use pre-execution hooks for argument validation and blocking, and pipe failure messages back verbatim;
    • Write long-term constraints into a convention file in the repository rather than leaving them in the session;
    • Be explicit about the capability boundary of checkpoints, and leave critical rollbacks to version control;
    • Keep strict validation on tool inputs, and never silently swallow unknown fields.

    In engineering practice on cloud platforms such as Baidu AI Cloud, this layered approach of “model + execution framework + externalized state” applies equally well: model capability is obtained through a unified model service, permissions and auditing live in the gateway and logging services, artifacts and snapshots live in object storage, and exceptions are covered by monitoring and alerting. Only with clear layering can delivery be called stable.