Agent Runtime Architecture: Contracts, Scopes, Traces and Rollback
An agent is not an architecture. It is a participant inside one.
Most AI coding systems start with the agent and then bolt on tools. That order is backwards. The runtime should come first: the control plane that decides what the agent can see, what it can change, what must be verified, and how the system recovers when the agent is wrong.
The minimal architecture
A useful agent runtime has five layers.
1. Scope
The runtime starts by defining the boundary of work: repositories, modules, files, APIs, commands, and explicit non-goals. A scoped agent is easier to trust because its authority is bounded.
2. Contract
The contract describes invariants: no new dependencies without approval, no API breakage, no migration without rollback, no test coverage regression, no secret exposure. The model may be creative inside the contract. It should not be creative about the contract.
3. Execution
The execution layer maps proposals to tool actions. This is where permissions matter. Reading a file, editing a file, running tests, starting services, publishing a package, and deploying production are different classes of authority.
4. Trace
Every meaningful action should leave a trace: prompt, decision, command, diff, output, test result, and failure. Without traces, AI work becomes folklore. With traces, it becomes reviewable engineering.
5. Recovery
Rollback is not a luxury. It is part of the runtime contract. Checkpoints, git worktrees, patch sets, and named states turn experimentation into a reversible process.
The agent proposes; the runtime permits
This is the core pattern.
The model can propose a refactor. The runtime decides whether the refactor is in scope. The model can propose a dependency. The runtime checks policy. The model can propose a deployment. The runtime demands verification evidence.
That separation is the difference between an impressive assistant and an engineering system.
Why FACET and IOSM belong together
FACET expresses contracts and structured execution boundaries. IOSM turns improvement into a measurable loop. Together they point toward the same architecture: agents operate inside explicit rules, produce artifacts, and leave evidence behind.
The agent is useful. The runtime is what makes it safe to use repeatedly.
Related reading
- What Is an AI Engineering Runtime?
- Contracts Are Not Prompts
- Runtime Matters More Than the Agent
- IOSM CLI: AI Engineering Runtime for Deterministic Agentic Development
Place this architecture in context
Start with the canonical definition in What Is an AI Engineering Runtime?, then compare the broader design thesis in Runtime Matters More Than the Agent.
A practical fault-injection matrix for testing agent behavior when context, tools, state, and evaluators fail—not only when the model gives a wrong answer.
A practical release pattern for AI infrastructure: extract documentation examples into versioned fixtures, compile or execute them in CI, and treat drift as a product defect rather...
A practical incident-response runbook for consequential AI agents: freeze admission, preserve evidence, reconcile effects, drain safe work, and resume through a controlled recovery...
A practical conformance-testing pattern for AI personas: compile the effective identity, test critical behavioral invariants, evaluate subjective traits separately, and preserve a ...
A practical coverage matrix for placing guardrails around agent inputs, handoffs, tool calls, approvals, side effects, and final outputs without mistaking one check for end-to-end ...
A practical recovery pattern for AI agents: quarantine failed runs with enough identity, state, evidence, and authority data to inspect, repair, and replay them safely.
AI agent failures often begin when model latency, workflow deadlines, external-effect time, and evidence freshness are treated as one timestamp. This article defines a four-clock m...
A practical comparison of AI workflows, agent frameworks, harnesses, and runtimes based on the failures each layer must own—not vendor labels or feature lists.
A practical decision model for AI systems: keep effects, authority, state transitions, and evidence deterministic while preserving controlled variation where exploration creates va...
A failure-first diagnostic map for AI agents: locate defects across intent, context, decision, authority, effect, state, and evidence before changing the model.
A practical compatibility envelope for switching LLM models or providers without silently changing tool calls, output schemas, authority, or task meaning.
A practical decision matrix for choosing an AI evaluation tool by the boundary you need to test: prompt matrix, application behavior, benchmark registry, or production trace.
A migration guide for assigning graph state, side effects, retries, approvals, and recovery to the right boundary when combining LangGraph with Temporal.
A code-first guide to recording forward effects, compensation commands, preconditions, and receipts so an AI agent can recover from partial failure without pretending to roll back ...
A practical telemetry design for AI agents that preserves failure evidence, cost, latency, and control-flow visibility without copying prompts, tool arguments, or results into ever...
A practical migration guide for running an AI agent beside a trusted workflow, comparing decisions without allowing duplicate side effects, and promoting authority one action class...
A reproducible simulation shows why retry counters do not prevent duplicate side effects—and how stable effect identity plus reconciliation changes the outcome.
A failure-first guide to choosing retry, resume, rollback, compensation, or reconciliation for AI agent workflows based on side effects, durable state, and what the system can actu...
A practical comparison of four AI system layers—agent, harness, workflow, and runtime—and a decision matrix for adding only the control your failure mode requires.
A practical boundary map for AI systems: keep exploration diverse, make selection and side effects deterministic, and preserve the candidates and decision receipt.