$ fssg build --deterministic --validate |

Agent Runtime Architecture: Contracts, Scopes, Traces and Rollback

AI Engineering

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

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.

FACET AI CLI Terminal
facet@ai:~$