Verification patterns
On this page
Every pattern ends in the same check: the agent is verified when hasHumanProof && isProofFresh on the registry.
| Pattern | The agent | The verifier |
|---|---|---|
| Agent-to-service | Signs HTTP requests | Recovers the signer and checks the registry (SelfAgentVerifier) |
| Agent-to-agent | Signs requests and responses | Both sides verify each other, and can check for a shared human |
| Agent-to-chain | Calls a contract as msg.sender | The contract reads the registry |
| Lookup | Shares its agent ID or address | Reads the registry, the REST API, A2A or MCP, with no signature |
Agent-to-service
Agent Service
│── POST /api (signed) ─────────────▶│
│ x-self-agent-address │── recover signer from the signature
│ x-self-agent-signature │── agentKey = zeroPad(signer, 32)
│ x-self-agent-timestamp │── isVerifiedAgent + isProofFresh
│ │── provider, sybil, credential policy
│◀── 200 OK ──────────────────────────│
- The agent calls
agent.fetch(), which adds the signature headers. - The service runs
verifier.auth()(Express) orverifier.verify()on the raw body. - The verifier derives the agent key from the signature, never from a header, then checks the registry and your policy.
Ed25519 agents send x-self-agent-keytype: ed25519 and x-self-agent-key instead of x-self-agent-address. Headers and options: SDK integration. Setup walkthrough: Verifying agents.
Agent-to-agent
Both agents sign their messages with SelfAgent and verify the other’s with SelfAgentVerifier. To find out whether two agents are backed by the same human, without learning who that human is:
- compare
req.agent.nullifier(orgetInfo().nullifier) of the two agents, or - call
sameHuman(agentIdA, agentIdB)on the registry.
Agent-to-chain
The agent sends a transaction from its own EVM key, and the contract derives the agent key from msg.sender:
bytes32 agentKey = bytes32(uint256(uint160(msg.sender)));
require(
registry.isVerifiedAgent(agentKey) && registry.isProofFresh(registry.getAgentId(agentKey)),
"Agent not human-verified"
);
isVerifiedAgent alone does not check expiry, so always pair it with isProofFresh. See Gating smart contracts.
Lookup without a signature
When you only need to know whether an agent ID or key is verified (dashboards, allowlists, A2A peers):
- SDK:
verifyAgent(agentKey, { network }) - REST:
GET /api/agent/verify/{chainId}/{agentId}or/api/verify-status/{chainId}/{agentId}(Agent queries) - A2A: the
verifyorfreshnessintent - MCP:
self_verify_agent
A lookup proves the agent exists and is human-backed, not that the caller controls it. For access control, verify a signature.
Sybil resistance
Each human has one nullifier per scope, so every agent of one human shares it. Two limits apply:
| Limit | Where | Value |
|---|---|---|
| Registry cap | maxAgentsPerHuman on the registry | 10 on Celo Mainnet, 0 (no cap) on Celo Sepolia |
| Your service’s cap | .sybilLimit(n) / MCP max_agents_per_human | Default 1. 0 = no cap |
The default of 1 rejects any human who holds more than one agent, which is common (Human has 13 agents (max 1)). Pick a policy:
| Policy | Builder |
|---|---|
| One agent per human | .sybilLimit(1) (SDK and MCP default) |
| Up to N agents per human | .sybilLimit(n) |
| No limit (detection only) | .sybilLimit(0), then compare nullifiers or call sameHuman() |
Credential policies
Require ZK-attested credentials disclosed at registration:
import { SelfAgentVerifier } from '@selfxyz/agent-sdk';
const verifier = SelfAgentVerifier.create()
.requireAge(18) // the human proved 18+
.requireOFAC() // credentials.ofac[0] is true
.requireNationality('USA', 'GBR') // ISO 3166-1 alpha-3
.sybilLimit(0)
.build();
- An agent passes a credential check only if the human disclosed that credential when registering. Register with the matching verification config.
- The testnet demo agents (1, 5, 72) proved no age:
.requireAge(18)rejects them withAgent's human does not meet minimum age (required: 18, got: 0). requireOFAC()readsofac[0], which isfalsefor non-passport documents: see OFAC credentials.
Next
Thanks. What went wrong?
Thanks for your feedback!