AI Agent Architecture Differences: Why the Runtime Matters More Than the Loop

    This article explains why AI Agent architectures look identical on the surface and how their real differences lie in five runtime layers: tool schema validation, sandbox levels, approval granularity, state and checkpoints, and observability. It covers the trade-offs of each layer, practical implementation guidance, and why these "invisible" layers determine whether an Agent stays controllable, recoverable, and auditable over long-running tasks.

    1. Why They All Look the Same: The Loop Is Not the Innovation, the Runtime Is

    If you think of an Agent as “a model that calls tools,” every architecture looks the same: the model generates an intent for one step, the runtime selects and executes a tool, the result is written back into the context, and the model decides what to do next. In a demo that runs for only a handful of turns, this loop rarely exposes any engineering problem—the model can walk through the flow on its own, and whether the sandbox is a bit wider or narrower, or validation is looser or stricter, the audience will not notice.

    But if you think of an Agent as “a runtime that has to deliver,” the focus shifts immediately: it must remain controllable, recoverable, attributable, and auditable after dozens or even hundreds of turns. A demo asks “does it run through?” A runtime asks “when it goes off track, can you bring it back?” These two evaluation standards are why the real architectural differences all sit below the surface.

    The five layers below explain, one by one, what problem each solves, what options are available, and why someone has to pay for it.

    2. Layer 1: Tool Schema Validation—Deciding Whether “Close Enough” Works for the Model

    Tool calling is the only contract surface between the Agent and the outside world. A validation strategy is essentially a decision about who absorbs the uncertainty:

    • Loose validation: a high pass rate, and the model does not have to align fields precisely. The cost is that the runtime must tolerate redundant fields, type drift, and default-value filling, and dirty data flows all the way to the business side.
    • Strict validation: errors surface at the earliest step, and the model immediately gets a readable error and can self-correct. The cost is one to several extra turns of interaction—that is, more tokens and more time.

    A schematic validation skeleton:

    1. def validate(tool_name, args):
    2. schema = REGISTRY[tool_name].schema
    3. errors = schema.validate(args) # required fields, types, enums, ranges
    4. if errors:
    5. return ToolResult(ok=False, error=format_for_model(errors))
    6. return ToolResult(ok=True, args=schema.coerce(args))

    Three key practices matter here. First, error messages must be written “for the model to read,” not as a stack trace meant for humans. Second, separate fixable errors (missing fields, out-of-range enums) from unfixable ones (insufficient permissions, nonexistent resources): feed the former back to the model to retry, and terminate and report the latter directly. Third, tag idempotent and non-idempotent tools with different retry semantics to avoid “retry equals duplicate order.”

    This layer has no globally correct value, only a cost placement: you choose which side to pay on.

    3. Layer 2: Sandbox Levels—The Read-Wide, Write-Narrow Asymmetry Is Intentional

    The risk profile of an Agent is asymmetric: read operations usually do not change the world, while write operations do. Mature solutions therefore commonly adopt a level design of “relatively wide reads, relatively narrow writes, and network access closed by default.” Three common levels can be abstracted as:

    1. Read-only level: context and dependencies can be read, but any persistent write is forbidden;
    2. Workspace-write level: writes are allowed only within the current working directory and its subdirectories;
    3. Fully open level: used for debugging inside an isolated environment, and must be paired with strong approval and a short lifecycle.

    For isolation implementation, a common industry combination is kernel-level mechanisms: namespaces or low-level sandboxes restrict the filesystem and process view, system-call filtering restricts executable capabilities, a separate network namespace is used when the network must be cut off, and when network access is needed, outbound requests are funneled to a proxy outside the sandbox so that domain allowlists and auditing can be applied.

    Implementation point: make “level” and “approval policy” two orthogonal dimensions rather than a single switch. The level describes “what can be done,” and approval describes “whether to ask before doing it.” Coupling the two causes policy explosion and makes them impossible to reuse stably across long tasks.

    4. Layer 3: Approval Granularity—Not “Whether to Ask,” but “At What Granularity to Ask”

    Many teams turn human approval into a boolean switch, and the result is either constant interruptions or approval that exists in name only. A truly usable design splits approval into multiple independent policy lines, for example: sandbox privilege-escalation approval, rule-hit approval, information inquiry for external extension calls, permission requests, and skill/plugin enablement approval. Each can be set to “never ask / ask on demand / always ask,” and the approver can be an automated reviewer rather than a human.

    The benefit is that low-risk actions can be fully automated while high-risk actions are intercepted precisely; at the same time, approval records naturally become part of the audit log. Granularity at this level shows that “whether to ask” is a policy line, not a button.

    5. Layer 4: State and Checkpoints—Cheap, but No Substitute for Version Control

    Long tasks have two state problems: first, how to inject the instructions and conventions of “who I am”; second, how to recover the progress of “where I got to.”

    Instruction injection usually uses layered assembly: an enterprise-level baseline, project-level conventions, user-level preferences, and local temporary overrides, stacked layer by layer from the project root toward the current working directory, with higher priority the closer it is to the working directory. A total size cap is set, and truncation applies when exceeded, to avoid the context being crowded out by documents. After context compaction, key conventions are re-injected from disk to ensure that “compaction does not lose principles.”

    Checkpoints cover only filesystem snapshots, not external side effects (messages already sent, orders already placed, remote configurations already changed). This leads to two conclusions: it is cheap enough to create at high frequency; and it can never replace version control and idempotent design for external systems. Making side effects deduplicable and compensable is the prerequisite for long-task recoverability.

    6. Layer 5: Observability—Interception Points Are Also Attribution Points

    If you can add only one layer, add this one. There is a natural interception point before tool execution: the arguments have been generated but not yet executed. Here you can record the arguments, make policy decisions, and time the execution; and when an abort is needed, feed readable stderr back to the model so it retries with a reason rather than blindly. The interception point is the attribution point—this is the core of an operable Agent.

    For tracing, it is recommended to align with the industry-common generative AI telemetry conventions, covering at least input/output token usage, tool call counts and durations, and failure classification. Note that such conventions are still evolving and field names may change, so converge the instrumentation into a single adapter layer to avoid large-scale changes when fields are renamed.

    7. What the Five Layers Have in Common: All “Negative Assets,” With the Bill Paid on Long Tasks

    None of these five layers produce a demo effect: users cannot see them, and skipping one does not immediately cause an error. Their cost is incurred immediately, while the payoff is delayed and only settled in tasks that run for dozens of turns—context pollution, unauthorized writes, unrecoverable failures, and errors that cannot be attributed.

    So to judge whether an Agent architecture is mature, do not look at how pretty its loop diagram is; look at whether the levels of these five layers are clear, whether the policies are orthogonal, and whether the instrumentation is portable. If managed hosting is needed, prefer a cloud environment with general capabilities such as container platforms, logging services, monitoring and alerting, and object storage, and leave the sandbox, record-keeping, and recovery to the infrastructure. For example, Baidu AI Cloud can meet the runtime hosting needs with these general capabilities.