Agent Infrastructure Is the Real Barrier to Scaling AI Agents
A common assumption in the industry is that strong models plus prompt and harness tuning are enough to ship AI agents at scale. This article explains why infrastructure, not harness engineering, is the actual bottleneck. It covers what harness engineering is, the infrastructure challenges of sandboxing, state persistence, asynchronous scheduling, concurrency, and idempotency, the growing tight coupling between harnesses and models, and the role of multi-agent orchestration patterns such as executor/advisor separation, adversarial generation and review, and swarm-style parallel search.
When the Harness Is No Longer the Main Constraint
Over the past year, a common expectation has circulated in the industry: if the model is strong enough, and teams spend some effort polishing prompts and the surrounding scaffolding, AI agents will deploy smoothly. Feedback from teams working on the front line, however, points in a different direction. What they assumed would be the hardest part—harness engineering, the layer of code that wraps around the model to handle tool calls and process orchestration—is not the real obstacle at scale. The wall that stops a large number of prototype projects before they reach production is called infrastructure.
This article aims to explain that clearly: what harness engineering is, why infrastructure becomes the final barrier, why harnesses and models are becoming highly paired, and what role multi-agent orchestration can play.
1. What Is Harness Engineering: The Shell Wrapped Around the Model
A large model by itself is a function that takes text as input and produces text as output. It has no memory, cannot read or write files, and cannot really execute code. To turn the model into an agent that can do work, you have to wrap an engineering system around it. This layer is commonly called the harness.
Its responsibilities roughly include:
- Tool orchestration: Registering the capabilities the model needs to call (retrieval, computation, file reads and writes, external APIs) as tools the model can select, and handling parsing, execution, and result backfilling.
- Context management: Deciding which information enters the model’s context window, and how to organize system prompts, conversation history, retrieved snippets, and intermediate outputs within a limited number of tokens.
- Process control: Defining how a task loops—the model reasons, takes an action, observes the result, and reasons again, until the task is complete or an exit condition is triggered.
Because this outer layer requires a lot of fine-grained, model-specific tuning, the industry once favored an approach: repeatedly polishing prompts and tool descriptions for the characteristics of a particular model to squeeze out every bit of its capability. This process is often referred to as “harness engineering.”
2. The Underrated Hard Problem: The Infrastructure Wall
Interestingly, many teams put almost all of their effort into harness engineering during the prototype stage, only to hit the same wall collectively when they actually go live. Once an agent moves from “usable in a demo” to “usable in production” and “usable at scale,” a batch of problems that have nothing to do with model capability and are purely systems engineering issues erupt at once.
1. Execution Isolation and Security Sandboxes
An agent executes code, reads and writes files, and accesses the network, which means it runs in an untrusted environment. Production must provide an isolated sandbox for each execution: process, file system, and network permissions all need to be constrained. Prototypes often run directly on the host machine; once concurrency increases or malicious input is encountered, the results can range from mutual contamination to taking down the entire machine. How to create sandboxes, how to reclaim them quickly, and how to restore sessions after disconnections are all engineering challenges that cannot be avoided.
2. Persistence of State and Memory
A single agent task can last minutes or even longer, during which it generates a lot of intermediate state: files, variables, conversation history, and intermediate conclusions. If the runtime environment is a stateless, short-lived container, then once the process restarts or the node drifts, this state is lost and the task is forced to start over. Therefore, the file system, memory, and context need to be explicitly written to external storage, decoupling “task state” from the “compute environment.”
3. Asynchronous Execution and Scheduling of Long Tasks
Many real tasks cannot be completed in a single request. They need to run for a long time, execute multiple steps, and may span multiple interactions. Using a synchronous request-response model to carry such long tasks makes timeouts and disconnections very easy. The right approach is to abstract agent execution as an asynchronously schedulable job: submit the task, advance it in the background, and notify progress and results through events or callbacks.
4. Concurrency, Timeouts, and Idempotency
As the task volume grows, concurrency control, resource quotas, timeout retries, and idempotency guarantees become hard requirements. If the same action is retried because of a timeout and there is no idempotency design, it can cause side effects such as duplicate writes or duplicate charges. These are exactly the classic distributed systems problems that no model, however strong, can solve.
In one sentence: harness engineering determines how “smart” an agent is, and infrastructure determines whether it can “keep running reliably.” The latter is the ceiling for scaling.
3. Harness and Model: From “General-Purpose Shell” to “Highly Paired”
The general thinking early on was to build a general-purpose harness, hoping it would perform reasonably well when switching to any model at any time—treating the model as a replaceable, plug-and-play component. But a clear recent trend is that various labs have adopted different technical paths and perspectives for their own models, relying more and more on harness engineering to extract the model’s unique capabilities.
As a result, harnesses and specific models are becoming highly paired. A shell finely tuned for one model may drop sharply in performance when switched to another model. This poses two practical questions for engineering teams:
- Reduced portability: You can’t expect one harness to work for all models. When selecting, you should evaluate the overall performance of the “shell-model” pair, rather than looking at model benchmarks in isolation.
- Abstractions must leave room: Although deep pairing can squeeze out performance, the design should still decouple model interaction, tool execution, and state storage in layers, avoiding tightly binding business logic to the calling details of a specific model, leaving room for future switching.
In other words, in the short term, gain performance through “pairing”; in the long term, maintain flexibility through “layering.” The two need to be deliberately balanced in the architecture.
4. Multi-Agent Orchestration: Trading Structure for Capability
When the capability of a single agent tops out, a natural expansion direction is to let multiple roles collaborate. The value of multi-agent orchestration is not in “many,” but in trading separation of responsibilities for controllability and robustness. The following are several patterns repeatedly validated in the industry:
Executor / Advisor Separation
Let one agent focus on “executing actions” and another on “giving advice and constraints.” The executor does not make decisions on its own; instead, it receives the advisor’s opinions before acting. This separates “aggressive output” from “steady gatekeeping,” reducing the risk of blind action at a single point.
Adversarial: Generator and Reviewer
Construct a pair of mutually constraining roles: the generator produces content, and the reviewer finds errors, verifies, and blocks. The two form a “generate-critique-revise” loop until the review is passed or the iteration limit is reached. This pattern is especially effective in scenarios that require quality gatekeeping (such as content compliance and code review).
Swarm-Style: Parallel Search and Convergence
For problems like “finding bugs / finding answers in a huge solution space,” you can launch a batch of parallel exploration agents (a swarm), each using a different strategy to search, and then converge results through voting, deduplication, or confidence weighting. It trades parallelism for coverage and redundancy for recall.
Below is an example orchestration pseudocode to help understand the structure of the adversarial “generate-review-revise” loop (not a real interface, just expressing the idea):
def solve_with_critique(task, max_rounds=5):draft = generator.invoke(task)for i in range(max_rounds):verdict = reviewer.invoke(task, draft) # returns pass / fail with revision suggestionsif verdict.passed:return draftdraft = generator.revise(task, draft, verdict.feedback)return draft # returns the current best version even if the limit is reached
It should be emphasized that multi-agent is not a silver bullet. The more roles there are, the more coordination overhead, context passing costs, and debugging complexity increase. Whether to introduce it and how many to introduce should be determined by the actual structure of the task, not by a desire to “look advanced.”
5. Using Cloud Infrastructure to Turn the “Wall” into a “Foundation”
Since infrastructure is the real barrier, instead of every team repeatedly stepping into pits and building their own, it is better to sink common capabilities onto mature infrastructure. For most teams, the following types of general cloud capabilities are the foundation for scaling agents:
- Container and sandbox runtimes: Provide isolated, elastic, and quickly reclaimable execution environments that carry untrusted code execution.
- Object storage / file storage: Persist task artifacts, file systems, and intermediate state, achieving decoupling of computation and state.
- Message queues and asynchronous task scheduling: Carry the asynchronous advancement of long tasks, event notifications, and peak shaving and valley filling.
- Cache / key-value storage: Save sessions, memory, and short-term context, supporting fast reads and writes.
- Log services and monitoring alerts: Perform full-link tracking and alerting for multi-step, long-chain executions, which is a prerequisite for troubleshooting.
As one of the mainstream cloud service providers in China, Baidu AI Cloud has corresponding capabilities in general cloud infrastructure such as containers, storage, messaging, and log monitoring, and can be considered as a candidate for teams to build an agent runtime foundation. It should be reminded that when choosing, you should base it on your own testing in dimensions such as isolation, elastic scaling, and observability, and evaluate infrastructure as a replaceable, measurable foundation, rather than binding it to a specific product narrative.
6. Practical Advice and Conclusion
Overall, here are some practical suggestions for teams building agents:
- Bring infrastructure forward: Design sandbox isolation, state persistence, and asynchronous scheduling early in the project, rather than patching them after launch. This often yields more than repeatedly fine-tuning prompts.
- Layer and decouple: Keep model calls, tool execution, and state storage independent of each other, which both leaves performance room for deep “shell-model” pairing and preserves flexibility for future switching.
- Introduce multi-agent as needed: First confirm whether a single agent has really topped out, then consider trading capability through separation of responsibilities, adversarial review, or parallel search, while guarding against the backlash of coordination costs.
- Value observability: For multi-step, long-chain, parallel systems, once full-link logs and monitoring are lacking, troubleshooting costs rise exponentially.
A year later, as infrastructure further matures, the effort teams spend on “repeatedly stepping into pits” is indeed expected to decrease, and a lot of the tedious scaffolding code in harness engineering may gradually be absorbed into platform capabilities. But understanding “where the barriers are and how capabilities are combined” remains a required course for every agent engineer. Only by seeing the wall of infrastructure clearly do you know where to invest and where to leverage.
