Docs Contracts
Agent contract
The /agent contract as enforced by the conformance suite: what any harness must serve.
Version 0. It can still change, and it becomes version 1 when a second harness passes. A harness is anything that passes conformance.ts, which speaks only HTTP, so a harness can be written in any language.
node contracts/agent/conformance.ts agent-pi
# Rust harness (build it first):
(cd agent-ti && cargo build --locked)
node contracts/agent/conformance.ts agent-ti
make check # both, with the other contract checksThe suite plays the model, the tool server and the token issuer, and starts the harness pointed at itself, with harness.json as agent-pi-style configuration. It tests a bare harness with no gateway, so a pass also proves the harness side of a lightweight deployment. To add a harness, add it to harnesses in conformance.ts.
design.md explains why the contract is shaped this way, and what's proposed for it.
Required#
| Part | Every harness provides |
|---|---|
| Manifest | GET /v1/runtime, with no token |
| Health | GET /healthz, GET /readyz |
| Identity | Verifies tokens itself, and takes the tenant only from the token. A missing or bad token answers 401 |
| Ownership | A session belongs to its (tenant, user). Anyone else gets 404, and never sees it listed |
| Agent list | agents.list answers { "agents": [{ "name": "<agent>" }] } with its own agent. A router with several agents answers this itself |
| Agent name | An Agent-Name header naming another agent answers 400. Agent-Method is for routers, and a harness ignores it |
| Session methods | session.create, list, get, messages, update, close |
| Idempotent create | session.create with an Agent-Request-Id header answers the session the caller's first create with that key made. Keys belong to the session's owner |
| Origin | session.create, get and list include origin: { "trigger": "user" }, or the delegated token's trg and automation, such as { "trigger": "schedule", "automation": "au_1" }. A token without trg means user |
| Session capabilities | session.create, get and list include capabilities, the same list as the manifest |
| Session IDs | <pool>.<replica>.<n>. A wrong replica answers 421 |
| Input | session.prompt with wait: false, and session.cancel. A repeated requestId runs once |
| Events | GET /agent with Agent-Session-Id, as SSE of session/event notifications, resumable with Last-Event-ID. A stream opens with snapshot, and a gap gets one |
| Tracing | turnId on text events, traceparent continued on model calls. turnId is minted when a client sends none |
| Model calls | To one configured endpoint. To ai-gateway-llm, each carries X-Session-ID, X-Turn-ID, X-User-Id and X-Tenant-ID. To a provider directly, none of them |
| Tool calls | Reach the tool server only through policy, as MCP. To ai-gateway-tools, each carries traceparent, X-Turn-ID and X-Session-ID |
| Built-in tools | None, unless the pool declares them in builtin_tools |
Core events are snapshot, run.started, run.finished, text.delta, message.end, tool.started, tool.finished, submission and error. A client ignores events it doesn't know. Harness-specific events start with x..
text.delta carries offset, where its text starts in the message, so a client can spot a gap or a duplicate. message.end holds the full text and a stopReason, which is aborted after a cancel.
Capabilities#
A harness lists what it supports in the manifest and on each session. A client hides what a session doesn't support.
| Capability | Adds |
|---|---|
steer |
session.steer and whenBusy |
interrupt |
session.interrupt, answered as SSE, with an Agent-Submission-Id header |
voice |
duringTools: "steer", note, and speech events on a profile that enables them. Without it, a client hides Call |
retry |
session.retry |
background_tasks |
task.updated events and snapshot.tasks |
durable_runs |
An unfinished run continues after a restart |
plugin_methods |
Extra JSON-RPC methods, named in the manifest's methods |
greeting |
session.greet (what the agent says first on a call, fixed or written by the model, with context variables) and variables.catalog. See agent-ti/docs/greeting.md. A voice client falls back to its own text without it |
Manifest#
{
"contract": 0,
"harness": "pi",
"harness_version": "0.2.0",
"pool": "sales",
"agent": "sales",
"bundle": "sales@2026-11-02",
"profiles": ["chat", "voice"],
"capabilities": ["steer", "interrupt", "voice", "retry", "background_tasks", "durable_runs"],
"builtin_tools": [],
"methods": []
}Not in the contract#
Voice's retry of an input stuck in the inbox works around durable, so another harness needn't copy that behaviour. Token grants, and each tool call's token, aren't tested yet, because the suite has no fake auth-server for them.
Generated from t10’s own docs (bbc3cde). Spotted a problem? Tell us.