Large Language Models and Coding Agents: Capability Boundaries and Engineering Practices
This article explains how to separate a large language model from the coding agent built around it. It covers the model's text-only interface, capability tiers, access and billing methods, and the agent's loop of model, tools, and context. It also outlines how to evaluate agents with fixed task sets and metrics, and which controls to apply in practice, including environment isolation, tiered permissions, clear task specifications, and human review.
1. Why Separate the Model from the Agent
Many discussions of coding agent performance mix two different things: the underlying large language model (LLM), and the software system that wraps the model and runs it. Their capability boundaries differ, and troubleshooting a problem means looking in different places. Mistaking a model’s reasoning ability for an agent’s execution ability leads to unrealistic expectations about tools, and it can also leave gaps in permissions and security.
Before discussing coding agents, define two things: what the model is responsible for, and what the agent is responsible for.
2. The Capability Boundaries of Large Language Models
2.1 Text In, Text Out
A large language model is a neural network trained on large volumes of text and code. From an engineering perspective, its basic interface is simple: it takes a block of context text and outputs a block of continuation text. The model has no file system access and cannot directly run terminal commands or query the state of a version control system. It can reason, summarize, and generate code, but that code is just text. Whether it runs, where it runs, and what the result is are all decided by external systems.
This leads to an important principle: any “action suggestion” from the model must be parsed and executed by an external program. The execution itself is not a capability of the model.
2.2 Capability and Cost Tiers
Major model providers typically offer several tiers based on capability and cost. In practice, they fall roughly into three groups:
| Tier | Typical positioning | Suitable tasks |
|---|---|---|
| High-capability tier | Complex reasoning and long-chain decision-making | System architecture reviews, root cause analysis of difficult defects, cross-module solution design |
| Balanced tier | A trade-off between performance and cost | Day-to-day feature development, code review, refactoring suggestions |
| Lightweight tier | Fast responses and low cost per call | Batch format conversion, template-based test case generation, simple text processing |
Specific prices and context window sizes vary by provider and version, so check the official documentation when choosing a model. The differences between tiers mainly show up in how complex a task each tier can handle, not simply in how many calls you can make.
2.3 Common Access Methods
There are three common ways to use a model:
- Web or desktop chat interfaces, suited to one-off questions and light consultation;
- Standard application programming interfaces (APIs), suited to integration with your own systems, billed by call volume or by input and output tokens;
- Managed cloud platform services, suited to enterprises that already have cloud resources, making it easier to manage authentication, network isolation, and billing in one place.
Pay close attention to billing. Subscription chat quotas usually cover only web interactions, while API calls are usually billed by usage. The quotas, billing cycles, and usage statistics of the two are typically independent. If a team treats them as one system, it can overspend its budget or lose service when its quota runs out.
3. How Coding Agents Work
3.1 Agent = Model + Tools + Loop
A coding agent runs in a terminal. It is not a model itself but a scheduling program. It places the model inside a loop, lets the model decide the next action, and then has the program execute that action and return the result to the model. The core structure is roughly as follows:
context = initial task description + project-related contextwhile task is not complete and maximum steps are not exceeded:action = model.decide_next_step(context)if action is a tool call:permission_check(action) # Reject and log if the check failsresult = execute_tool(action) # e.g., read a file, run tests, execute a commandcontext.append(action, result)else:output the final resultend the loop
This structure highlights several key points. First, at each step the model sees only the context, and the quality of that context directly affects the quality of its decisions. Second, all real operations pass through the tool layer, so permission control should be designed into that layer. Third, the loop needs a maximum step count and termination conditions. Otherwise, the agent may keep retrying indefinitely in the wrong direction.
3.2 Responsibilities of the Tool Layer
The tool layer typically provides these capabilities:
- File operations: reading, searching, creating, and modifying files;
- Command execution: running builds, tests, and formatting commands in a restricted shell;
- Version control operations: viewing diffs, creating branches, and committing changes;
- External information retrieval: querying documentation or accessing internal interfaces, depending on the deployment policy.
The granularity of tools significantly affects security and auditability. Treating “execute any command” as one tool carries a very different risk level than splitting it into separate tools such as “run tests” and “read a specified directory.” The first offers flexibility, while the second makes auditing and permission restriction easier.
3.3 Context Management
During long tasks, an agent keeps accumulating context, including file contents, command output, and intermediate reasoning. The context window is limited. When it is exceeded, content gets truncated or compressed. This causes two common problems: early constraints get forgotten, and large logs crowd out key information.
To address these problems, state constraints and acceptance criteria at the start of the task. Have tools return only the necessary summary and write full logs to a file. Split large tasks into stages, and output a status checkpoint at the end of each stage.
4. How to Evaluate Coding Agents in Practice
“How it feels to use” is a subjective question that cannot guide team decisions. A more effective approach is to establish reviewable evaluation criteria along the following dimensions.
| Dimension | Metrics | Evaluation method |
|---|---|---|
| Task completion quality | Pass rate of acceptance tests, rate of rework after first submission | Select a fixed task set and record whether the first submission passes the tests |
| Controllability | Number of unauthorized operations, accidental deletions or modifications | Audit tool call logs and count permission rejection records |
| Reviewability | Average lines changed per change, completeness of explanations | Check whether changes are readable and can be reviewed independently |
| Cost | Token consumption and time per task | Track by task type, separating input and output usage |
| Stability | Proportion of loops that fail to converge and repeated failures | Record tasks that hit the step limit without completing |
Evaluation should use a fixed task sample and compare different model tiers or tool configurations under the same conditions. Judging by impressions alone can be misleading, since individual successes or failures can distort the picture.
5. Key Engineering Practices
5.1 Environment Isolation and Least Privilege
Agents should run in an isolated environment, such as a separate container or virtual machine, with only the current project directory mounted. Production database credentials, cloud account keys, and internal service tokens should not appear in any path the agent can read. Secrets should be injected through environment variables or provided by a secrets management service, and never written into code, configuration files, or logs.
Permissions can be tiered by operation type:
# Illustrative policy, not the configuration format of any specific productpermissions:allow:- read_files: ["src/", "tests/"]- run_tests: true- run_formatter: truerequire_confirmation:- write_files: ["src/"]- run_build: truedeny:- delete_files: "*"- push_to_remote: true- read_files: [".env", "secrets/"]
Allowed operations can run automatically. Operations that require confirmation should be approved by a person. Forbidden operations should be rejected directly at the tool layer. This layered design is far more reliable than relying on the model to follow the rules voluntarily.
5.2 Task Decomposition and Acceptance Criteria
Agents handle tasks with clear boundaries and automatic verification well. Examples include adding unit tests for a specified function, unifying a module’s log format to a new standard, or fixing a specific failing case in a test report. For tasks with vague requirements, multi-party coordination, or no way to verify results, it is often hard to judge whether the agent’s output is correct.
A task description should include four parts: goal, scope, constraints, and acceptance method. For example:
Goal: Add boundary tests for the parse_date function in the parser moduleScope: Modify only files under tests/parser/Constraints: Do not change the existing function signature; do not introduce new dependenciesAcceptance: All tests pass, and the tests cover three cases: empty string, invalid format, and leap year
5.3 Change Review and Rollback
Each change an agent makes should happen on a separate branch or in a separate workspace, and be handed over as a diff for human review. Reviewers should focus on three points: whether the changes go beyond the scope of the task, whether the tests truly cover the changes, and whether any undeclared dependencies or configuration changes were introduced.
If problems are found, roll back to a known good state through version control rather than letting the agent “fix itself.” When the agent keeps producing erroneous fixes, continued iteration often expands the problem. At that point, a person should take over.
5.4 Maintain Reasonable Skepticism Toward Model Output
Models may generate function names, parameters, or library usages that look plausible but do not exist. For these issues, have the agent run real compilation, tests, or static checks, so that external feedback replaces subjective judgment. Any code involving security, funds, or user data should undergo human review before merging, no matter how well the model performed.
6. Common Misconceptions
The first misconception is treating an agent’s fluent output as correct. Fluent text does not mean the logic is correct. Verification depends on tests and review, not on writing style.
The second is giving agents excessive permissions to reduce confirmation prompts. This saves effort, but if the model misunderstands an instruction, the impact grows along with the permissions.
The third is focusing only on the model tier while neglecting tool and process design. On the
