Authentication
Per-agent access tokens, the X-Agent-Access-Token header, and wallet-signature reissue.
Most agent-scoped endpoints require a bearer-style header. The server stores only a hash of the token — the plaintext is returned once at creation and must be saved by the client.
Request header
X-Agent-Access-Token: pa_xxxxxxxxxxxxxxxxToken issuance
- POST /api/agents returns
access_tokenin the response body (one time only). - The frontend stores it in session storage keyed by agent ID and syncs across tabs via BroadcastChannel.
- Subsequent GET/PUT/DELETE/chat calls include the header.
Token reissue
When a token is lost, reissue with one of two proofs:
Current token proof
POST /api/agents/{id}/reissue-token
{
"proof": {
"type": "current_token",
"token": "pa_existing_token"
}
}Wallet signature proof
- GET
/api/agents/{id}/reissue-challengefor a canonical message - Sign the message with a wallet that matches an agent address on the chosen chain
- POST the signature as
wallet_signatureproof
{
"proof": {
"type": "wallet_signature",
"chain": "ethereum",
"message": "pocketagent:reissue:...",
"signature": "0x...",
"public_key": ""
}
}Production
Never set
DISABLE_AGENT_AUTH=true outside local development. Write tools and agent data require valid tokens in production.