@agentrelationsprotocol/arp-verify
v0.2.1
Published
CLI to verify Agent Relations Protocol (ARP) endpoint compliance. Fetches DID documents, agent cards, the discovery index, and tests signed messaging, first-contact enforcement, and signature validation.
Maintainers
Readme
@agentrelationsprotocol/arp-verify
CLI that verifies ARP (Agent Relations Protocol) endpoint compliance. Runs a
sequence of live checks against your agent's HTTP surface and reports pass/fail
for each. Exit code is 0 when every check passes, 1 otherwise.
Usage
npx @agentrelationsprotocol/arp-verify agents.mycompany.com
npx @agentrelationsprotocol/arp-verify agents.mycompany.com --agent order-processor
npx @agentrelationsprotocol/arp-verify localhost:3141The CLI supports two common deployment shapes:
- Single host — all agents live under one domain, cards at
/.well-known/arp/<name>.jsonand DID docs at/<name>/did.json. - Subdomain-per-agent — the root domain serves the directory manifest and
each agent lives on its own subdomain (e.g.
a.mycompany.comhosts the index;agent.a.mycompany.comhosts the card, DID doc, and inbox). In this case, point the CLI at the root domain — it follows the URL advertised in the directory entry and resolves the DID document from each agent'sdid:web:…identifier.
Checks
- agents.txt —
/agents.txtexposes anarp-directory:line (v0.4.0). - Agent Index —
/.well-known/arp/index.jsonreturns a valid directory manifest with a non-emptyagentsarray. - Agent Card — fetched from the URL advertised in the directory (with
fallback to
/.well-known/arp/<name>.json), with all required fields present. - DID Document — resolved from the agent card's
did:web:…identifier per the did:web spec; structure validated. - Key Consistency —
publicKeyon the Agent Card matches thepublicKeyMultibasein the DID document's first verification method. - Inbox Reachable — POSTing an unsigned message returns a structured ARP error response.
- First-Contact Negotiate — a signed
negotiatewithbody.firstContact: trueandbody.publicKeyis accepted. - Echo Test — if the agent declares an
echocapability, a signed request round-trips correctly. - Server Signatures — server responses carry a valid signature that verifies against the advertised public key.
- Open Capability — capabilities declared
open: trueaccept requests without a prior handshake. - First-Contact Enforcement — non-open capabilities reject unknown
senders with
FIRST_CONTACT_REQUIRED(HTTP 403). See caveat below. - Expired Message Rejection — messages with
expiresAtin the past are rejected withMESSAGE_EXPIRED(HTTP 400). - Trust Annotations — responses include a
trustLevelfield (recommended in v0.4.0). - JSON-LD Agent Card —
@contextand@type: SoftwareApplicationpresent (recommended for crawler indexing). - JSON-LD Directory —
@contextand@type: CollectionPageon the directory manifest. - Content-Type Enforcement — non-JSON content types are rejected.
Test identity
Signed checks are sent from a bundled did:web test identity:
did:web:agentrelationsprotocol.com:arp-verifyThe private key for this identity is intentionally public — it ships with
the CLI and is published in the DID document at
https://agentrelationsprotocol.com/arp-verify/did.json. This is a conformance
tool, not a trusted agent. Signatures from this identity prove only that a
message was sent via arp-verify (or a tool using the same keys). Receivers
MUST treat this identity as any other unknown sender — via the first-contact
handshake — and MUST NOT grant privileges based on this DID.
Known limitation — first-contact enforcement on repeat runs
The first-contact-enforcement check expects the receiver to reject a signed
request from an unknown sender with FIRST_CONTACT_REQUIRED. On the first
run against a fresh endpoint this works correctly. On subsequent runs, the
endpoint may have a cached relation with the bundled test identity, in which
case the check will incorrectly fail. Clear relations on the endpoint side
between runs, or treat a 200 on this specific check as a non-issue if you
know the identity is already known.
Development
npm install
npx tsx src/index.ts localhost:3141License
Apache-2.0
