Why AI Agent Architectures Look Identical

    This article explains why AI Agent demos appear to share the same architecture, and how the real differences emerge when an Agent is treated as a runtime that must be delivered rather than a one-off demo. It walks through five layers outside the main loop—tool argument validation, sandbox levels and read/write asymmetry, approval granularity, state injection and checkpoints, and observability with attribution points—and closes with practical implementation recommendations.

    1. Why Agents in Demos All Look the Same

    When you think of an Agent as “a model that calls tools,” the architecture naturally converges: the model emits an action, the runtime executes it, the result is fed back, and the next turn begins. This loop leaves almost no room for innovation. In a three-to-five-turn demo, the runtime barely shows itself, and the model can complete the whole run on its own capability. Whether the isolation boundary is a bit wider or narrower, the audience will not notice. So everyone ends up looking at the same diagram.

    The real divergence appears once you change perspective: when an Agent is treated as “a runtime that must be delivered” rather than “a single demo,” the question shifts from “does it run” to “does it survive a hundred runs, can failures be located, and can overreach be blocked.” At that point, quality is decided by five fallback layers outside the main loop.

    2. Layer 1: The Trade-off in Tool Argument Validation

    Most tool-call failures are not because the model “does not know how,” but because the arguments are “close enough.” The validation strategy determines how much tolerance the system has for “close enough.”

    • Lenient validation: high pass rate and a short path, at the cost of dirty data flowing downstream—extra fields, type drift, and out-of-range enum values.
    • Strict validation: errors surface immediately at the boundary, at the cost of more model retries and higher token and latency costs.

    There is no globally correct value here, only where the cost lands. A schematic validation skeleton:

    1. def validate(tool, args):
    2. schema = registry[tool].schema
    3. errors = schema.check(args) # required fields, types, enums, ranges
    4. if errors:
    5. return ToolResult(ok=False, feedback=errors) # structured feedback
    6. return ToolResult(ok=True, args=schema.coerce(args))

    The key detail is how feedback is returned: handing validation errors back to the model as structured text is more effective than throwing an exception and terminating the whole turn. The model can usually self-correct within one or two rounds.

    3. Layer 2: Sandbox Levels and Read/Write Asymmetry

    Isolation capability is usually divided into three levels: read-only, writable workspace, and fully open. It is also orthogonal to approval policy—meaning “how much can be written” and “whether to ask a human” are two independent dimensions that can be combined in any way.

    In engineering practice, a common approach in the industry combines kernel-level mechanisms: namespaces and system call filtering construct a least-privilege view, and a separate network namespace is used when network access must be cut off; on the desktop side, the platform’s built-in sandbox framework is used. One repeatedly validated design principle is read/write asymmetry: the entire disk is readable by default, only the current working directory and its subdirectories are writable, and network access is forwarded through a proxy outside the sandbox.

    1. Read: wide → allowed (does not change the world)
    2. Write: narrow → workspace only
    3. Net: proxy → denied by default, allowed per domain

    The reasoning is straightforward: read operations do not change world state, so the risk is controllable; only writes and network access have external side effects and must be narrowed.

    4. Layer 3: Approval Granularity Is a Policy Line

    Mature implementations do not make approval a single switch. They break it into multiple independent dimensions: sandbox overreach approval, rule-hit approval, external request authorization, permission requests, skill loading approval, and so on, each configurable on its own. At the same time, the approver itself can be configured as a human or an automated reviewer.

    Finer granularity brings composable policy: trusted internal repositories can be exempt from review, production writes require human confirmation, and automated review handles low-risk batch scenarios. If approval is a single switch, teams can only choose between “frequent interruptions” and “fully open.”

    5. Layer 4: State Injection and Checkpoints

    Context and state management usually consist of two parts.

    The first is the layering and overriding of memory files: organized in four levels—enterprise, project, user, and local—with higher priority the closer they are to the current working directory. When the total exceeds a configured threshold (commonly on the order of tens of KiB), it is truncated and re-injected from disk after context compaction, avoiding instruction drift in long tasks.

    The second is checkpoints: most implementations cover only filesystem changes, not external side effects. This leads to two conclusions—checkpoints are therefore cheap and can be created frequently; but they cannot replace version control, nor can they roll back a write request that has already been sent. So side effects must be covered by idempotency keys, deduplication tables, or transactional compensation.

    6. Layer 5: Observability and Attribution Points

    Cross-cutting concerns determine whether a failure can be located. The pre-tool-execution hook is the most valuable interception point: arguments have been generated but not yet executed, so you can both rewrite and block, and it is naturally an attribution point—feeding diagnostic information back to the model via a non-zero exit code, forming a closed loop.

    For tracing, it is recommended to follow the OpenTelemetry GenAI semantic conventions, collecting at least input and output token counts, model identifier, tool name, and duration. It is worth noting that these conventions are currently marked with low maturity, and field names may still change, so the collection layer should add a field-mapping isolation layer to prevent upstream renames from breaking dashboards.

    7. Implementation Recommendations

    1. Define the risk boundary first, then choose the sandbox level and approval combination—not the other way around.
    2. Always feed validation errors back in a structured form; never throw and terminate directly.
    3. Treat checkpoints only as accelerators; version control and side-effect idempotency cannot be skipped.
    4. Integrate hooks and tracing at the same time to ensure you can “block” and “trace.”
    5. Use general cloud capabilities: container platforms run sandboxes, object storage holds checkpoints, and logging and monitoring/alerting services handle attribution.

    The main loop sets the floor; the five fallback layers set the ceiling. Delivering an Agent as a runtime is the real source of architectural difference.