The self-hosted agent cloud

A system you can see through.

Create a Session. Run Turns in your AWS account. Retain and deliver the results.

INTERACTIVE ARCHITECTURE 01

Built from the implementationEngineering preview

ASSEMBLED VIEW

Assembling the architecture…

8 connected systems/Spatial schematic

DRAG TO ORBIT · SCROLL TO ZOOM · CLICK TO INSPECT

0%
Illustrated flow · no live execution
Ready to trace

From request to result.

REQUEST

Walk through a request and see each system take its part.

The architecture in text

8 systems, 28 components.

The same source-backed model the 3D view draws: each system, what its components do, and how a request moves through them. Read the architecture guide for the full design.

Systems

Ingress Authenticated input

The API derives resource ownership from identity. Authenticated provider events resolve an owned Session integration target.

Agents API
Authenticates callers and routes Agent, Session, Turn, Item, environment, Vault, File and Skill operations.
Authenticated webhooks
Verifies provider authentication before parsing and resolves an owned Agent/environment binding.
Identity context
Keeps attribution, resource ownership, input source, output destination and credential subject separate.

Coordination Sessions, Turns and outbox

One Session service coordinates durable input, Turns and pending operations. Private Runs identify harness launches; schedules create canonical Session input.

Private execution service
Stores immutable execution input and reserves a private Run before sending its queue hint. A harness can serve several Session Turns.
Agent schedules
Schedules reference an Agent/environment and reserve each occurrence before submitting canonical Session input.
Sessions and Turns
Snapshots Agent configuration, commits input receipts and Turn changes, and records pending operations for the outbox.
Durable outbox and queues
Session outbox operations are delivered through FIFO groups. Harness launches use a separate private execution queue.

Execution Native harness in your AWS account

The dispatcher launches an isolated EC2 or Lambda MicroVM worker in your AWS account. The Session selects Codex or Pi Durable, with tools and permissions fixed before launch.

Run dispatcher
Reads immutable input and conditionally claims a private Run before invoking the configured EC2 or MicroVM executor.
Isolated workers
Dedicated EC2 workers keep a persistent harness; Lambda MicroVM workers have a bounded lifetime. Both use stable launch identities, non-root agent processes and optional durable journal storage.
Agent runner
Loads the owned Session launch and runs Codex App Server or Pi Durable. Rat Things saves Turns, Items, and native state independently of the worker.
Environment tools
Resolved Agent configuration declares function, MCP and environment tools. Commands and files require a connected environment; browser automation requires a declared tool.
Model access
Codex uses its configured ChatGPT or Bedrock provider. Pi Durable uses approved Bedrock Converse models. Trusted code supplies model authentication. AWS role credentials stay outside the agent process by default; Codex supports explicit operator passthrough.

Delivery Saved root Turns to destinations

Provider delivery follows saved terminal root Turns through an independent outbox operation and an external outcome fence.

Terminal Turn events
Saved terminal root Turns enqueue provider delivery separately from execution. Private state streams remain operational evidence.
Result notifier
Resolves the trusted destination and delivers saved terminal Turn content using notification credentials.
Delivery fence
Conditional delivery records distinguish success, known retryable rejection and an uncertain external write.
Session artifact publication
Validates the owner, Session and complete set of saved artifact references before publishing selected relative paths.

Durable state Owned state, encrypted content

DynamoDB indexes owned resources; encrypted S3 stores complete content. Optional S3 Files preserves native journals for Session recovery.

DynamoDB records
Stores resource indexes, conditional revisions, pending operations and references to encrypted content. Private Runs retain execution fencing.
Encrypted objects
S3 stores complete definitions, Session snapshots, uploaded Files and immutable managed output Artifacts.
Session journals
Codex journals use configured S3 Files storage. Pi native commits use encrypted S3 with DynamoDB ownership checks. Workspace files follow the selected runtime's storage and checkpoint rules.

Access boundary Authority resolved before launch

Ownership, declared capabilities, IAM and network boundaries are enforced independently. Credentials remain in trusted storage.

Session capability envelope
Session launch planning validates declared tools, model configuration and environment capabilities before execution.
Runtime and IAM policy
Non-root children cannot reach the root lifecycle listener. IAM, network policy and environment boundaries enforce admitted authority.
Vault and credential storage
Owned Vault resources hold write-only credentials for declared MCP destinations. Host brokers retain provider credentials outside request payloads.

Connected services Provider installation and grants

Provider adapters, account installation, OAuth and operation grants remain useful application integrations around Sessions.

Trusted provider plugins
Reviewed provider manifests bind ingress and delivery capabilities. Provider connection lifecycle remains separate from Session execution.
Connection grants
Retained provider brokers apply connection grants, operation allowlists and resource constraints before reading credentials.
Connection lifecycle
Connection services validate installation, keep callback state single-use, and refresh expiring credentials behind host-side leases.

Recovery Durable identity and conditional repair

Queue repair retains execution identity. Worker liveness and terminal writes are fenced; uncertain effects are never blindly replayed.

Private state machine
Private execution transitions fence launch, running state, cancellation and terminal evidence. Session Turns have their own public lifecycle.
Execution reconciler
Uses supplied execution state and time to repair missing queue hints, then inspects stale attached workers without replaying their external effects.
Heartbeat and dead letters
Workers heartbeat only while execution identity matches. Exhausted event and queue delivery retains diagnostic evidence.

Request paths

API request

  1. Authenticate the request Agents API Derive the owner before accepting an SDK resource request.
  2. Accept Session input Sessions and Turns Commit the owned Session input and pending Turn operation.
  3. Dispatch the saved operation Durable outbox and queues Send the pending operation through its Session FIFO group.
  4. Reserve the harness execution Private execution service Bind the Session runtime before storing immutable private execution input.
  5. Launch the isolated harness Isolated workers Claim the private Run and launch the configured EC2 or MicroVM worker with stable execution identity.
  6. Execute the Turn Agent runner The selected Codex or Pi Durable runtime runs with the resolved Agent configuration and declared tools.
  7. Save the Turn outcome Encrypted objects Journal Session evidence and capture immutable managed output artifacts.
  8. Deliver the result Result notifier Saved terminal root Turns drive independent provider delivery; API-only Sessions retain output for the caller.

Authenticated webhook

  1. Authenticate the provider request Authenticated webhooks Authenticate before parsing, then reserve the owned provider input receipt.
  2. Accept Session input Sessions and Turns Commit the owned Session input and pending Turn operation.
  3. Dispatch the saved operation Durable outbox and queues Send the pending operation through its Session FIFO group.
  4. Reserve the harness execution Private execution service Bind the Session runtime before storing immutable private execution input.
  5. Launch the isolated harness Isolated workers Claim the private Run and launch the configured EC2 or MicroVM worker with stable execution identity.
  6. Execute the Turn Agent runner The selected Codex or Pi Durable runtime runs with the resolved Agent configuration and declared tools.
  7. Save the Turn outcome Encrypted objects Journal Session evidence and capture immutable managed output artifacts.
  8. Deliver the result Result notifier Saved terminal root Turns drive independent provider delivery; API-only Sessions retain output for the caller.

Scheduled Agent

  1. Reserve a scheduled occurrence Agent schedules Resolve the owned Agent/environment schedule and deduplicate its occurrence.
  2. Accept Session input Sessions and Turns Commit the owned Session input and pending Turn operation.
  3. Dispatch the saved operation Durable outbox and queues Send the pending operation through its Session FIFO group.
  4. Reserve the harness execution Private execution service Bind the Session runtime before storing immutable private execution input.
  5. Launch the isolated harness Isolated workers Claim the private Run and launch the configured EC2 or MicroVM worker with stable execution identity.
  6. Execute the Turn Agent runner The selected Codex or Pi Durable runtime runs with the resolved Agent configuration and declared tools.
  7. Save the Turn outcome Encrypted objects Journal Session evidence and capture immutable managed output artifacts.
  8. Deliver the result Result notifier Saved terminal root Turns drive independent provider delivery; API-only Sessions retain output for the caller.

Missed queue wake-up

  1. Persist before enqueueing Private execution service The queue send failed after immutable input and a queued private execution were stored.
  2. Find waiting execution Execution reconciler Query stale queued execution records and select recoverable work.
  3. Send another wake-up Durable outbox and queues Use the same Run ID and a trace timestamp supplied by the reconciler.
  4. Claim the saved execution Run dispatcher Duplicate hints race on the same conditional execution claim.
  5. Execute the accepted work Agent runner This is the first execution of the waiting request. Attached-worker recovery does not replay external effects.
  6. Commit the recovered outcome Encrypted objects Save evidence using the original Run identity; queue repair never created another launch identity.

Delete a Session harness

  1. Delete the owned Session Agents API Resolve ownership before accepting Session deletion.
  2. Fence future Session input Sessions and Turns Mark the Session closing, close its runtime, then delete the Session record so later input cannot resurrect it.
  3. Cancel private execution Private state machine Request cancellation under the private execution transition table.
  4. Stop the attached harness Isolated workers Stop the exact attached execution and retire its environment credentials.
  5. Inspect the exact attachment Execution reconciler Conflicting or unknown observations defer terminal cancellation and can quarantine uncertain identity.
  6. Confirm execution cancellation Private state machine Only terminal or absent execution evidence confirms a stopped attachment.

Result saved, delivery fails

  1. Keep the saved output Encrypted objects Immutable output and terminal Turn evidence survive delivery failure.
  2. Attempt provider delivery Result notifier Read the saved root Turn and resolve its trusted destination.
  3. Claim the delivery Delivery fence Record the delivery identity before sending saved Turn content.
  4. Receive an ambiguous send error Result notifier The provider outcome is uncertain; Session output remains saved.
  5. Retain the uncertain outcome Delivery fence Store outcome_unknown rather than sending another potentially duplicate reply.
  6. Retrieve the saved Turn output Encrypted objects Reading saved output does not require rerunning the Agent or repeating provider delivery.
A SHORT FIELD GUIDE

The pieces, in plain language.

This is a logical map of the code. Resource shapes help you tell roles apart. Positions and lines are illustrative; they are not a physical network diagram or live telemetry.