What it is

Agent architecture at production scale is the set of engineering decisions that determine how an AI agent behaves under real operational conditions: variable load, untrusted code execution, credential exposure, long-running sessions, and the kind of failure modes that never appear in a controlled demonstration. The term covers three separable concerns that often get collapsed into one: how the agent reasons, how it acts, and how the infrastructure underneath prices and schedules the compute those two activities require.

A production agent is not a demo agent with more uptime. The architectural differences between the two are structural, and understanding them before a contract is signed is what determines whether the gap between slideware and reality is recoverable or not.

How it works

The clearest framework for thinking about this comes from Anthropic's own engineering practice. As Katelyn Lesse and Angela Jiang describe in their Latent Space conversation, Anthropic's Managed Agents architecture separates what they call the brain from the hands: the session harness that maintains context and logic runs independently from the sandbox environment that actually executes generated code. The harness can persist while the sandbox is created on demand, which means a failed execution environment does not take the whole agent session with it.

That separation produces three concrete benefits that matter differently depending on what you are building.

Security. When generated code runs in a sandbox that holds no service credentials, there is no credential for that code to reach. Credentials are held separately and attached through a proxy; network controls limit where sandbox traffic can go. As the Latent Space episode on the Managed Agents architecture describes it, the question to ask of any agent runtime is not whether credentials are protected in principle but whether they are even present in the environment where untrusted code executes. The architectural answer should be no.

Reliability. An earlier approach at Anthropic put the entire coding agent inside a sandboxed API, which meant that starting the agent required starting the environment first, and that a vanishing sandbox took the agent with it. Separating the components allowed each to be managed and recovered independently, which in a long-running agentic workflow is the difference between a recoverable error and a lost session.

Latency. Startup cost is not a minor inconvenience; it compounds every time an agent loops through a task. When the harness does not need to restart with the sandbox, the first token of a response can arrive faster, and the platform has room to pursue further latency improvements without restructuring the security model.

Memory and multi-agent behaviors are built from the same primitives. Anthropic's "dreaming" feature, which lets one agent inspect another's prior work and write memories back, is implemented as a higher-level behavior composed from the base managed-agent layer rather than as a separate system. This matters architecturally because it keeps the base harness simple and testable while still enabling complex behaviors on top.

The infrastructure layer underneath these agent designs carries its own set of decisions. Erik Bernhardsson, CEO of Modal, explains in conversation with Latent Space that real AI compute demand is non-rectangular: it spikes, falls, and grows throughout the day in ways that rarely match the fixed-capacity contracts through which GPU compute is traditionally sold. Buy capacity sized for peak demand and you pay for idle hardware during troughs; buy less and you miss load when it arrives. Modal's approach is to pool demand across thousands of customers, smooth the aggregate, and let individual customers use elastic slices. The practical effect is that a firm running agents does not need to predict its own compute shape, because the infrastructure provider is absorbing that uncertainty at scale.

Sandboxes illustrate how infrastructure economics and agent architecture meet. Modal launched sandbox support after noticing that language models were generating code that would need somewhere to run. Early adoption was modest enough that the team considered discontinuing the feature; then coding agents, background agents, and reinforcement learning workloads created demand that made sandboxes grow to roughly one-third of Modal's revenue, a result Bernhardsson says he did not predict at launch. Fast sandbox startup became a product requirement, not a performance footnote, because an agent that creates an environment, runs code, inspects the result, and iterates may do that cycle dozens of times in a single session, and the latency of each cycle adds up. Modal's approach to this, as described in their serverless GPU engineering write-up, involves process checkpointing, GPU memory snapshots, a custom filesystem, and a buffer of available GPUs, so that bringing another execution environment online requires less work each time.

Architectural concern Demo-scale approach Production-scale requirement
Credential handling Credentials in environment variables Credentials held externally, attached via proxy; absent from execution sandbox
Session persistence Agent restarts if environment fails Harness persists independently; sandbox failure is recoverable
Compute scaling Fixed allocation or single machine Elastic, pooled capacity sized by aggregate demand
Sandbox startup Acceptable if infrequent Engineered for speed via checkpointing and memory snapshots
Multi-agent behaviors Hardcoded pipelines Composed from base primitives; harness stays simple

When to use it

This architecture pattern applies whenever an agent will run in conditions the builder does not fully control: external API calls, generated code execution, sessions that need to survive hours or days, or multiple users sharing infrastructure. In practice that means almost any agent a professional-services firm deploys internally or offers to clients, because the defining characteristic is not complexity but exposure.

If the agent operates entirely within a single controlled session, reads only from curated data, and touches no live systems, the brain-hands separation is more engineering overhead than it is worth. That describes a small category of real deployments. The larger category, agents that call APIs, write to databases, generate code, or maintain context across asynchronous work, needs the separation even if the organization does not realize it yet.

The compute economics argument applies at a lower threshold than most buyers expect. A firm running even a few hundred agent sessions per day will have an aggregate demand profile that is non-rectangular, and paying for peak capacity on a fixed contract to handle that profile means paying for idle hardware most of the time. Elastic infrastructure that pools load is not just a large-enterprise consideration; it is relevant to any shop where agent utilization is uneven, which is most of them.

Pitfalls

Treating the harness as a detail. The harness is the application. It is where context accumulates, where progress survives failures, and where the agent's behavior in production differs from its behavior in a demo. As the Latent Space conversation with Lesse and Jiang notes, improving a harness starts to resemble research: you pick a goal, measure behavior, inspect failures, and iterate. Teams that treat the harness as boilerplate configuration will discover this the hard way, usually after a session loss in production that a better harness would have caught.

Putting credentials where code runs. This is the specific failure mode the brain-hands separation is designed to prevent, and it shows up in first-generation implementations with striking regularity, often because the developer who built the proof of concept put credentials in environment variables for convenience and nobody restructured the security model before production. If credentials are present in the sandbox, generated code can reach them, whether or not that was the intent.

Underestimating startup cost. An agent that loops ten times through a generate-execute-inspect cycle pays the sandbox startup cost ten times. If that startup takes several seconds, the cumulative latency is noticeable to users and meaningful to cost. Infrastructure features like process checkpointing and GPU memory snapshots exist because this problem is real at scale; the question for any implementation is whether the execution environment has been engineered for fast restoration or just for correctness.

Conflating training incidents with production safeguards. Anthropic is explicit, as described in their Latent Space conversation, that production safeguards and training-time alignment are separate concerns: isolation, credential protection, network controls, and safety classifiers are production engineering problems, not properties inherited from how the model was trained. A model that behaves well in training will still be used in ways training cannot anticipate, which means production safety requires production engineering.

Betting on rectangular compute. A fixed-capacity GPU contract priced for peak demand is the right answer if demand is actually rectangular. It almost never is. The mismatch between how compute is sold and how agents actually use it is the core problem Modal's pooling approach addresses, and the financial risk is real on both sides: overbuy and you pay for idle capacity, underbuy and you miss agent workloads when they arrive together.

Sources