Docs Contracts
Agent contract design
Why /agent is shaped as it is, how to build a harness, and what's proposed for it.
Why /agent is shaped the way it is, how a harness is built, and what's proposed for it. README.md is the contract as enforced, and ARCHITECTURE.md, "Agent plane", is the summary.
Status: version 0, passed by agent-pi. agent-sales was removed on 2026-11-17, so sales below is an example agent. No second harness exists. Handoff, session_moved, an idempotent session.create and run origins are proposed, and nothing in them is built.
Decisions#
/agentis a platform contract, owned by the workspace. A harness is anything that passes the conformance suite. It stays at version 0 until a second harness passes, so it doesn't freezeagent-pi's quirks.- An agent is not a harness.
salesis a product, Codex is an engine, and a pool is one deployed pairing of the two. Clients name agents, and session IDs name pools. - The contract is the seam, not a code interface inside
agent-pi.agent-pikeeps its structure, and gains only what the contract needs. A new harness is a new repo, and usually only an engine behind a shared host. - The session ID stays the route. Harness choice happens once, at placement, and is written into the ID.
- Conversations stay inside their harness until they're handed off. A handoff carries a lossy copy forward to a new session. It isn't a live migration, and t10 doesn't build a central transcript store for it.
- A harness knows nothing about governance. Policy is enforced by
ai-gateway-tools,ai-gateway-llmand placement, so a harness needs only to send its tool and model calls where it's configured to. Seet10-agent-control/docs/governance.md. - A run may start with nobody typing. A timer, an event or a webhook starts it through the same methods, from
t10-automations. See "Runs nobody typed".
Terms#
| Term | Meaning | Example | Changes how often |
|---|---|---|---|
| Agent | The product a person talks to. A stable name, and what clients and grants mean by "who" | assistant, sales |
Rarely |
| Harness | The engine that runs a loop of model and tool calls | pi, codex |
Rarely |
| Bundle | An agent's content: prompts, skills, tool policy, model aliases. Versioned, and rolls out in place | sales@2026-11-02 |
Often |
| Pool | One deployment of an agent on a harness, with its replicas and volumes | sales (pi), sales-codex |
Only when an agent moves to another harness |
| Route | The rule that sends new conversations of an agent to pools | sales, tenant acme, 10% to sales-codex |
At runtime |
| Session | A conversation inside one pool, for life | sales-codex.agent-codex-0.17 |
Never moves |
Existing pools keep their names, so assistant and sales are both an agent and a pool. Every current session ID stays valid.
A new bundle or harness version is an ordinary rolling update of the pool's StatefulSet, as it is today. It must not create a pool, because a pool's replicas can't be removed, and each prompt change would leave a StatefulSet behind for good.
The harness contract#
This follows the module contract. Its home is this folder, a written spec and a black-box test suite. The table below is the design, and that folder is what's enforced. The workspace already holds the contract checks and no sub project depends on it.
| Part | Every harness provides | agent-pi today |
|---|---|---|
| Identity | Its own auth-server account and audience. Verifies tokens offline, and takes the tenant only from the token |
Meets it |
| Manifest | GET /v1/runtime, described below |
Meets it |
| Ownership | A session belongs to (tenant, user). Anyone else gets 404 |
Meets it |
| Session methods | session.create, list, get, messages, update, close |
Meets it |
| Input methods | session.prompt, session.cancel, and requestId dedup |
Meets it |
| Session capabilities | session.create, session.get and session.list return capabilities, so a client knows what this session supports |
Meets it |
| Events | GET /agent, resumable with Last-Event-ID, and snapshot after a gap. Core events below. A client ignores events it doesn't know |
Meets it |
| Session IDs | <pool>.<replica>.<n>, and a wrong replica answers 421 |
Meets it. The first part is the configured agent |
| Tracing | turnId on events, traceparent continued, one trace per turn |
Meets it |
| Model calls | Only to one configured endpoint. On ai-gateway-llm, every call carries X-Session-ID, X-Turn-ID, X-User-Id, X-Tenant-ID. On a provider directly, it carries none of them |
Meets it, with LLM_IDENTITY_HEADERS=none |
| Agent list | agents.list, answering with its own agent. An Agent-Name naming another agent answers 400, and Agent-Method is ignored |
Meets it |
| Tool calls | Only with tokens minted from the conversation's grant. Tool policy holds on every call | Meets it |
| Built-in tools | Shell, file and network tools are off unless a pool declares them, with a sandbox per tenant. See "Security" | Not applicable |
| Health | /healthz, /readyz |
Meets it |
Proposed: pool identity and placement. Two additions, both optional for a harness until conformance tests them, and both inert in Light:
- Pool and agent are separate settings. Today one setting,
agent, is both the first part of session IDs and the agent name the harness answers to, so a second pool of an agent can't answer to its name. A harness takespoolandagent, withpooldefaulting toagent, and the manifest reports both. Each pool also has its own runtime inauth-server, becauset10-agent-controlmaps a token'sact.subto exactly one pool and agent. See "Runtime directory" int10-agent-control/docs/design.md. - Placement is recorded on the session. On
session.create, a router sendsAgent-Placement: revision=41; rule=3. The harness stores it, unread, and returns it asplacementfromsession.get, so "why is this conversation on this pool?" can be answered from route history long after the trace is gone. A harness reached directly gets no header and stores nothing.
Core events are snapshot, run.started, run.finished, text.delta, message.end, tool.started, tool.finished, submission and error. Everything else in ClientEventBody is optional, and new harness-specific events start with x..
Capabilities are optional parts. A harness declares them, and callers and routes depend on the declaration:
| Capability | Adds | Needed by |
|---|---|---|
steer |
session.steer, whenBusy |
Typing while a reply runs. Without it, a client disables sending until the run ends |
interrupt |
session.interrupt, Agent-Submission-Id and streamed POST answers |
Any voice route |
voice |
duringTools: "steer", note, speech events |
Live calls. Without it, a client hides the Call button for that session |
retry |
session.retry |
The retry button |
background_tasks |
task.updated, snapshot.tasks |
Task lists |
handoff |
session.export, and continuesFrom on session.create |
Moving conversations |
durable_runs |
An unfinished run continues after a restart | Long background work. Without it, the run fails and can be retried |
plugin_methods |
Extra JSON-RPC methods, listed by name | Features of one agent only |
run_view, proposed |
session.run, a turn's steps with tool calls and arguments |
Seeing what an agent did. See "Viewing a run" |
There's no governed or approvals capability. Whether a tenant's policy can apply to a pool is the pool field tools_via_gateway, a fact about deployment, and approvals reach a harness only as a tool error and a later input.
The manifest is unauthenticated, like /readyz, and holds no tenant data. ai-gateway-agent doesn't forward it. A Light deployment that exposes a harness directly should keep /v1/runtime off its ingress.
{
"contract": 1,
"harness": "codex",
"harness_version": "0.x",
"pool": "sales-codex",
"agent": "sales",
"bundle": "sales@2026-11-02",
"profiles": ["chat", "voice"],
"capabilities": ["steer", "interrupt", "voice"],
"builtin_tools": []
}contract follows the same rule as a module's api_version: it's a major version, and within it things can only be added. It's 0 until a second harness passes the suite, and may change until then. Anything that exists only to work around durable, such as voice's retry of an input stuck in the inbox, stays out of the contract.
Conformance is the definition of a harness. The suite runs against any URL, with a scripted fake model standing in for ai-gateway-llm (agent-pi/docs/guides/mock-model.md shows the approach) and a fake MCP server. It covers ownership, resume after a gap, requestId dedup, trace and identity headers on model calls, tool calls, and each declared capability. make check runs it on each harness, beside the event-type grep in scripts/check-contracts.sh, which proves only that workbench lists the same names. Grant tokens on tool calls aren't tested yet, because the suite has no fake auth-server.
ai-gateway-agent changes little. inputMethods stays as the list of quota-spending methods, now defined by the contract. Unknown methods still pass through, so plugin methods keep working.
Building a harness#
An in-process driver interface inside agent-pi looks like the obvious design, and it's the wrong first step. Measured over the source without tests or the plugin library, 84% of lines are in files that import a pi package. Some of those are only type imports, such as ConversationId in auth/grants.ts, but service.ts, sessions.ts, events/mapper.ts and the plugin runner are built around durable's model. Cutting there means rewriting a working system to predict a shape nobody has tested.
So agent-pi keeps its structure. It gains the manifest, agents.list, capabilities, and a "none" identity header setting. A new harness is a new repo. The first is agent-codex, because sales began on Codex in Kaidan (agent-sales/apps/sales/PLAN.md), which makes it a real comparison.
Start agent-kit with agent-codex, as t10-modkit starts with the second module. It takes what both need: auth/jwt.ts, transport/sse.ts, events/speech.ts, tools/catalog.ts, skills/skills.ts, the grant broker and the MCP manager. agent-pi can adopt it file by file later, or never. It's a convenience, and the contract remains the requirement.
What a harness host does#
Durable gives agent-pi many things free that a host has to add around an engine like Codex:
/agent contract
│
┌─────────────▼──────────────────────────────┐
│ Host │
│ Token check, ownership, limits │
│ Session store, grant per conversation │
│ Submission inbox and requestId dedup │
│ Event mapping, ring buffer, speech │
│ │
│ ┌────────────────┐ │
│ │ Engine │─ tools ─► Tool broker ─── grant token ─► MCP servers
│ │ one process │ │
│ │ per active │─ model ─► Model proxy ─── identity ───► ai-gateway-llm or provider
│ │ conversation │ │
│ └────────────────┘ │
└────────────────────────────────────────────┘Tool broker. A loopback MCP server for the engine. It holds no MCP config of the engine's own, applies the bundle's allowlist, forces fields such as sales's workspace from session metadata, mints a short token from the conversation's grant, and forwards the call to ai-gateway-tools, which applies tenant policy and records it. Business rules that sales keeps in pi hooks today move below the engine this way, so a model can't talk its way past them on any harness.
Model proxy. A loopback endpoint that adds identity headers and traceparent, then forwards to the configured model endpoint with the host's credential. That's ai-gateway-llm, or a provider in a lightweight deployment, where it sends no identity headers. Either way the engine holds no real key.
One engine process per active conversation. This is the key decision for Codex, and it comes from its protocol. MCP servers are configured per process, the documented per-thread fields don't include a model provider or base URL, and token auth is per process. With one conversation in each process, the proxy and broker always know whose call they're serving. It also gives each conversation its own CODEX_HOME and working directory, which separates memory but not files: processes under one user can read each other's. See "Security". Idle processes exit, and thread/resume brings a conversation back from its pod's volume. The price is memory per active conversation, which a load test has to measure.
No use of experimental surfaces. dynamicTools would avoid the broker, but it's marked experimental. Loopback MCP uses only stable behaviour, and works the same for the next engine.
Adding your own harness#
A custom harness joins the same way as Codex, with one advantage: you control both sides, so it needs no translation. It has two ways in.
| Hosted (the default) | Native | |
|---|---|---|
| What you write | The engine only: the loop of model and tool calls | The engine, plus the whole contract |
| Language | Any. It speaks the engine protocol below over stdio, or runs in-process if it's TypeScript | Any |
| Comes free | Tokens, ownership, limits, grants, inbox and dedup, event buffer and resume, speech, tool broker, model proxy | Nothing, beyond shared test tools |
| Use it when | Almost always | The harness is already a multi-tenant server with its own durability, as agent-pi is |
Hosted is the default because the host's parts are security-critical and easy to get subtly wrong. They should exist once, and a harness author shouldn't need to know how grants work. This also gives agent-kit a second real user alongside agent-codex, which is what the t10-modkit rule asks for before a shared interface is fixed.
The engine protocol is what the host asks of an engine. It's JSON lines over stdio, and in-process engines implement the same methods as an interface. agent-codex implements it too, by translating to codex app-server, so the protocol is tested by two different engines before it's fixed.
| Direction | Message | Meaning |
|---|---|---|
| Host to engine | start |
New conversation: instructions, active tools, model alias, model_url, tools_url, optional seed history |
| Host to engine | resume |
Reopen a conversation from the engine's own storage |
| Host to engine | input |
One input, with turn_id and mode: start, steer or interrupt |
| Host to engine | cancel |
Stop the current run |
| Host to engine | history |
One page of the neutral transcript |
| Host to engine | stop |
Release the conversation. The engine may exit |
| Engine to host | hello |
Protocol version, the capabilities it supports, and sessions: one or many per process |
| Engine to host | text, thinking |
Output deltas |
| Engine to host | tool_start, tool_end |
Tool calls, for events and for duringTools |
| Engine to host | run_end |
Finished, with a status of done, aborted or failed |
| Engine to host | error |
What went wrong, and whether it will retry |
A sketch rather than a final schema: step 3 settles the details. Everything in it is deliberately what the engine alone can know. The host derives offset, messageId, speech and snapshot itself.
model_url and tools_url are per session. Each is a loopback URL with the session in its path, so the proxy and broker know whose call it is, whatever the engine sends. An engine that declares sessions: many can then serve many conversations from one process, which Codex can't. That makes a custom harness cheaper to run than Codex: one process per conversation is a Codex constraint, not a platform rule. The price is isolation, because a bug in a shared engine could use another session's URLs, and so reach that tenant's tools. So sessions: many is allowed only for a reviewed first-party engine with no built-in tools.
What the harness must do, in either path:
- Make every model call to
model_urland every tool call totools_url. A direct call would skip audit, quota and grants. An egress policy helps only partly: NetworkPolicy works per pod, so it can't separate an engine from a host in the same pod. See "Security". - Hold no user token, and no tenant data outside its session storage. A hosted engine also holds no provider key. A native harness holds one only in a lightweight deployment.
- Treat any built-in shell, file or network tool as off unless the pool declares it. See "Security".
- Stop promptly on
cancel. Voice depends on this. - Stream text as it arrives. A harness that only returns whole answers passes core conformance, but is unusable on a call.
What it can leave out at first. steer, interrupt, voice and handoff are capabilities, so a first version can support only start and cancel. Clients hide what a session doesn't support, so it can take text before it can take calls. Crash recovery is optional in the same way: an engine that can't resume declares no durable_runs, the host marks an unfinished run as failed after a restart, and the person can retry. The transcript is safe as long as the engine or host stored it.
To add it:
- Implement the engine, and run conformance against it locally with the fake model and MCP server.
- Package it with
agent-kit's host as one image, with a bundle. - Add a runtime to
auth-server/clients.yaml, one for each pool, and add its audience to the voice runtime if it will take calls. - Deploy a StatefulSet with a volume per replica, named as its pool.
- Add the pool to the routes file or
t10-agent-control, with a low-weight route on a test tenant.
No client, ai-gateway-agent or t10-livekit-agent code changes, once clients read capabilities. The agent's name stays the same to users, so they never see which harness runs it. The clients.yaml entry above means a deploy of auth-server, so routes are dynamic only among pools already registered.
How the contract maps to engines#
Codex entries come from its app-server documentation and need a spike to confirm. Claude entries are deliberately brief: they're a second check on the abstraction, not a commitment.
| Contract | agent-pi |
codex app-server |
Claude Agent SDK |
|---|---|---|---|
| Session | Durable conversation | Thread, with the mapping kept in the host | Session ID kept by the host |
| Restart | harness.resume() |
thread/resume, from local storage |
Resume by ID. Session file must be on the same path, so same pinned-volume model |
session.prompt |
Submission | turn/start |
New query on the session |
session.steer |
Built in | turn/steer with expectedTurnId |
To verify |
session.interrupt |
Built in | turn/interrupt, then turn/start |
To verify |
duringTools: "steer" |
Built in | Host tracks open items, and steers if one is a tool call | To verify |
text.delta |
Mapped from durable | item/agentMessage/delta |
To verify |
| Tools | MCP with grant | mcpToolCall through the broker |
MCP through the broker |
| Approvals | Not applicable | Host declines any approval request. Policy is enforced by the broker | To verify |
| History | session.messages |
thread/turns/list, thread/items/list |
To verify |
| Seeding a handoff | app.message entries |
thread/inject_items |
To verify |
| Model API | Chat or Responses | Responses, which the gateway has | Needs /v1/messages at the gateway |
Delegation: a task for another agent#
The conversation stays where it is. A calling agent uses another agent as a tool, over the /mcp endpoint agent-pi/docs/delegation.md describes, with the user's grant narrowed and the hop count carried in _meta.
Add a contract capability, agent_tool, and let MCP entries name an agent rather than a URL. A triage agent can then send work to sales without knowing which harness runs it. This makes harnesses a third reader of routes, and how they place a call isn't designed yet, so step 8 starts there. Grants intersect along the way (#narrowed in GrantBroker), so a caller's grant must already hold the audience of every pool an agent's routes can reach, plus everything those agents' tools need. Publishing has to check this. This is the right form for most "dynamic routing" needs, and it needs no handoff at all.
Handoff: the conversation changes owner#
Use this when a person should go on talking to a different agent, or a conversation must move to another harness. It costs more than placement, and it's the only way a harness is ever really left behind.
A handoff is a new session that continues an old one. Sessions don't move. The new session gets a full copy of the history, and the old one is sealed with a pointer to it.
- Trigger. A user action, or an agent tool,
handoff_to(agent, reason), which ends the run with asession.handoffevent naming the target agent. - Create. The client calls
session.createwithAgent-NameandcontinuesFrom: <old ID>, using the user's token. - Copy. The new pool calls
session.exporton the old session through the gateway, with that same token. The old harness's ownership check applies, so this adds no privileged path. The result is a neutral transcript: user and assistant text, plus tool names with short results. - Seal. The old session is marked
movedTo: <new ID>, refuses new input with that pointer, and appears as archived. - Follow. Other devices learn from the
session.movedevent, or the refusal, and reopen on the new ID.
The new session serves the whole history itself from session.messages, so nothing reads through old pools, and an old pool can go away. The pointer replaces a conversation directory, which keeps "the session ID is the route" true.
Limits, stated plainly:
- Copying loses things. Reasoning, exact tool arguments, provider caches and tool-activation state don't cross harnesses. A handed-off agent knows what was said, and doesn't remember how it worked.
- Idle only. Handoff refuses while a run or background task is active, and refuses during a call in v1.
- Grants start fresh. The new session opens its own grant from the user's token, so no authority passes between agents.
Retiring a pool#
This is how a harness is switched off, and it uses the same steps as a handoff, so it needs no privileged path.
- Move the agent's routes to the new pool, and set the old pool to
retiring. - When someone next opens an old session, the pool refuses it with
session_moved, naming the agent. The client callssession.createwithcontinuesFrom, using the user's token, and the new route places it. The person sees the same conversation, with its history. - Sessions nobody opens stay behind. After a set period, an operator runs an export of what's left to an archive, then retires the pool. That export has no user token, so it needs a designed service path. It's the one piece still open, and the same work covers volume backups.
A session_moved refusal needs a client that follows it, so workbench and the mobile app must ship that before the first pool retires.
Runs nobody typed#
A run can start from a timer, a module event or a webhook. t10-automations starts it, as a client, with a token minted from a person's or a tenant agent account's standing grant. t10-automations/docs/design.md is that service's design, and auth-server/docs/agent-identity.md explains the grants. The contract needs four additions. Idempotent create and origin are built and in the conformance suite, as step R2. app.trigger waits for module events, in R8, because a schedule's firing carries no event: its instruction is an ordinary session.prompt. app.approval waits for approvals, in R7:
| Addition | What it is | Why |
|---|---|---|
| Idempotent create | session.create with Agent-Request-Id answers the session it already created for that key |
A timer that fires twice after a restart must not create two conversations. Delegation needs the same |
origin on sessions |
{ "trigger": "schedule", "automation": "au_1" }, from the token's trg claim, returned by session.get and list |
Clients mark conversations an automation started, and filter them |
app.trigger entry |
An event's IDs and module reference, delivered as data, like task_report |
A crafted event can't carry instructions. The agent reads details through its tools |
app.approval entry |
"Approval ap_7 was granted" or "refused", as data |
Wakes a run after an approval, so the agent repeats its call. See "Approvals" in the governance design |
Every addition works on a bare harness, so Light keeps passing conformance: create is idempotent in the harness, not the router, a token without trg means user, and a harness in Light sends no t10 token to its model provider.
Runs nobody watches go only to pools with durable_runs, which ai-gateway-agent adds to requires when the verified token's trg is schedule, event or webhook, and answers 503 if no such pool is usable. A harness needs no other change: the principal and trigger come in the token, ownership stays (tenant, principal), and an approval is just a tool error followed by an input.
Viewing a run#
Proposed. A person must be able to see what an agent did in a turn: what went in, what each model round returned, which tools it called with what arguments, what came back, and what it cost. The content is in the harness's transcript and nowhere else, so the harness answers for it. The facts around it, such as model, tokens, latency and policy decisions, come from the gateways' audit, joined by turnId. No new store holds a copy.
session.run, behind a new capability, run_view. It takes sessionId and turnId, and answers the turn's steps in order:
| Step | Holds |
|---|---|
input |
The person's message, or for an unattended run the trigger's data entry |
model |
One model round: the model alias, its text, reasoning if the harness keeps it, the tool calls it asked for, requestId for the gateway's record, and timing |
tool |
Server, tool, arguments, status and timing. The result only if the bundle marks that server results_visible, otherwise its size and status |
child |
A sub-agent or consult_expert run, with its own steps, nested |
task |
A background task's report |
reply |
The reply the person saw |
Tool results stay hidden unless marked. session.messages already leaves out tool results, because a tool can return what the person may not read, as agent-sales' shared CRM identity does. session.run keeps that rule. A bundle marks a server results_visible only when it acts strictly with the run's principal's own rights, as a t10 module does. Arguments are always shown, because the model wrote them from what it had already been given.
Who may call it.
| Viewer | How |
|---|---|
| The session's owner | Their own token, as for session.messages |
| A tenant admin, for any session in their tenant, including an agent account's | A read token from auth-server, below. Each opening is an audit record the owner can see |
| A platform admin | Never. They see the run's trace and the gateways' records, which carry no content, and the debug capture in ai-gateway when it's on for that tenant |
| An agent | Never. A delegated token is refused |
Read tokens. A tenant admin asks auth-server with POST /v1/session-reads, naming the session, its owner and a reason. auth-server checks the admin role live, with a fresh second factor, records it in its audit log, and mints a 15-minute token with aud=t10, the admin as sub, scope session:read, and a read claim naming the owner and the session. The harness checks it offline, as any token: it allows only session.get, session.messages and session.run, for that one session, owned by that owner in that tenant. Nothing else in the contract changes, and the harness holds no roles. See auth-server/docs/agent-identity.md.
Joined facts. A client asks ai-gateway-llm for the turn's model calls and ai-gateway-tools for its tool decisions, with the same token, and matches them to steps by requestId and call ID. Both return metadata only, for the token's tenant. See ai-gateway/docs/design.md. In Light there's no gateway, so the view shows the harness's steps alone.
A harness without run_view passes conformance, and clients show only the transcript and the joined facts.
Security#
agent-pi has no shell. Coding harnesses are built around one. This is the largest new risk, because a prompt injection in a CRM note could become a command on a shared pod.
- No built-ins, and this gates Codex. A pool runs with the engine's shell, file and network tools off, and only broker tools available.
builtin_tools: []in the manifest declares this, and conformance tests it. A read-only sandbox doesn't count: it can still read other tenants' files on the same volume. Whether Codex's shell can be fully turned off throughapp-serverisn't verified. Step 3 must answer this first. If it can't, the only safe form is a pod per tenant, which changes the cost of Codex. - Decline every approval. The host never asks a person and never auto-accepts. There's no user at the keyboard, and "approve for session" has no meaning here.
- Separate tenants if built-ins are ever on. That pool needs a sandbox per tenant, such as a pod or gVisor, not a directory. It's a separate design.
- Separate the engine from the host. The engine gets no service secret, no grant and no real model key, only loopback addresses that die with it. That isn't enough on its own: a process under the host's user can read the host's memory and database, and NetworkPolicy can't tell the two apart in one pod. Run each engine under its own Unix user, with no access to the host's files, and block its outbound traffic by user with in-pod firewall rules.
- Check each harness's terms for hosted use. The Codex documentation appears to restrict app-server authentication in commercial or hosted services. I saw this only in an extracted summary, so its exact wording and whether it covers an API key through a private gateway are unconfirmed. Settle this before any Codex pool serves customers.
Agent bundles#
Pools today bake content into the image, and that stays. An image is one reviewable, rollback-able unit, and a sales image on two harnesses just means two images. A new bundle version is a new image, rolled out to the same pool.
A bundle is a folder with one layout: agent.json, prompts/, skills/<name>/SKILL.md, and tools.json for the allowlist, moved from sales's policy.ts. SKILL.md already crosses harnesses: sales ported Codex skills into it.
What won't port is code in pi plugins. For sales:
| Today | On another harness |
|---|---|
data-api.ts, workspace binding |
Tool broker field rule |
src/mcp/policy.ts |
tools.json, enforced by the broker |
context.ts, date and time per turn |
Host adds it to turn instructions |
reports.ts, report cards |
Needs a port, or an MCP tool |
guardrails, audit |
Host or broker equivalents. Compare behaviour in conformance |
Which tool results a run view shows. Proposed, with run_view. A bundle marks an MCP server results_visible in tools.json, and marking one is a review decision, made per server, not per tool. The rule: mark a server only if every call acts with the run's principal's own rights, so its results are what that person could already read.
| Server | Agent | Results visible | Why |
|---|---|---|---|
t10-collab, and later t10 modules |
assistant, and any agent that uses them |
Yes | A module applies the principal's own permissions to each call, from the delegated token |
Kaidan's data-api, the CRM tools |
sales |
No | One shared bearer token per tenant, so a result can hold records the person can't read. Revisit once each person has their own CRM credential |
| A server outside t10 with its own credential | Any | No, by default | t10 can't see what that credential may read |
Unmarked is the default, so a new server starts hidden. A tenant admin's read token doesn't change this: an admin sees the same steps the owner sees.
agent-sales can stop being a fork once agent-pi ships as a package, because apps/sales would then only depend on it. That's a good cleanup, but nothing here needs it.
Adding things#
A new agent on an existing harness: build a bundle and image, add its runtime to clients.yaml, deploy a pool, add it to the snapshot. No code changes in any shared component.
A new harness: write an engine for agent-kit's host, or a full native server, then add it as a pool. See "Adding your own harness". No code changes in any client, the gateway or t10-livekit-agent. If a client needs a code change, the contract has a gap, and the contract gets fixed.
Moving an agent to another harness: add a new pool, route a tenant's 10% to it, compare, raise the weight, then set the old pool to retiring. Conversations move as people reopen them. See "Retiring a pool".
Updating an agent's prompts or skills: roll a new image to its pool. No new pool, and no route change.
Build order#
Each step is useful alone, and steps 1 and 2 are worth doing even if no second harness ever ships. Steps 0, 1 and 2 are done, and verified on the local cluster and in a browser. Steps 6a and 6b were built next, ahead of steps 3 to 5, because routes needed to change with no deploy before a second harness needed them. They're verified on the local cluster, and the local routers follow t10-agent-control. Step 6c followed, together with one admin address per role: see "Admin console and access" in t10-agent-control/docs/design.md. On the phone, step 2 added agents.list and a voice check, with no picker, so the phone follows the tenant default.
| Step | Repo | Change | Done when |
|---|---|---|---|
| 0 | ai-gateway |
Stop logging request and reply bodies | Tests prove no body reaches the log |
| 1 | Workspace, agent-pi, agent-sales |
Write contracts/agent/, the conformance suite, GET /v1/runtime, agents.list, capabilities, and "none" for identity headers. Add a lightweight Compose profile with its smoke test, since folded into t10-quickstart |
Both agents pass in make check, and one turn runs with no gateway |
| 2 | ai-gateway, t10-livekit-agent, workbench, flutter/, deployment |
Routers read a routes file or AGENT_URLS, one source at a time. Agent-Name from both clients, with an agent picker fed by agents.list. list_pools fan-out. Clients read capabilities |
sales reachable from workbench on the local cluster |
| 3 | agent-codex (new), agent-kit (new) |
First answer the gate: can Codex's shell be fully turned off? Then a walking skeleton: core contract, one engine process per conversation under its own user, no voice. Confirms or kills the Codex column above | Gate passed, core conformance passed, and contract moves to version 1 |
| 4 | agent-codex |
Tool broker, model proxy, grants. sales bundle with tools.json |
Trace and audit match a pi turn, with no secret in the engine |
| 5 | Deployment | sales-codex pool at low weight on a test tenant |
Comparison of cost, latency and quality on one person's real work |
| 5a | Harnesses, clients | Handoff from a user action, session_moved, and the retiring state |
A test tenant's conversation moves back to pi with its history. Do this before a second harness takes real traffic, or that traffic can't be moved off it |
| 6a | auth-server |
GET /v1/me/access, GET /v1/tenants, the console's client and a link from /admin. The client is now t10-console's |
Tests cover the dev-mode waiver and the 15-minute window |
| 6b | t10-agent-control (new) |
Serve the same snapshot, plus catalog, history, the platform console with step-up, and agentctl. The console's pages later moved to t10-console |
A route change with no deploy, by a platform admin only |
| 6c | t10-agent-control, workbench |
Tenant settings, and web/src/modules/agents/. Built, with the admin unification below |
A tenant admin turns an agent off, and it leaves agents.list for that tenant only |
| 7 | auth-server, agent-codex, t10-livekit-agent |
Narrow voice tokens to one audience per exchange, as agent-identity.md asks before a third audience. Then interrupt and voice capabilities |
Barge-in behaves as in AGENT-PI-PROVIDER.md's table, on a real call |
| 8 | Harnesses | agent_tool delegation through the snapshot |
A triage agent delegates across harnesses |
| 9 | Harnesses | Agent-started handoff with handoff_to |
Only if step 8 doesn't cover the real need |
A custom harness enters at step 3. If it's ready before Codex work starts, build the host around it first and make it the walking skeleton: it needs no translation, so it tests the host and engine protocol on their own. Codex then becomes the check that the protocol isn't shaped around one engine, and it can wait if the custom harness is the one that matters. Steps 3 to 5 apply to either.
Stop after any step if the reason to go further disappears. Step 5 is the main check: if Codex shows no gain on real work, steps 1 and 2 have still paid for themselves, and the rest needn't be built.
Steps R1 to R8, for runs nobody typed and governance, are in t10-automations/docs/design.md and t10-agent-control/docs/governance.md. R4 doesn't wait for a second harness, and a hosted harness's broker becomes a forwarder to ai-gateway-tools, which makes step 4 smaller.
Alternatives considered#
| Option | Why not |
|---|---|
Driver interface inside agent-pi |
84% of its lines are in files tied to pi packages. It would risk a working system on a guess, and it can't host engines outside Node without the same subprocess work anyway |
| Central transcript store, with harnesses as stateless workers | It's the only way to make harnesses truly interchangeable mid-conversation, but two writers would own one conversation, and it gives up durable's crash recovery. Engines also keep private state that a neutral log can't hold. It would be the largest rewrite in t10 for a rare need |
| Live migration of a running session | Engine state isn't portable. Handoff is honest about what's lost |
| Conversation directory for every session | Adds a lookup to every request, or a critical dependency, and breaks "no routing table". A pointer in sealed sessions covers the need |
| A new pool per bundle version | Pool replicas can't be removed, so each prompt change would leave a StatefulSet behind |
| ACP as the platform contract | Built for an editor talking to one local agent over a local process. It has no tenant ownership, resumable streams or voice semantics. It's a good engine side option: an ACP engine host could cover many harnesses, and hermes-agent has an adapter to try |
| A2A as the platform contract | Fits delegation between agents, and could be a later option there. It doesn't describe a person's conversation, with steering and barge-in |
Risks and open questions#
- Is a host per engine too much work? Durable provides inbox, dedup and crash recovery, and
agent-codexmust rebuild these. Step 3 measures this before more is spent. - Conformance can't prove quality. Two harnesses passing the same suite can still behave differently, on tool choice for example. Comparing them needs evals, and t10 has none on real work. Step 5 needs at least a small one.
- Plain text mapping hides engine strengths. Codex's plans and diffs have no contract event. They travel as
x.events, and a client that shows them has to know about them. - What happens to sessions nobody reopens? Handoff moves the rest. These need a service-side export with no user token, which breaks the "same token" rule and needs careful design. It's the same work as volume backups, so it's best solved once. Until then, a
retiringpool stays up. - Does a process per conversation fit? Memory per engine isn't measured, and a burst of resumes after a restart could be slow.
- Codex's model provider. Whether its Responses traffic works through
ai-gateway-llm's model aliases and non-OpenAI providers isn't known until step 3. - Does the engine protocol stay small? It's easy to add a message for each engine's special feature. New ones must be things only an engine can know, and anything else belongs in the host or in
x.events.
Sources for harness behaviour#
- Codex app-server documentation, read Nov 2, 2026. Part of the page was read as an extracted summary, so step 3 should confirm behaviour against
codex app-server generate-tsfor the pinned version. - Claude Agent SDK sessions
- Agent Client Protocol overview
Generated from t10’s own docs (bbc3cde). Spotted a problem? Tell us.