The Three-Layer Architecture Evolution of a Universal Agent Engine
This article explains why the runtime environment around a model, often called the harness, determines agent usability more than the model itself, and how a single agent core can be exposed through three interfaces: a terminal layer for developers, a GUI layer for general knowledge workers, and an API layer for enterprise automation. It covers why the moat sits in the runtime rather than the interface, the subscription arbitrage pressure that follows, a five-step path to building a governable three-layer agent system, and the main risks of over-permissioning, context pollution, and missing evaluation.
From Single-Model Calls to a Unified Agent Engine
For the past two years, most industry thinking about AI coding tools stopped at “a stronger model plus smarter prompts.” That view breaks down quickly once tasks expand from single-file completion to cross-repository refactoring, and from code generation to document processing and spreadsheet analysis. Model-only approaches hit hard limits: bounded context windows, unreliable tool calls, no state management for long-running tasks, and execution results that are hard to reproduce.
A shared conclusion has emerged: what determines whether an agent is usable is not the model but the runtime layer wrapped around it, commonly called the harness. The harness handles context assembly, tool registration and dispatch, permission checks, execution sandboxes, log tracing, and failure retries. The model is a replaceable inference unit; the harness is an engineering asset. When a cloud vendor recently shipped a collaborative office agent aimed at non-coding roles, the substance was not a new model but a new interaction shell over an existing universal agent engine. That move marks the shift in competition from model capability to control over the runtime.
Three Interfaces, One Engine, Three Audiences
The key design decision is to expose one agent core through three interfaces, each covering a different part of the knowledge economy.
- Terminal layer: aimed at developers and technical staff. It emphasizes composability and scriptability, supports high-frequency, small-step iteration in the style of “vibe coding,” and lets developers state intent in natural language while the agent makes multi-file changes and verifies them.
- GUI layer: aimed at general knowledge workers and business analysts. Agent capability is packaged as everyday office tasks such as document drafting, spreadsheet processing, and research summarization, with no need to understand commands or configuration.
- API layer: aimed at enterprise automation and system integration. It runs headless, embeds into CI/CD pipelines, and handles batch task scheduling and result collection.
All three layers share the same context management, tool protocol, and permission model; only the interaction form and default parameters differ. The engineering payoff is straightforward: fix one tool-call defect and all three layers benefit; add one capability and it only has to be registered once on the engine side.
The difference in call shape is roughly like this:
# Interactive layer: human-readable, interruptible, follow-up friendlyAgent task: compile this week's defect list and sort by severity# API layer: unattended, structured input and output{"task": "aggregate_defects","input": {"range": "last_7d", "group_by": "severity"},"output": {"format": "table", "sink": "object storage path"}}
Why the Moat Sits in the Runtime, Not the Interface
Model capability is clearly commoditizing: same-tier models from different sources keep converging on general tasks, and price competition is intense. If product value rests entirely on the model, a cheaper and stronger substitute can erase it at any time. The runtime is different. It accumulates the tool ecosystem, the permission system, the ways enterprise knowledge is connected, and experience in workflow orchestration, all of which make migration expensive.
Control over the runtime also creates a defensive need. When subscription pricing and usage-based pricing diverge, a large number of “wrapper” applications appear that resell service by calling low-cost subscription quotas in bulk, so-called subscription arbitrage. This behavior undermines capacity planning and service quality, so platform owners tend to tighten call boundaries and add identity and behavior checks. The lesson for users: plan agent capability as governed internal infrastructure, not as a cheap resource to be arbitraged without limit.
Implementation: Building a Governable Three-Layer Agent System
To reproduce a similar architecture in your own environment, proceed in this order.
- Unify the core first. Consolidate context assembly, tool registration, permission decisions, the execution sandbox, and audit logs into a single engine, and stop individual business lines from wiring up their own call logic.
- Define the tool protocol. Each tool description should include name, purpose, input schema, side-effect level, and timeout policy; tools with high side effects should require explicit confirmation by default.
- Set defaults per layer. The interactive layer favors explainability and interruptibility, the API layer favors determinism and retryability, and the GUI layer favors templates and result previews.
- Connect general cloud capabilities. Use object storage for artifacts, a message queue to decouple tasks, a container platform for isolated execution, and logging plus monitoring and alerting for observability.
- Close the evaluation loop. Run a fixed task set to regress accuracy, rework rate, and average latency; every prompt or tool change must pass the regression.
Engine core├── Context assembly (retrieval, trimming, prioritization)├── Tool registry (protocol, side-effect level)├── Permissions and sandbox (least privilege, read-only first)└── Audit and replay (full-chain tracing, failure reproduction)
Risks and Where This Is Heading
Three risks deserve attention. First, over-permissioning: once an agent holds write access, the blast radius of a mistaken action grows fast. Second, context pollution: irrelevant information accumulates during long tasks and judgment drifts. Third, missing evaluation: without a regression mechanism, capability degradation goes unnoticed. The corresponding controls are least privilege with second confirmation, layered context with periodic compaction, and routine regression over a fixed task set.
Looking ahead, competition will concentrate in three places: the breadth and quality of the tool ecosystem, the consistency of cross-session memory and state management, and the compliance boundary of enterprise knowledge access. Baidu AI Cloud’s accumulated capabilities in container platforms, logging, monitoring and alerting, and object storage provide a foundation for building this kind of governable agent system. For technical teams, the earlier you treat agents as infrastructure rather than toys, the stronger your position in this round of architectural evolution.
