Skip to content

Error reference ​

Every response a wall can return, and what to do about it.

Status codes ​

CodeReasonWhat it meansWhat to do
200—You passedNothing
400malformed envelope / bad encoding / oversized nonceYour envelope is unparseable or has an invalid fieldFix the envelope; check field order and types
401invalid request signature / cert: not signed by rootThe envelope is well-formed but the signatures don't verifyRe-sign with the correct keys
402authorization requiredNo header, and you look like an un-enrolled agentEnroll, get a key
402spend key requiredIdentity without a capabilityGet a scoped spend key for this site
402payment_requiredThe site has a price and you haven't paidSettle the x402 challenge
403audience does not match this siteYour capability is scoped to a different siteGet a capability for this site

Common verify() errors ​

The wall's verifier returns a specific reason string. These map to the codes above:

text
invalid root pub
malformed envelope
cert: bad encoding / bad pub / not signed by root
request agent does not match certificate
request nonce exceeds safe integer range
bad request signature encoding
invalid request signature
request timestamp too old / in the future
spend key required
cap: unknown version / no actions / unknown action
cap: empty audience / unknown verification_mode
cap: bad signature encoding / not signed by root
cap: online verification required (revocation + reservation not available)
cap: issued in the future / expired
cap: offline capability requires an expiry
cap: audience does not match request site
cap: holder does not match request agent
cap: request exceeds budget

Reading the response ​

The wall returns JSON with a human-readable reason:

json
{
  "error": "authorization_required",
  "reason": "spend key required",
  "site_id": "example.com",
  "suggestion": "This site is protected by MotherShy. Get a key for your agent at https://mothershy.com/access?site=example.com"
}

The X-MotherShy-Wall response header also carries the reason, so you can branch on it without parsing JSON.

One gotcha: the Cloudflare bot block ​

If you're testing against a *.workers.dev URL and get a 403, that may be Cloudflare's bot-block rejecting your client's User-Agent before the wall ever runs — not a wall verdict. Use curl or a browser-like User-Agent against direct/DNS-only walls to avoid this.

Next ​

MotherShy — the economic operating layer for AI agents and publishers.