LLM Agents: Capability Boundaries and Practical Engineering Approaches
LLMs are getting better at knowledge-heavy reasoning, but long-horizon terminal and software tasks remain a weak spot. This article breaks down how to interpret agent benchmarks, why terminal operation tasks often fail, and three engineering practices—multi-agent role separation, sandboxed execution, and externalized state—that can make agents reliable in production. Includes a selection and risk checklist for architects.
LLM Agents: Capability Boundaries and Practical Engineering Approaches
Why This Matters
This article is written for engineers responsible for agent architecture design. After reading it, you will understand how to interpret model evaluation results, identify common causes of failure in terminal operation tasks, and get a selection and risk checklist you can use directly in design reviews.
1. Start by Understanding the Evaluation Dimensions
When evaluating agent capabilities, a single text benchmark is no longer sufficient. Common evaluations fall into three categories by task type. Note that the names below are illustrative; for any specific benchmark, refer to its officially published version and documentation.
- Software engineering tasks: Assess a model’s ability to understand codebases, fix cross-file defects, and implement complete features based on requirements. Key metrics are typically task pass rate and whether modifications introduce regressions.
- Cross-disciplinary reasoning tasks: Assess reasoning and citation abilities in specialized domains such as biology and law. The critical factor is whether answers can be traced back to correct knowledge sources.
- Terminal operation tasks: Assess a model’s ability to execute commands in isolated environments, interpret output, detect errors, and correct them. Key metrics are multi-step task completion rates and recovery capability after failures.
2. Knowledge Reasoning Is Strong, but Results Require Verification
In public professional reasoning tests, some frontier models perform well on biology and law questions. This capability mainly comes from two sources. First, training and fine-tuning on specialized corpora makes models more familiar with terminology and the relationships between concepts. Second, improved long-context handling allows models to reference lengthy legal texts or experimental descriptions at once.
Good scores do not mean the output can be adopted directly. Models can still cite non-existent legal provisions or present causal relationships that look plausible but are wrong. Therefore, in scenarios such as compliance review or diagnostic assistance, model output should serve only as a first-pass screening result, and key conclusions require review by qualified humans.
Whenever citing any model’s benchmark scores, note at minimum the benchmark name, version, sample size, evaluation date, and data source. Numbers missing this information should not be used for decision-making.
3. Terminal Operations and Long-Horizon Software Tasks Are the Main Weak Points
Terminal operations and software replication typically involve dozens or even hundreds of consecutive steps. Each step depends on the previous one’s output, so errors accumulate over time. Common failure causes include:
- Misspelled file paths or filenames.
- Command flags not supported by the current system version.
- Insufficient permissions causing command failures that the model misjudges as success.
- Failure to correctly parse stderr or exit codes, missing real error signals.
- No rollback after errors, so faulty state carries into subsequent steps.
Mechanically speaking, autoregressive models generate the next token one at a time and lack explicit tracking of global state across long workflows. This is a problem that must be compensated at the architecture level—prompt engineering alone usually cannot fully solve it.
4. Three Engineering Practices for Production Deployment
1. Split Roles with Multi-Agent Collaboration
Break complex tasks into three roles: planning, execution, and review. Taking software feature development as an example, the planning agent outputs a task list and interface contracts; the execution agent modifies code per task; the testing agent runs unit tests and feeds failure information back to the execution agent. Each role only touches context relevant to itself, reducing the burden of each individual inference.
Handoffs between roles should use structured formats, such as JSON with fixed fields, rather than relying on free-form text to pass state.
2. Execute Commands in Isolated Environments
Before an agent executes terminal commands, place them in an isolated container. The code below illustrates the architecture only and cannot run as-is. Before deployment, you need to add SDKs for the container service, object storage, and logging service, and implement snapshot functionality.
# Architecture sketch: not runnable as-is; dependencies and implementations requiredimport reimport shlexALLOWED_CMDS = {"ls", "cat", "pytest", "git"} # Command whitelistSECRET_PATTERN = re.compile(r"(token|password|secret)=\S+", re.I)class AgentSandboxManager:def __init__(self, container_service, object_storage, log_service, notifier):self.container_service = container_service # Cloud container service clientself.object_storage = object_storage # Object storage for intermediate artifactsself.log_service = log_service # Logging serviceself.notifier = notifier # Alerting channeldef create_isolated_env(self, task_id):"""Create a container with no external network and limited resources, plus a dedicated private storage bucket per task."""container = self.container_service.run(image="agent-sandbox:pinned", # Pinned image version to avoid driftnetwork="none", # External network disabled by defaultcpu=2,memory="4G",run_as_user="agent", # Run as non-root userttl_seconds=3600, # Auto-destroy on timeout)self.object_storage.create_bucket(f"agent-task-{task_id}", private=True)return container.iddef execute_command(self, container_id, cmd, timeout=60):"""Execute whitelisted commands with timeout control; sanitize output before logging."""argv = shlex.split(cmd)if argv[0] not in ALLOWED_CMDS:raise PermissionError(f"Command not in whitelist: {argv[0]}")# Pass arguments as an array, never as a concatenated shell string, to prevent command injectionresult = self.container_service.exec(container_id, argv, timeout=timeout)safe_out = SECRET_PATTERN.sub(r"\1=***", result.stdout)self.log_service.push(safe_out)if result.exit_code != 0:self.notifier.alert("Agent execution error; manual intervention required")return resultdef rollback(self, container_id, snapshot_id):"""Restore to a given snapshot, undoing erroneous changes from this round."""self.container_service.restore(container_id, snapshot_id)
The whitelist and sanitization rules above are only a starting point. Before going to production, you also need command log auditing, restricted writable directories, and manual confirmation for high-risk commands such as deletions and permission changes.
3. Call External Tools and Externalize State
For multimodal content such as charts and tables, integrate dedicated parsing tools or vision model APIs. Having tools produce structured results first, then handing them to the language model for reasoning, is more stable than asking a single model to handle both images and logic simultaneously.
Task progress, completed steps, and key outputs should be persisted to a message queue or database with checkpoints. After an agent crashes and restarts, it can resume from the latest checkpoint instead of starting over.
5. Selection and Risk Checklist
| Task Type | Recommended Architecture | Key Metrics | Risk Controls |
|---|---|---|---|
| Software replication | Three roles: planning, execution, testing | Test pass rate, regression error count | Work on separate branches; no direct changes to main |
| Terminal operations | Isolated containers, whitelist, snapshots | Multi-step completion rate, rollback success rate | Least privilege, no external network, full command auditing |
| Legal analysis | Retrieval-augmented generation plus human review | Citation traceability rate, human correction rate | Never issued directly as legal advice |
| Biological reasoning | Literature retrieval plus experimental validation | Consistency rate between conclusions and literature | Conclusions must be confirmed via experiments or experts |
Terminal operations involve high-risk actions such as deleting files and modifying permissions; these should require human confirmation before execution. New orchestration workflows should first be rehearsed in a non-production environment, and the rollback path verified, before going live.
Conclusion
LLMs already have strong knowledge reasoning capabilities, but there remains a gap between them and reliable execution on long-horizon terminal tasks. Architects should select models by task type, use multi-agent collaboration, isolated environments, and externalized state to compensate for weaknesses, and retain human review for key conclusions.
