Agent header reference
This page is the one list of the headers an agent exchanges with the Core Proxy (:8100).
The behaviour behind them lives on its own pages:
run lifecycle (runs, steps, turns, closing a run),
declared outcomes (how a run may end),
agent implementation (the release carriers) and
A2A agents (the delegation chain).
Header names are case-insensitive on the wire; the tables use the spelling the gateway documents.
A complete set, on one call
Section titled “A complete set, on one call”The closing call of one loan screening in the Brutor Demo System: an MCP tool call that records the recommendation, names its phase and turn, says which release made it, and closes the run with the outcome it ended in.
curl -s http://localhost:8100/v1/proxy/mcp/$APPLICATIONS_SERVER_ID \ -H "Authorization: Bearer $BRUTOR_API_KEY" \ -H "X-Tenant-ID: default" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -H "Mcp-Session-Id: $MCP_SESSION_ID" \ -H "x-brutor-run-id: bds-APP-1042-01M5WMKHVG" \ -H "X-Brutor-Step-Id: record" \ -H "X-Brutor-Step-Name: Decide and record" \ -H "X-Brutor-Turn-Id: t3" \ -H "X-Brutor-Turn-Seq: 3" \ -H "traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" \ -H "X-Brutor-Agent-Name: brutor-demo-screening-agent" \ -H "X-Brutor-Agent-Version: 0.2.0" \ -H "X-Brutor-Run-End: completed" \ -H "X-Brutor-Outcome-Id: application_processed.loan_approved" \ -d '{"jsonrpc":"2.0","id":7,"method":"tools/call", "params":{"name":"applications_set_recommendation", "arguments":{"application_id":"APP-1042","recommendation":"approve"}}}'# brutor-demo-screening-agent/screening_agent/gateway.py builds every header in one placeh = { "Authorization": f"Bearer {settings.api_key}", "X-Tenant-ID": settings.tenant_id, **self.release.headers(), # X-Brutor-Agent-Name / -Version / -Build}if ctx is not None: # inside a run h["x-brutor-run-id"] = ctx.run_id h["traceparent"] = ctx.new_traceparent() if step_id: ctx.enter(step_id, turn) h["X-Brutor-Turn-Id"] = ctx.turn_id or "" h["X-Brutor-Turn-Seq"] = str(ctx.turn_seq) h["X-Brutor-Step-Id"] = step_id h["X-Brutor-Step-Name"] = (step_name or step_id)[:STEP_NAME_MAX]if run_end is not None: # only on the run-closing call h["X-Brutor-Run-End"] = run_end if outcome_id is not None: # completed runs only; validated against outcomes.json h["X-Brutor-Outcome-Id"] = outcomes.validate(outcome_id)function brutorHeaders(run: { id: string; step?: string; turn?: number }, close?: { state: string; outcomeId?: string }) { const h: Record<string, string> = { Authorization: `Bearer ${process.env.BRUTOR_API_KEY}`, "X-Brutor-Agent-Name": "my-agent", "X-Brutor-Agent-Version": "1.4.0", "x-brutor-run-id": run.id, // same id on every call of the task }; if (run.step) { h["X-Brutor-Step-Id"] = run.step; } if (run.turn) { h["X-Brutor-Turn-Id"] = `t${run.turn}`; h["X-Brutor-Turn-Seq"] = String(run.turn); } if (close) { h["X-Brutor-Run-End"] = close.state; // "completed", "errored", ... if (close.outcomeId) h["X-Brutor-Outcome-Id"] = close.outcomeId; } return h;}Request headers
Section titled “Request headers”Identity and scope
Section titled “Identity and scope”| Header | Grammar | Example | On a bad value |
|---|---|---|---|
Authorization |
Bearer sk_brutor_api_… (API key), Bearer <IdP or portal JWT> |
Bearer sk_brutor_api_3kq… |
401 with WWW-Authenticate |
X-API-Key |
API key, alternative to Authorization |
sk_brutor_api_3kq… |
401 |
X-Tenant-ID |
tenant id; only needed when the credential does not carry it | default |
401/403 |
X-Resource-Group |
one of the caller’s resource groups | group-01M5WEHAXG… |
blank is ignored; the primary group is used |
X-Brutor-Run-Scope |
key=value[,value…][; key=value…]; keys [a-z0-9_-]{1,64} (lower-cased), values ≤ 256 characters, ≤ 16 keys and ≤ 64 values per key |
customer=C0001; requester=S7 |
Malformed parts are dropped. The first value of a key binds for the run; a different later value changes nothing and is recorded as conflict. See Data scope |
Who is acting is decided by the credential, never by a header. See Users, groups & API keys and Agent identity.
Run correlation
Section titled “Run correlation”| Header | Grammar | Example | On a bad value |
|---|---|---|---|
x-brutor-run-id |
any opaque string, 1–128 characters after trimming | bds-APP-1042-01M5WMKHVG |
Blank or longer than 128: ignored, and the call becomes a one-action run of its own. Also ignored when the request carries any x-brutor-delegation-* header, or has no credential to bind it to |
X-Brutor-Step-Id |
opaque, 1–64 characters | record |
Empty or longer: treated as absent (the step is not recorded) |
X-Brutor-Step-Name |
display label, 1–128 characters | Decide and record |
Dropped when longer, or when no X-Brutor-Step-Id is sent |
X-Brutor-Turn-Id |
opaque, 1–64 characters | t3 |
Empty or longer: absent, so turns are inferred from model calls |
X-Brutor-Turn-Seq |
integer ≥ 0 | 3 |
Not an integer or negative: dropped |
X-Brutor-Session-Id |
opaque, 1–200 characters | chat-42 |
Longer: ignored. Resolved on the LLM routes only |
X-Brutor-Session-End |
1 or true |
true |
Anything else reads as “not the end” |
The gateway never stores the run id you send: it derives the run root from it, keyed by the tenant secret and bound to your credential, so the same id from another API key is another run. The derived root comes back on LLM responses as the x-brutor-run-id response header — that value, not yours, is the {root} of POST /v1/runs/{root}/end. Details: Run lifecycle.
Closing a run and reporting its outcome
Section titled “Closing a run and reporting its outcome”| Header | Grammar | Example | On a bad value |
|---|---|---|---|
X-Brutor-Run-End |
completed · completed_degraded · exhausted · errored · abandoned · cancelled (case-insensitive, ≤ 32 chars) |
completed |
Ignored, the call still succeeds. true is accepted and ignored too (it means “infer the state”; only the body of POST /v1/runs/{root}/end acts on it) |
X-Brutor-Outcome-Id |
<outcome> or <outcome>.<variant>, each part [a-z0-9_-]{1,48} — regex ^[a-z0-9_-]{1,48}(\.[a-z0-9_-]{1,48})?$ |
application_processed.loan_approved |
Never fails the call. Stored verbatim (trimmed, first 128 characters) and judged undeclared — a deviation. Not read at all on POST /v1/proxy/a2a/outbound |
Send both on the last call of the task. POST /v1/runs/{root}/end takes the same two values in its body and, unlike a proxy call, rejects a bad one with 400 — see Closing a run. What the outcome means is on Declared outcomes.
Release identity
Section titled “Release identity”| Header | Grammar | Example | On a bad value |
|---|---|---|---|
X-Brutor-Agent-Name |
[a-z0-9._-], ≤ 64, lower-cased |
brutor-demo-screening-agent |
Dropped (not stored) and counted in proxy_agent_impl_values_dropped_total |
X-Brutor-Agent-Version |
[A-Za-z0-9.+_-], ≤ 64 |
0.2.0 |
Dropped and counted |
X-Brutor-Agent-Build |
[A-Za-z0-9:._-], ≤ 128 |
sha256:9f2c… or a git SHA |
Dropped and counted |
X-Brutor-Client |
as a name | screening-scheduler |
Dropped; the User-Agent product name is used instead |
baggage |
W3C Baggage with gen_ai.agent.name, gen_ai.agent.version, gen_ai.agent.build |
gen_ai.agent.name=brutor-demo-screening-agent,gen_ai.agent.version=0.2.0 |
Illegal members dropped and counted. Never forwarded upstream |
These describe the caller; they never authorise it. A verified workload-token claim outranks MCP clientInfo (sent in the body as params._meta["io.modelcontextprotocol/clientInfo"] or on initialize), which outranks baggage, which outranks the X-Brutor-Agent-* headers. The order of trust and how a release is approved: Agent implementation & releases.
Tracing, delegation, approvals and caching
Section titled “Tracing, delegation, approvals and caching”| Header | Grammar | Example | On a bad value |
|---|---|---|---|
traceparent |
W3C: 00-<32 hex>-<16 hex>-<2 hex> |
00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01 |
Another version, wrong lengths or all-zero ids: dropped (a nearly-right trace id would join the wrong trace) |
x-brutor-delegation-root, -parent, -depth, -sig, -actor, -subject |
the gateway-signed chain you received on an inbound A2A call | as received | Forward all of them unchanged. A chain without -sig is recorded client_dropped; see the delegation chain |
X-Approval-Token |
the one-time token from an approved request | apt_9f2c… |
Rejected as an invalid approval; the call is refused |
Mcp-Session-Id |
the id the MCP initialize returned |
sess-… |
Per the MCP server |
X-Brutor-Cache |
off · no · false · 0 · disabled |
off |
Any other value leaves the semantic cache on. Cache-Control: no-cache does the same |
X-Brutor-AI-System |
an AI System id — OTel ingest only (/v1/ingest/otel/v1/traces) |
group-01M5WEHAXG… |
A system the key cannot reach is refused and recorded. Proxied calls ignore it |
Response headers
Section titled “Response headers”| Header | Returned on | Example | What to do with it |
|---|---|---|---|
x-brutor-run-id |
Every LLM response: /v1/proxy/llm (chat completions, responses — streaming too — completions, embeddings) and native Anthropic /v1/messages |
2R8SRAF8GXB8V7J6VZD93DRD0S |
The derived run root. Use it for POST /v1/runs/{root}/end, GET /v1/runs/{root} and run feedback. Do not send it back as x-brutor-run-id — that would derive a second run |
x-correlation-id |
proxy responses | 01M5WMKHW0… |
The audit row of this call |
X-Brutor-Outcome-Id |
POST /v1/proxy/a2a/outbound |
screening_completed.hit |
The delegate’s outcome, as the delegate reported it. Present only when it reported one |
X-Brutor-Outcome-Conformance |
POST /v1/proxy/a2a/outbound, always |
declared · undeclared · unreported |
The gateway’s check of that outcome against the delegate’s active contract. Branch on it, not on the delegate’s body |
X-Brutor-AI-Generated |
successful LLM completions | true |
Label the text as AI-generated |
X-Usage-Warning |
any governed call near a budget or quota | Daily budget at 85%: $4.25 / $5.00 |
Back off before a hard 429 |
X-Cache-Hit |
an LLM answer served from cache | semantic |
— |
x-brutor-maintenance-mode |
503 while the tenant is in maintenance |
read_only |
Retry after Retry-After |
The same checked outcome is written into the final A2A Task of the reply, as metadata["brutor.outcome.id"] and metadata["brutor.outcome.conformance"] — the carrier a streamed reply uses. See Delegated outcomes.
Headers your A2A server sends
Section titled “Headers your A2A server sends”An agent the gateway delegates to reports its outcome on its own reply:
| Carrier | Grammar | Example |
|---|---|---|
X-Brutor-Outcome-Id response header (synchronous reply) |
as above | screening_completed.clear |
metadata["brutor.outcome.id"] on the final Task (streamed or asynchronous reply) |
as above | {"metadata": {"brutor.outcome.id": "screening_completed.clear"}} |
When both are present the header wins.
Related
Section titled “Related”- Run lifecycle — how a run starts, closes and is judged
- Declared outcomes — declaring and reporting how a run ends
- The graph: runs, steps and turns — the headers wired into a LangGraph agent
- LLM proxy API and MCP, A2A & Skills endpoints

