# How it works
An event-sourced control plane where contracts precede execution, policy decisions happen before dispatch, and the ordered log reconstructs the run.
Source: https://aioverload.io/how-it-works/
{{< section id="pipeline" eyebrow="THE RUNTIME" title="The event log is not an audit add-on. It is the runtime." >}}
AiOverload turns agent work into deterministic workflows. A run starts from a versioned definition, advances through ordered events on NATS JetStream, and can be reconstructed decision by decision. The log holds dispatch, holds, approvals, retries, outputs, and terminal state.
01Declare
Workflow, goal, acceptance, tools.
02Decide
Route, allow, hold, or block.
03Dispatch
Worker, sidecar, scoped access.
04Judge
Check output against acceptance.
05Record
Append every transition to the log.
The important consequence: a report is not generated after the fact and asked to explain a run. The evidence is the same ordered state that drove it.
{{< /section >}}
{{< section id="contracts" eyebrow="CONTRACTS BEFORE CODE" title="Every surface agrees on the message." class="section--tint" >}}
Unknown keys are loud errors. Services agree by schema, not by convention. At the stamped engine commit, **{{< engine block="contracts" >}} JSON schemas** describe the wire contracts exchanged by the engine and reflex gate.
| Contract | What it pins down |
|---|---|
| Workflow definition | Steps, goals, acceptance criteria, dependencies, runtime, and grants |
| Run events | Ordered transitions and the payloads attached to them |
| Reflex decisions | Typed questions and constrained decisions, not free-form chat |
| Tool plane | Registry-allowlisted MCP servers and per-run grants |
| Sidecar boundary | argv-only execution and the run workspace contract |
This discipline makes drift visible early: a producer and consumer either agree on the schema or the build fails.
{{< /section >}}
{{< section id="gate" eyebrow="REFLEX GATE" title="Small judgment. Deterministic rails." >}}
The reflex gate is a decision service, not another autonomous agent. A small non-generative model answers typed questions; deterministic thresholds turn those answers into routing, escalation, and holds.
- **Step escalation:** risk above `0.70` holds for human input.
- **Tool escalation:** gateway-routed calls at or above `0.45` escalate.
- **Fail closed:** if the gate is unreachable at dispatch, a gated step does not proceed ungoverned.
- **Measured regression:** verdict and goal judgments have CI-enforced accuracy floors on a pinned model checkpoint.
The gate is triage. It does not make the containment boundary stronger, and it does not see harness-native tools that never cross the gateway. Those limits are part of the [threat model](/security/#gaps).
{{< /section >}}
{{< section id="gateway" eyebrow="TOOL PLANE" title="An undeclared server does not exist on the wire." class="section--dark" >}}
For gateway-routed work, the agent manifest’s allowlist is rendered into the run configuration and enforced by agentgateway. Default-deny is therefore both a configuration rule and a network rule.
Per-run credentials are minted and revoked for supported gateway-backed provider runs. The LLM plane through the gateway remains opt-in, and subscription-based harness sessions can inherit credentials instead. The [security page](/security/) grades those boundaries separately rather than calling every runtime “sandboxed.”
```text
manifest grant → run config → agentgateway → allowlisted MCP server
└─ undeclared target → denied at the wire
```
{{< /section >}}
{{< section id="replay" eyebrow="REPLAY" title="History you can execute, not just read." >}}
Replay takes the ordered events and the definition hash, then re-verifies the run’s decisions. That gives operators a concrete way to inspect why a run waited, who changed its course, and whether the recorded definition matches.
```bash
aioctl replay
```
```text
definition.verified 84f2…c91a
events.replayed 17/17
approval.verified review_2
run.completed 8/8 steps
```
The output above is illustrative formatting, not a captured benchmark. The capability claim is pinned to the engine’s `aioctl replay` implementation and end-to-end tests.
{{< /section >}}
{{< section id="mapping" eyebrow="COMING FROM DEVOPS?" title="Familiar ideas, applied to agent execution." class="section--tint" >}}
| If you know… | The AiOverload equivalent |
|---|---|
| GitOps | Agents, workflows, and grants declared in a reviewed repository |
| Kubernetes admission control | Pre-flight policy decisions and gateway refusal before execution |
| CI/CD manual approval | `step.held`, explicit operator input, and a recorded decision |
| Terraform drift detection | Reconciliation between desired registry state and the served fleet |
| Distributed tracing + audit logs | Ordered run events that can be replayed against the definition |
{{< /section >}}
{{< next "/platform/" "Explore the platform" "Meet the control plane, workers, console, task plane, forge loop, and observability surfaces around the engine." >}}