Understand AgentWorks architecture
AgentWorks separates what an agent should do from work already in progress, so you can change an agent without silently changing a run halfway through. Since 1.15.0 the split is also a split of responsibility: a runtime is a runtime. An AgentWorks runtime runs agents and lets you test them. Flightdeck, when you use it, releases, deploys and governs them. The runtime's model, tool and agent-to-agent calls can go through DVARA, the AI gateway that governs model, tool and agent-to-agent calls.
A runtime keeps no control-plane state of its own: no users, passwords, sessions, API tokens or control-plane database. It holds only its runs, and reads what to serve from one of two places.
How can a runtime run?
A runtime runs in exactly one of two modes. It refuses to start in neither, and it refuses both.
| Headless | Connected to Flightdeck | |
|---|---|---|
| Selected by | agentworks.config.file, the runtime file | agentworks.enrolment.base-url, Flightdeck's enrolment address |
| Agents and deployments come from | The runtime file, agentworks.yaml | Flightdeck's signed bundle |
| Callers | Caller keys and identity providers the file names | Flightdeck's tokens, with permissions from the user's role in each environment |
| Runs are kept in | The runtime's own SQLite file | The runtime's own SQLite file; accepted records are shipped to Flightdeck |
| Pages | None | AgentWorks pages hosted inside Flightdeck |
| A change is made by | Editing the file; the runtime reloads it without a restart | Publishing, releasing and promoting in Flightdeck |
Choose headless for one team's agents operated from Git and CI, or to test agents. Choose connected for centralized workspaces, identity, release evidence, approvals and fleet operations across many runtimes.
What does a headless runtime look like?
CLI / SDK / automation (caller key or identity-provider token)
|
v
AgentWorks runtime <---- agentworks.yaml (agents, deployments, tools, callers)
REST API + worker
| \
| local SQLite file (runs, events, checkpoints, revisions)
v
DVARA gateway, when configured ---- models, MCP servers, A2A agents
The runtime builds a release for each deployment from the agent's AgentSpec, with the same code that builds every release: the models are resolved through the configured gateways and capability-pack tools are pinned with their schemas and effects. Each id is derived from what it names, so the same file gives the same deployments and releases after a restart. See Run AgentWorks headless from a runtime file.
What does a connected runtime look like?
Users / automation
|
v
Flightdeck (AgentWorks control plane and pages) ---- Flightdeck's PostgreSQL
|
| signed bundle: deployments, environments, gateway keys, token issuer, drain switch
| control queue: runs started on Flightdeck's pages
v
AgentWorks runtime ---- local SQLite file
|
v
DVARA gateway ---- models, MCP servers, A2A agents
The runtime enrols with Flightdeck the way a DVARA gateway does, and polls it for a signed bundle; Flightdeck makes no connection to the runtime and holds no runtime address. A run started on Flightdeck's pages reaches the runtime through its control queue. The runtime has no Flightdeck database credential: any database setting stops its startup.
What does the runtime keep, and what does Flightdeck own?
| Concern | Owner |
|---|---|
| Runs, events, checkpoints, leases, deadlines, interactions, sessions and recorded effects | The runtime, in its own SQLite file |
| Deployment revisions a headless runtime builds from its file | The runtime, in its own SQLite file |
| Agents, published versions, releases, environments, promotion, approvals and release evidence | Flightdeck, in its PostgreSQL. A headless runtime instead builds one release per deployment from its file, with no publish, environment or promotion step |
| Users, sign-in, roles and workspaces | Flightdeck, or for a headless runtime the caller keys and identity providers in its file |
| Fleet view, drain and revoke | Flightdeck |
| Audit | A headless runtime records each pause request, its withdrawal and each cancel in its own store, readable at /api/v1/administrative-audit; a connected runtime's audit events go into Flightdeck's signed audit chain |
The SQLite file uses a write-ahead log, so a committed step survives a crash. Run one runtime per volume: a run belongs to the volume it started on, and reading a run must reach the runtime that owns it.
What does Flightdeck send a connected runtime?
- the deployments it serves, and the environments they are in, in a signed bundle;
- the gateway key for each workspace it serves, as
flightdeck://dvara-gatewaycredential references; - the gateway's MCP and A2A addresses, and per environment its own gateway and keys;
- Flightdeck's token issuer and keys, so the runtime can check Flightdeck users' tokens;
- the drain switch.
A runtime serves environments of one kind, so a production environment never shares a runtime with a development
one. A run's model, MCP and call_agent calls use its own environment's gateway key. See
Connect AgentWorks to Flightdeck for enrolment and the bundle.
Do headless and connected runtimes run an agent the same way?
Yes. Both modes compile to the same deployment records and pass the same release and install check; Flightdeck does not send the runtime file's YAML. One AgentSpec served either way gives the same release pins and the same run result, so an agent tested headless behaves the same way when Flightdeck deploys it.
Which API does a runtime serve?
The runtime's versioned REST API is under /api/v1, and the running runtime publishes its OpenAPI document at
/api/v1/openapi.yaml. It covers what a runtime does:
| Area | Paths |
|---|---|
| Deployments (read-only) | GET /api/v1/deployments |
| Runs | /api/v1/deployments/{deploymentId}/runs, /api/v1/runs, and each run's events, stream, steps, cancel, pause and resume |
| Human input and long work | /api/v1/interactions, /api/v1/sessions, /api/v1/operations |
| Audit and connections | /api/v1/administrative-audit, /api/v1/mcp-connections |
There is no operation on a runtime to create agents, publish versions, build releases, create environments or
promote: deployments change only in the runtime file or in Flightdeck. Errors use the RFC 9457 problem format with a
stable code. The CLI and SDK are clients of this API; see
Use the API, CLI and configuration reference.
What stays fixed while a run is in progress?
A run is pinned to the release, deployment revision and runtime cohort that admitted it. A new revision or a newer release changes new work only; it never swaps new instructions or dependencies into a run already in progress. A continuation, such as a human response, callback, child result or scheduled wake-up, keeps the run's release and security context. A restarted runtime on the same SQLite file resumes each run from its last checkpoint and never repeats an effect it recorded. See Operate durable runs and interactions.