The interop peer

The interop peer is a public AITP responder that anyone can complete a real handshake with. It runs at https://interop.agentidentitytrustprotocol.io, and it is the aitp binary's own aitp serve --interop, so you can run a copy yourself.

cargo install aitp-cli
aitp enroll https://interop.agentidentitytrustprotocol.io
aitp echo https://interop.agentidentitytrustprotocol.io

The peer only accepts handshakes from keys it has pinned, so the handshake needs your key to be enrolled first. aitp enroll does that, using (and on first use creating) your default key. aitp echo then presents the same key: it runs the handshake and hands the TCT the peer issued back to its /echo, with proof of possession. See cli.md for both commands.

What it serves

RouteWhat it does
GET /.well-known/aitp-manifestThe peer's signed Manifest (RFC-AITP-0003).
POST /aitp/handshake/hello, /commitThe Mutual Handshake, as responder (RFC-AITP-0004).
GET /.well-known/aitp-revocation-listThe peer's own ListRevoked snapshot (RFC-AITP-0008). It revokes nothing, so the list is always empty.
POST /enroll/challenge, POST /enrollKey enrolment, below.
POST /echo/challenge, POST /echoPresent the TCT the peer issued you, with proof of possession; get its verified claims back.
GET /status{"status": "ok", "aid", "version", "capabilities", "enrolled"}.

Every route, unknown paths included, sits behind a general per-address rate limit (below).

sequenceDiagram
    participant C as aitp (you)
    participant P as interop peer
    C->>P: POST /enroll/challenge
    P-->>C: {nonce, peer_aid, expires_at}
    C->>P: POST /enroll {aid, nonce, signature}
    Note over P: policy writes (alg, public key)<br/>into pinned_keys for 24 h
    P-->>C: {aid, expires_at, capabilities}
    C->>P: GET /.well-known/aitp-manifest
    C->>P: MUTUAL_HELLO (pinned_key identity)
    Note over P: verifies against pinned_keys
    P-->>C: MUTUAL_HELLO_ACK
    C->>P: COMMIT (TCT for the peer)
    P-->>C: COMMIT_ACK (TCT granting aitp.interop.echo)
    C->>P: POST /echo/challenge {tct}
    P-->>C: pop_challenge {tct_jti, nonce}
    C->>P: POST /echo {tct, pop_response}
    Note over P: issuer checks, PoP from sub,<br/>revocation last (RFC-AITP-0005 §10.5)
    P-->>C: {"echo": claims}

Enrolment is key registration

How a pinned-key responder's pinned_keys gets populated is operator policy, not part of the protocol: RFC-AITP-0002 §3.2 says so, enrolment flows included (spec commit d18f1fd). Enrolment is a registration step, like uploading an SSH public key. It is not an AITP identity verification mode, and it is not RFC-AITP-0002 §3.4 pinned admission: the peer doesn't run the §3.4 verifier, its responses don't claim to be §3.4, and its error codes are its own.

The caller proves it holds the private key for an AID by signing a single-use challenge. The peer's policy then writes the key into the pinned-key store that every handshake verifies against:

Anyone may enrol a key, for 24 hours, for the capability aitp.interop.echo only.

There is no possession-only path: a key that isn't enrolled is refused at MUTUAL_HELLO with IDENTITY_FAILED, as at any pinned-key responder.

Wire format

POST /enroll/challenge  {}                       -> 200 {nonce, peer_aid, expires_at}
POST /enroll            {aid, nonce, signature}  -> 200 {aid, expires_at, capabilities}
  • nonce is 16 random bytes, base64url without padding. It is accepted once, for 60 seconds.
  • signature is the AID key's signature (the suite's JCS signature, sign_jcs) over SHA-256("aitp-interop-enrol-v1" 0x00 aid 0x00 peer_aid 0x00 nonce), with nonce as the 16 raw bytes. Binding peer_aid stops a signature made for one peer being replayed at another.
  • Ed25519 and P-256 AIDs (aid:pubkey:) are both accepted. The response aid is the canonical form, which handshakes present.
  • Unknown fields are refused.

The peer checks a request in this order: the per-address rate limit, then the body, then the signature, then the nonce. The signature comes before the nonce, so a forged request can't burn an honest client's challenge. The implementation is crates/aitp-cli/src/enrol.rs (shared by aitp enroll and the server, fuzzed by fuzz_targets/interop_enroll.rs) and crates/aitp-cli/src/serve.rs.

Errors

Every refusal is {"error": "<code>", "message": "…"}:

StatuserrorCause
400bad_requestMalformed JSON, AID, nonce or signature encoding.
413bad_requestBody over 64 KiB (any route).
401bad_signatureThe signature doesn't verify under the AID's key for this peer and nonce.
401bad_nonceThe challenge is unknown, already used, or expired.
429rate_limitedOver the per-address limit; Retry-After says when to retry.
503enrol_busyToo many outstanding challenges; Retry-After when known.

Policy and limits

LimitValueSetting
Every request, any route, per client addressA token bucket: a burst of 120, then 120 a minute (one every 0.5 s). Over it: 429 with Retry-After. On the peer's own routes (/enroll, /enroll/challenge, /echo, /echo/challenge, /status) the body is the rate_limited JSON error; on every other path, AITP routes and unknown paths alike, it is empty, with Cache-Control: no-store, matching the handshake's own 429 (RFC-AITP-0009 §3.1). 0 turns it off; --rate-burst 0 does not (it means a burst of 1). It tracks up to 100 000 addresses; once that many have a partly drained bucket, a new address is refused on every route until buckets refill.--rate-per-ip-per-minute / AITP_RATE_PER_IP_PER_MINUTE, --rate-burst / AITP_RATE_BURST
Enrolment lifetime24 h; enrolling again refreshes it--enrol-ttl / AITP_ENROL_TTL
Enrolled keys held10 000; at the cap the oldest enrolment goes first--enrol-cap / AITP_ENROL_CAP
POST /enroll per client addressA token bucket: a burst of 5, then one every 12 minutes (5 an hour). Every attempt counts, valid or not.--enrol-per-ip-per-hour
POST /enroll/challenge per client addressA burst of 10, then one every 6 s—
POST /echo/challenge and POST /echo per client addressTogether, a burst of 10, then one every 6 s—
Outstanding challenges10 000 enrolment and 10 000 echo—
Handshake requestsRFC-AITP-0009 §3.1 defaults: 30 per source and 10 per sender AID per 60 s—
Request body64 KiB, every route → 413. The peer reads and discards the rest of an over-limit body, up to 1 MiB, before it answers, so the 413 reaches the client and the connection stays open. A declared Content-Length over 1 MiB is refused without reading the body.—
Request deadline15 s → 408—

The general limit is checked first, so the stricter per-route buckets below it still decide once a client is under 120 a minute. A full client run (enrol, handshake, echo) is about 8 requests.

A client address is the TCP peer, or the client named in X-Forwarded-For when the TCP peer is a --trusted-proxy: the rightmost hop that isn't itself trusted. IPv6 addresses count per /64.

Some edges append a public hop of their own that changes per request. Railway's edge connects from 100.64.0.0/10 and sends X-Forwarded-For: <client>, <edge> with a rotating <edge>, so the rightmost-hop rule would key limits on the edge. It also writes the client into X-Real-IP, replacing any value the client sent. Behind such an edge, pass --client-ip-header x-real-ip so the limits key on that header instead. The public instance runs with AITP_TRUSTED_PROXIES=100.64.0.0/10 and AITP_CLIENT_IP_HEADER=x-real-ip.

Enrolments, challenges and rate-limit state live in memory, so a restart or redeploy clears them: enrol again.

The handshake

The peer's Manifest offers aitp.interop.echo, accepts pinned_key identities only, and advertises its revocation list. It requests aitp.interop.echo from you, and grants you aitp.interop.echo and nothing else. aitp echo requests and offers exactly that; aitp handshake offers what you --grant unless you pass --offer.

The peer re-signs its Manifest every 12 hours (it is valid for 24), so a Manifest you fetched is never used past its expires_at. A handshake that straddles a re-sign fails and can be retried.

Revocation of the TCT you issue the peer

In the handshake you issue the peer a TCT, and the peer checks its revocation status like any verifier (RFC-AITP-0008). An aitp client or a CI job usually publishes no revocation list. So the peer runs RevocationFailMode::FailOpenIfUnadvertised:

  • If your verified Manifest advertises no revocation list, the peer accepts your TCT without a revocation check, and logs each such acceptance at info level.
  • If it advertises one, the peer stays fail_closed: a list it can't fetch or verify fails the handshake with TCT_REVOKED, and a revoked jti is refused. A real list is never ignored.

The justification: the peer never uses the TCT it receives; it authorises nothing. The setting applies only to the TCTs issued to the peer. Revocation stays fail_closed by default everywhere else, aitp handshake and aitp echo included.

/echo

aitp echo https://interop.agentidentitytrustprotocol.io

/echo is where you present the TCT the peer issued you back to it. The peer is that TCT's issuer acting as its resource server, so RFC-AITP-0005 §10.5 applies: it accepts the token only with downstream proof of possession over a challenge it issued for that token's jti. Neither the TCT alone nor a PoP over someone else's challenge is enough.

POST /echo/challenge  {tct}                -> 200 pop_challenge envelope
POST /echo            {tct, pop_response}  -> 200 {"echo": <claims>}

pop_challenge and pop_response are standard AITP envelopes (RFC-AITP-0005 §6.1), carried in the HTTP bodies (§6.3). The challenge payload is {tct_jti, nonce}, signed by the peer; the response is signed by the TCT's subject. Unknown fields are refused.

POST /echo/challenge first runs the checks that need no proof, so a dead token never gets a challenge:

  1. the TCT is signed by this peer, iss is the peer, aud equals sub, and it is in date;
  2. it grants aitp.interop.echo.

The challenge is accepted once, for 60 seconds, and only for the jti it names. POST /echo then checks, in this order:

  1. the same two checks again;
  2. the challenge, which is consumed here: any answer, right or wrong, uses it up;
  3. the pop_response (RFC-AITP-0005 §6.2): its envelope is signed by sub, nonce_echo matches, the PoP signature verifies under the sub key, and the key matches the TCT's cnf.jkt. This makes the presenter sub, which is the aud the token names;
  4. revocation, last, against the peer's own list: the one behind its ListRevoked snapshot. The peer revokes nothing, so it is empty.

Refusals are {"error": "<code>", "message": "…"}, with registered AITP codes wherever one fits:

StatuserrorCause
400bad_requestMalformed JSON or unknown fields; a body without pop_response at /echo.
401TCT_SIGNATURE_INVALIDThe TCT doesn't verify as one this peer issued, or aud isn't sub.
401TCT_EXPIREDThe TCT is out of date.
403POLICY_VIOLATIONThe TCT doesn't grant aitp.interop.echo.
401POP_RESPONSE_INVALIDNo outstanding challenge for this jti and nonce (never issued, already used, or for another token), or the pop_response fails a check.
401POP_CHALLENGE_INVALIDThe challenge expired.
401TCT_REVOKEDThe jti is on the peer's list.
429rate_limitedOver the per-address limit; Retry-After says when to retry.
503echo_busyToo many outstanding challenges; Retry-After when known.

The wire format is in crates/aitp-cli/src/echo.rs, shared by aitp echo and the server. A service that authorises real actions with a TCT it received (rather than issued) follows the rest of RFC-AITP-0005 §6; see the Integration Guide.

Running it yourself

cargo install aitp-cli --features serve
aitp keygen > peer.key
aitp serve --interop --key peer.key --listen 127.0.0.1:8080
# elsewhere:
aitp enroll http://localhost:8080 --insecure-localhost
aitp echo http://localhost:8080 --insecure-localhost

Or as a container, built from the repository root:

docker build -f deploy/interop-peer/Dockerfile -t aitp-interop-peer .
docker run --rm -p 8080:8080 -e AITP_PEER_KEY="$(aitp keygen)" aitp-interop-peer
scripts/interop-peer-smoke.sh http://localhost:8080   # enroll -> echo

The peer prints aitp: interop peer <aid> listening on <addr> on stderr once it is ready, and logs to stderr (RUST_LOG, default info). It speaks plain HTTP: put TLS in front of it, and name that proxy with --trusted-proxy so the per-address limits see clients.

FlagVariableDefault
--interop—Required: the only mode.
--listen <ADDR>AITP_LISTEN0.0.0.0:$PORT, else 0.0.0.0:8080
--public-url <URL>AITP_PUBLIC_URLhttp://localhost:<port>. The origin clients use; it goes into the Manifest's handshake endpoint and revocation list URL.
--key <FILE>AITP_PEER_KEY_FILE, or the key itself in AITP_PEER_KEY— (required). aitp keygen output or a bare hex seed.
--trusted-proxy <CIDR>AITP_TRUSTED_PROXIES (comma-separated)none
--client-ip-header <NAME>AITP_CLIENT_IP_HEADERnone. A header in which the trusted proxy writes the client address itself, overwriting any the client sent. From a trusted hop it replaces X-Forwarded-For for every limit.
--enrol-ttl <SECS>AITP_ENROL_TTL86400
--enrol-cap <N>AITP_ENROL_CAP10000
--enrol-per-ip-per-hour <N>AITP_ENROL_PER_IP_PER_HOUR5
--rate-per-ip-per-minute <N>AITP_RATE_PER_IP_PER_MINUTE120. The general limit on every request per client address; 0 turns it off.
--rate-burst <N>AITP_RATE_BURSTthe per-minute value

The peer's key is its identity: its AID is what clients see, and a new key is a new peer. Keep it in a secret store and pass it through AITP_PEER_KEY.

The public instance

The public instance runs on Railway (project aitp-interop-peer, service interop-peer), built from deploy/interop-peer/Dockerfile. Its key is in Doppler (aitp-interop-peer/prd, AITP_PEER_KEY), and its AID is aid:pubkey:En0RjMZMZQyo9jvanvetTAbyp4F7WR5pII2-xU_hHdc. deploy/interop-peer/deploy.sh does every change, and on its own only prints the plan:

CommandWhat it does
deploy.shPrints the ref, the peer AID, the variable sync's dry run and the live state. Changes nothing.
deploy.sh --apply [--ref R]Checks that Doppler's AITP_PUBLIC_URL matches the environment's URL, runs doppler-sync.sh --apply --no-redeploy (and stops if it refuses), and sets only RAILWAY_DOCKERFILE_PATH itself. Then it deploys R (default origin/main) from a clean worktree, waits for /status to show the peer AID, and runs scripts/interop-peer-smoke.sh against the public URL.
deploy.sh --previousRedeploys the deployment before the latest one.
deploy.sh --rollbackRemoves the live deployment, so the peer is offline, and prints the DNS record to delete. --apply or --previous brings it back.

--environment staging runs any of these against the staging environment instead. It is served only at its Railway domain, and is where --previous and --rollback were tested. Leave it offline when you're done.

flowchart LR
    client["client"] -->|"TLS<br/>interop.agentidentitytrustprotocol.io"| edge["Railway edge<br/>100.64.0.0/10"]
    edge -->|"plain HTTP<br/>X-Real-IP: client"| peer["aitp serve --interop"]
    doppler[("Doppler<br/>aitp-interop-peer")] -.->|"doppler-sync.sh<br/>(run by deploy.sh --apply)"| vars["Railway variables"]
    vars -.-> peer

DNS for agentidentitytrustprotocol.io is hosted at Squarespace, which has no API. interop is a CNAME to the target Railway gives the custom domain, and _railway-verify.interop is a TXT record that proves ownership: Railway issues the TLS certificate only after it sees it. deploy.sh prints either record while it is missing, so adding (or deleting) them is the one manual step.

Variables (Doppler)

Doppler is the source of truth for the peer's Railway variables: project aitp-interop-peer, config prd for the production environment and stg for staging. deploy/doppler-sync.sh copies the keys listed in deploy/doppler-keys.txt from Doppler into Railway:

KeyKind
AITP_PEER_KEYSecret: the peer's identity. In stg it is a Doppler reference to prd's value, so staging presents the production AID.
AITP_PUBLIC_URLConfig: differs per environment.
AITP_TRUSTED_PROXIES, AITP_CLIENT_IP_HEADERConfig: Railway's edge range and its client IP header.
RUST_LOGConfig.

RAILWAY_DOCKERFILE_PATH stays Railway-managed: deploy.sh sets it, and sets nothing else. --environment takes production (config prd) or staging (config stg). For a new environment, set AITP_PUBLIC_URL in Doppler before the first --apply; deploy.sh stops and says so otherwise. The sync refuses RAILWAY_* keys and Railway references (${{…}}), and never deletes a variable.

The enrolment and rate-limit settings (AITP_ENROL_*, AITP_RATE_PER_IP_PER_MINUTE, AITP_RATE_BURST) are not on the list, so the peer runs with the defaults in the limits table above. To override one, set it in Doppler in both prd and stg first (by pipe, as below), then add it to deploy/doppler-keys.txt in the same PR. If the key is listed but missing from either config, the sync refuses it as missing-in-doppler, and that also stops deploy.sh --apply. Never set it in Railway directly: Doppler is the only writer.

CommandWhat it does
doppler-sync.sh [--environment E]Dry run: prints each key's status (unchanged, new, changed, or a refusal) and whether the Doppler and Railway fingerprints match. Never prints a value.
doppler-sync.sh --applyWrites new keys, then redeploys once. With nothing to write it prints no-op and redeploys nothing.
doppler-sync.sh --apply --push KAlso overwrites K, whose Railway value differs from Doppler's. Without --push, --apply refuses a key the two disagree on, so a person decides which value wins.
--no-redeployWrites without redeploying; the values apply on the next deploy.

To change a value, set it in Doppler by pipe (doppler secrets set echoes values, so discard its output), then push it:

printf %s "$new_value" | doppler secrets set RUST_LOG -p aitp-interop-peer -c prd >/dev/null
deploy/doppler-sync.sh --apply --push RUST_LOG

--apply refuses to run while the sync script or the allowlist is uncommitted or modified, so it applies the reviewed allowlist. It runs from your checkout, not from the ref being deployed.

Seeded 2026-11-08 from Railway's own values: both configs hold all five keys, stg's AITP_PEER_KEY is the reference, and the dry run shows every key unchanged with matching fingerprints (production 1f097b3456d944ff, staging 54b6871b256e175a).

Event freeze, 2026-11-09 to 2026-11-15 UTC: nothing may redeploy the peer. Against interop-peer only a dry run, a no-op --apply, or --apply --no-redeploy is allowed in that window.