The Capability Boundaries of AI Coding Tools: Model vs. Engineering Implementation
This article breaks down what makes an AI coding tool "strong" into three separate capability layers: code generation, execution control, and long-task state management. It explains why model capability sets the floor, how allow/ask/deny permission rules and PreToolUse hooks turn that floor into a safe delivery, and why constraints must live on disk rather than in context. It also covers how strict tool protocols shape model behavior, and closes with a practical checklist for evaluating and deploying coding agents.
1. First, Break “Strong” Apart: A Vague Question Has No Answer
Ask where an AI coding tool is “strong” and the discussion usually splits into camps: one side credits the underlying model, the other credits the engineering wrapper. A more useful approach is to decompose “strong” into three non-overlapping capability surfaces: can it write the code, can that code be safely committed to disk, and can a long task run to completion. These map to model capability, execution control, and state management respectively. Mixing them together guarantees a one-sided conclusion.
2. Layer One: Code Generation Is the Floor, Independent of the Shell
Whether a model can read a repository, locate the relevant files, and produce a runnable change comes mainly from pre-training and reinforcement learning. It is a floor that no tool shell can compensate for. Hand the same repository to a weaker model and it may not even understand the intent of a test case; at that point, discussing sandboxes, approvals, and rollbacks is pointless.
So when evaluating a coding tool, the first step is to fix the task set, swap only the model, and observe how much the completion rate moves. This cleanly isolates the model’s contribution.
3. Layer Two: Permission Model and Execution Control Decide Whether the Floor Pays Off
Writing correct code is not the same as delivering it safely. The core of the engineering layer is collapsing “writable and executable” into an explicit rule table. A common industry pattern is a three-way decision:
allow (auto-approve) / ask (confirm each time) / deny (reject outright)Rule example: prefix matching in the form Bash(npm run test:*)Wildcards are only permitted at the endFixed precedence: ask overrides allow, deny overrides bothWhen no rule matches, fall back to defaultModeIn plan mode, read-only: no file changes, no command execution
The point of this design is not to make the model smarter but to compress changes that “run fine but head in the wrong direction”: out-of-scope file writes, accidental dependency deletion, changes applied to production configuration. All of these are intercepted after the arguments are generated and before execution begins.
One layer further out there is usually a PreToolUse hook: it intervenes after the tool arguments are generated and before actual execution, performing static checks, sensitive-path validation, or injecting additional constraints. When it returns a non-zero exit code (such as 2), the standard error is fed back to the model verbatim so it can correct itself and retry. This forms a loop: rules decide “whether it can be done,” hooks decide “whether it is done correctly,” and the model decides “how to fix it.”
Engineering recommendations:
- Organize rules as “deny by default, allow on demand,” with wildcards only at the end to avoid overly broad matches;
- Route destructive operations (deletion, bulk rewrites, release-type commands) to ask or deny without exception;
- Keep hooks to deterministic checks only, with no subjective judgment, so failure messages stay intelligible to the model.
4. Layer Three: State Management for Long Tasks
The real enemy in long tasks is the lossiness of context compaction. What gets dropped first is often the earliest constraints written down: which files must not be touched, which interface signatures are immutable, the directory layering conventions. They appear at the beginning but are needed in the middle and later stages.
Mature solutions therefore move constraints out of context: a constraint file at the repository root (conventionally named along the lines of a CLAUDE.md or AGENTS.md file) is versioned alongside the code and loaded on demand. Compaction cannot touch what is on disk. Supporting practices include:
- Write only decidable rules in the constraint file, avoiding abstract slogans;
- Split long tasks into stages, each with its own acceptance command;
- Record key decisions in a task log instead of relying on conversational memory.
Checkpoint mechanisms are also often mistaken for version control. Session-level snapshots typically capture internal working files before each turn starts and retain only the most recent few (commonly 100). Files changed purely through the command line, and changes made by most sub-agents, often fall outside tracking. Its role is fast in-session recovery; it is cheap because it covers files only, not external side effects (database changes, message sends, live configuration). The real delivery boundary should still be carried by version control and a traceable release process.
5. Reverse Effect: Tool Protocols Shape Model Behavior
One phenomenon that is easily misread as the model getting “stronger” or “weaker” comes from the tool protocol itself. Some engineering practitioners have publicly described a similar experience: connecting the same batch of new models to a homegrown editing tool, tool-call quality actually dropped, with fields that carry no validation semantics appearing out of nowhere in the argument JSON. The content itself was correct; there were just extra keys that should not have been there.
A plausible explanation is that the model completed reinforcement learning against a permissive client. A permissive client does not strictly validate arguments, automatically filters unknown keys, and accepts synonymous field names, so “writing a few extra fields” still earns reward and there is no gradient pushing back on the redundancy. This mechanism is external observation and inference, and does not necessarily need to be reproduced in your own environment, but the engineering takeaway is clear: strict validation is not a burden but a means of shaping model behavior.
6. Conclusion and Practical Checklist
The model sets the floor; engineering implementation decides whether that floor converts into a delivery. The two are multiplicative, not additive: if either is zero, the result is zero. A practical order of work:
- Measure the model’s contribution with a fixed task set, so shell gains are not booked to the model’s account;
- Establish allow/ask/deny three-way rules and a read-only plan mode, forcing confirmation for destructive operations;
- Use pre-execution hooks for deterministic checks, and feed failure reasons back to the model to form a self-repair loop;
- Externalize constraints, acceptance commands, and decision records to disk and version control;
- Define the boundaries of session checkpoints clearly; they do not replace version control or release auditing;
- Keep tool protocols strictly validated to prevent the model from learning redundant-argument habits.
On the cloud platform side, these capabilities typically work together with common categories such as container platforms, object storage, logging services, and monitoring and alerting to form an auditable, rollback-capable engineering loop; Baidu AI Cloud provides corresponding foundational support for this kind of general engineering practice.
