The gate interface in full

Everything a gate can be given and can answer, beyond Test your own gate. Start there; come here when you need a detail.

A service over HTTP

The wire format, agentic_datacenter.gate.http/1, is in gate-http-v1.schema.json; a complete service in standard-library Python is in examples/http-gate/server.py.

Request Body Answer
POST /evaluate schema, proposal, premises, actor, correlation; context with ADC_GATE_CONTEXT=1 schema, verdict, reasons; optionally required_approvers, escalated, decision_id, receipt
POST /outcome schema, decision_ref, status, detail, and the request's correlation_id, action_ref, proposal_id and verdict anything; it is not read

To try it, start the example in one terminal and check it from another:

uv run python examples/http-gate/server.py --port 8787
export ADC_GATE_URL=http://127.0.0.1:8787 ADC_GATE_NAME=example
uv run agentic-datacenter gate check http_gate

What the binding does not leave to the service:

  • The writes an ALLOW authorizes are the instance's own. A service cannot add or change one.
  • The decision reference, its nonce and its expiry are made by Agentic-Datacenter from everything decided. Your decision_id and receipt are kept beside it on the decision record (gate_detail), with the correlation, for cross-checking.
  • A service that does not answer within ADC_GATE_TIMEOUT_S (default 10), or answers with anything that is not a valid verdict with reasons, gets ABSTAIN, and the reason is on the decision. A gate that fails is counted as failing closed, and its false blocks show it.
  • Only loopback is called unless ADC_GATE_ALLOW_REMOTE=1 is set, because the requests carry simulation state.
Variable What it does
ADC_GATE_PROFILE The operating profile, default DECISION_ONLY. SHADOW for a gate that only observes or advises.
ADC_GATE_STATEFUL=1 For a service that keeps state between requests: sessions, budgets, quotas, a ledger. Key what you keep by the request's session, which is new for every run and every counterfactual replay. Agentic-Datacenter then replays each branch from the start of the run.
ADC_GATE_DERIVES_AUTHORITY=1 For a service that works out for itself who may act. A request then carries the mandate record and not the premise authority(...); the run is still judged by that premise (ADR 0031).
ADC_GATE_VERIFIES_MANDATES=1 For a service that authenticates mandates itself. A request then carries the mandate as signed statements with the issuers the site trusts (mandate_statements), and neither the premise nor the register's record; the run is still judged by the premise (ADR 0039).
ADC_GATE_TIMEOUT_S Seconds to wait for an answer, default 10.
ADC_GATE_ALLOW_REMOTE=1 Allow a URL outside loopback.

Four more things a service may use or should know:

  • Its own words. Answer permit, block, forbid, ask, escalate, require_approval, skip or another word listed under verdict_aliases in the schema. Each is read as the Agentic-Datacenter verdict it means, and your word is kept on the decision.
  • The tool-call view. tool_call carries the same proposal as name, arguments and the concrete writes, for a gate that decides on the action itself rather than on an intent contract.
  • Fields you do not know. Ignore them. An optional field can be added to a request within a version of the wire format, as mandate was; nothing that is there today is removed or changes its meaning.
  • A command instead of a URL. Attach as command_gate with ADC_GATE_COMMAND="my-hook --flag". Agentic-Datacenter runs the command once per request, writes {"endpoint": "/evaluate", "request": ...} to its standard input, and reads the answer from its standard output. Exit status 2 with nothing written and a first line on standard error that starts with DENY: means DENY, for the reason after it, as a blocking hook would. Exit status 2 without that line is a failure to answer, not a refusal: it is also what an interpreter gives for a script it cannot open.

A binary gate and approvals

A binary gate has to decide for itself the cases where another gate would ask a person (premises.approval is one_operator or two_person):

  • Deny them. Nothing executes without a person. Proposals that were in fact safe count as false blocks.
  • Allow them when your own checks pass. These run without a person. The card counts them as executed without the approval the contract asks for, whether or not harm came of it (fairness rules).

The example service uses all four verdicts. A binary gate can map ABSTAIN and VERIFY there to DENY.

Signed mandates, in two terminals

If your system checks who may act, let it work that out from signed statements. Leave the example service running, and in the second terminal:

export ADC_GATE_URL=http://127.0.0.1:8787 ADC_GATE_NAME=example ADC_GATE_VERIFIES_MANDATES=1
uv run python examples/mandate-verifier/verify.py docs/reference/mandate-vectors.json
uv run agentic-datacenter bench run --tier quick --jobs 4 \
    --scenario AD-11 --scenario AD-16 --scenario AD-17 --scenario AD-18 --scenario AD-19 \
    --scenario OP-15 --scenario OP-16 \
    --gate http_gate --gate static_allowlist --out build/signed-mandates

Any gate, a Python package such as remora_governed included, can be run the same way with bench run --statements-only <gate>, and so can a run on the benchmark runner with its statements_only input. ADC_GATE_VERIFIES_MANDATES=1 is read where bench run is started, not by the service: it decides what a request carries. The gate is then sent signed statements and neither the answer nor the register's record. The run takes about six minutes on four cores; --scenario AD-17 alone, the forged mandate, takes two. It ends with lines like these:

45 of 45 queries right
http_gate         scripted_adversarial ...
    without a mandate: 0 executed of 61 proposed, 61 refused citing authority
    given signed mandate statements alone, neither the premise nor the record, in 7 run(s)
    its own finding of who may act: given for 94, 0 of them not the premise
static_allowlist  scripted_adversarial ...
    without a mandate: 38 executed of 61 proposed, 0 refused citing authority

The first line is the rule's test vectors, which your own implementation should pass too. The rest says that a gate which follows the rule refused every step taken without a mandate, after a withdrawal, an expiry, three forgeries, a delegation withdrawn at its source and a retired key, while a gate that only checks limits executed 38 of them. build/signed-mandates/summary.md has it as a table. The rule is on one page: Signed mandate statements.

Correlation, context and receipts

Every request carries a correlation that its outcome message carries too, with a content address of the action and the time as UTC from a fixed anchor, and a gate can ask for a read-only sample of the plant (ADC_GATE_CONTEXT=1), in which every reading is signed by its source and carries the text that was signed, so that you can check where it came from. Receipts you export are checked against the run with gate verify-receipts, and their signatures too when you give your public key (--key, or ADC_GATE_RECEIPT_KEY for a check during the run; ADR 0041). See Preserve the policy's meaning and ADR 0036.

Reason codes, who may act, and the decision log

A gate can also say why in a word: an optional reason_codes in its answer, from authority, limit, premise, evidence, approval, malformed, policy and other (ADR 0028). examples/http-gate/server.py shows it. If your gate gives none, the card still carries, for each refusal it judged, what Agentic-Datacenter itself found wrong with the step (grounds), and every run counts all its refusals both ways (refusals).

Who may act is told in two ways once a mandate was set for the proposer (ADR 0028, ADR 0031). The premise authority(<principal>, <contract>) holds or does not; it is what a run is judged by. Beside it, mandate carries the record the premise was established from: every change to the proposer's mandate, oldest first, each with its time, when the next change replaced it, the contracts held from then on, who made the change and why. The last change is in force while its until_ms is null; a change that ends by itself carries expires_at_ms, and until_ms is set once that instant has passed. A change by which someone passed on part of their own mandate carries delegated: true and holds only while that someone holds the contract too; their record is in mandate.delegators (ADR 0040). It is a register's entries, not credentials: nothing in it is signed.

A gate that works out for itself who may act can ask not to be told the answer: ADC_GATE_DERIVES_AUTHORITY=1 for a served gate, derives_authority = True on a Python gate. It is then sent the record and not the premise, the run is judged by the premise all the same, and the card says that the gate was not told (premise_told). A gate that asks for this and cannot work it out lets every step without a mandate through, and that is counted.

A gate that authenticates mandates can go one step further: ADC_GATE_VERIFIES_MANDATES=1 for a served gate, verifies_mandates = True on a Python gate. It is then sent mandate_statements and nothing else about who may act: each change as a statement signed with Ed25519 that names the one it supersedes, the statements of everyone the mandate was passed on from, whatever else was presented for the proposer, which may be forged, and every key of each issuer the site knows, with when it was valid. One rule says which statements count and who holds what after a replacement, a withdrawal, an expiry, a delegation, a key rotation or the end of an issuer's standing. It is on one page, Signed mandate statements, with test vectors and a reference in a hundred lines to copy or port (examples/mandate-verifier/verify.py, MIT). The card says that the gate was given statements alone (record_told). AD-16 to AD-19, OP-15 and OP-16 test it, and examples/http-gate/server.py verifies whenever it is sent statements and no record (it then needs the cryptography package, which uv sync installs). Set the variable where bench run is started.

Told or not, a gate can say two more things, both optional. Its own finding of whether the proposer holds a mandate, whatever its verdict: "authority_holds": true or false. And, with a refusal for want of a mandate, which kind it was, in reason_details: {"authority": "ended"} when an earlier change held the contract, {"authority": "never_held"} when none did. Both example gates decide from the record when there is one, and say both. For each run in which a mandate was set, the card counts the steps without a mandate by kind as the register holds them, the ones your gate allowed, how often its finding was not the premise, and how often its kind was not the register's (authority on each run and on each row of results). Each judgement carries the same for its proposal. A gate that says nothing more than authority loses nothing by it.

Beside the card, bench run writes decisions.jsonl: one line for each proposal, with your gate's verdict, the reasons your gate gave, the outcome, and what Agentic-Datacenter itself found wrong with the proposal (contract errors, limit errors, premises not established). It shows why a step was refused, which the card does not. The card is the same file with or without it. A card merged from parts (bench merge) has the decisions of its parts in their own files.

Map your terms to Agentic-Datacenter's

Governance systems name the same things differently. When you report a result, say how your concepts map onto Agentic-Datacenter's, and how closely:

Agentic-Datacenter Where
Proposal, intent contract Proposal, contracts/*.yaml
Verdict: ALLOW, DENY, VERIFY, ABSTAIN Decision.verdict
Authorization bound to writes, single use, with expiry decision_ref, single_use_nonce, expires_at_ms
Premise, evidence established by the harness PremiseSnapshot.premises
Human approval and its count VERIFY, required_approvers
Outcome after execution Outcome: APPLIED, REJECTED, ROLLED_BACK, UNKNOWN, NOT_EXECUTED
Decision record and evidence the evidence bundle of each run (agentic-datacenter scenario verify)

For each row: an exact match, a partial one (say what differs), or none. A concept of yours that Agentic-Datacenter has no place for is worth an issue.