Skip to content

Start typing to search the documentation.

Verification patterns

On this page

Every pattern ends in the same check: the agent is verified when hasHumanProof && isProofFresh on the registry.

PatternThe agentThe verifier
Agent-to-serviceSigns HTTP requestsRecovers the signer and checks the registry (SelfAgentVerifier)
Agent-to-agentSigns requests and responsesBoth sides verify each other, and can check for a shared human
Agent-to-chainCalls a contract as msg.senderThe contract reads the registry
LookupShares its agent ID or addressReads 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 ──────────────────────────│
  1. The agent calls agent.fetch(), which adds the signature headers.
  2. The service runs verifier.auth() (Express) or verifier.verify() on the raw body.
  3. 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 (or getInfo().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 verify or freshness intent
  • 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:

LimitWhereValue
Registry capmaxAgentsPerHuman on the registry10 on Celo Mainnet, 0 (no cap) on Celo Sepolia
Your service’s cap.sybilLimit(n) / MCP max_agents_per_humanDefault 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:

PolicyBuilder
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 with Agent's human does not meet minimum age (required: 18, got: 0).
  • requireOFAC() reads ofac[0], which is false for non-passport documents: see OFAC credentials.

Next

Was this page helpful?