Skip to content
oma

How it works

How Open Managed Agents works

A meta-harness: the platform owns what an agent has; a harness owns how the model loop runs. The same business logic runs on Cloudflare and self-hosted Docker.

Request flow

One message, five hops

A user message walks the same path on Cloudflare and self-hosted Node: the platform hands the harness what it needs, the harness decides how to use it.

  1. Client Console, CLI, or API
  2. API POST /v1/sessions/:id/events
  3. SessionDO Append event, wake harness
  4. Harness Model loop, tool steps
  5. Sandbox & tools Exec, vault-proxied network
Meta-harness request flow A user message goes from the client to the HTTP API, is appended to the SessionDO event log, wakes the harness, which calls the model provider and dispatches tool calls into the sandbox. Outbound sandbox traffic passes an outbound proxy that injects vault credentials. Events stream back to the client over SSE. Client Console · CLI · API x-api-key HTTP API /v1/sessions /events SessionDO append-only SQLite event log Harness context · tool steps swappable by name POST append wake SSE · agent.* + session.* events, persisted then broadcast Model provider Anthropic · OpenAI-compat model cards Sandbox isolated exec — no credentials inside bash read write edit glob grep model call tool call Outbound proxy · vault matches the host, injects Authorization tokens never enter the sandbox Internet APIs · MCP · git egress platform owns what the agent has harness owns how the loop runs

The full path of a turn: the platform persists every event before it broadcasts it, and the sandbox never holds a credential — the outbound proxy attaches it on the way out.

How it is designed

The platform owns what an agent has; a harness owns how the model loop runs — swappable by name.

Platform owns

What the agent has

  • Session event log (append-only SQLite in SessionDO)
  • Tool construction & permission policy
  • Skill mounting & memory store mounts
  • Sandbox lifecycle & network egress policy
  • Vault proxy — credentials never in the box
  • SSE broadcast & crash recovery seams
Harness owns

How the loop runs

  • Context engineering & prompt packing
  • Model provider calls & streaming parse
  • Tool step budgeting & stop reasons
  • Custom compaction / caching strategy
  • Long-running heartbeats (optional harnesses)
  • Register by name: harness: "default"

System architecture layers

Client to isolated execution, three hard boundaries: state stays in the Durable Object, secrets stay outside the sandbox, the harness stays swappable.

01 Edge

Client & API

  • HTTP API mirrors Claude Managed Agents (/v1/agents, /v1/sessions)
  • SSE event stream for live agent.* and session.* events
  • Console, CLI, or any client that speaks the same surface
02 State

Platform · SessionDO

  • Per-session Durable Object with SQLite event log
  • Tool catalog, skills mount, sandbox binding, credential wiring
  • Crash recovery: new harness instance rebuilds context from the log
03 Policy

Harness · model loop

  • Decides how to drive the model: context, compaction, tool steps
  • Default harness ships; register custom harnesses by name
  • Prompt-cache-aware: byte-deterministic system prefix
04 Boundary

Sandbox · Vault proxy

  • Isolated exec for bash, files, packages (CF Containers, Docker, …)
  • Outbound proxy injects vault secrets — never plaintext in the box
  • MCP calls route through the platform, not the untrusted runtime

Runtime

Durable lifecycle loop

Every turn is events-first: persist, then broadcast. That ordering is why a crash loses no work and a new process resumes mid-run.

Durable session lifecycle A session sits idle until a user message moves it to running. When the harness finishes it returns to idle with a stop reason. A crash also returns it to idle after a session.error event, and the next message rebuilds context from the append-only event log. idle waiting for input running harness turn in flight idle stop_reason emitted user.message turn complete on crash — session.error, no lost events next turn replays the append-only log — persist, then broadcast DO-SQLite event log
01 Bootstrap

Session start

SessionDO restores the event log, binds the agent version, mounts skills, and registers tools for the environment.

02 Context

Compile & query

Harness builds history into a model context, applies compaction, and calls the provider (Anthropic, OpenAI-compat, or model card).

03 Execute

Sandbox run

Tool calls dispatch into the sandbox: shell, read/write/edit, glob/grep, web tools. Vault material is never exposed.

04 Proxy

Vault injection

Outbound HTTPS matches vault credentials; the proxy attaches Authorization at the network edge of the sandbox.

05 Resilience

Durable replay

On crash, a fresh harness reads SQLite, emits session.error if needed, and continues from durable events. No lost turns.