Authorization: Bearer header — but scoped to one agent rather than the whole tenant.
For production agents, upgrade to Ed25519 sessions. Agent tokens are great for prototypes and simple deployments; Ed25519 gives you short-lived sessions, replay protection, and per-session revocation.
Token format
Obtain a token
When you create an agent, Sly returns a token as part of the response:Use the token
Exactly like an API key:RequestContext identifying the actor as this agent — so:
- Transfers default to this agent as the initiator
- Balances show this agent’s wallet
- Spending is enforced against this agent’s wallet policy and KYA tier limits
Rotate a token
agent_* token. The old token is invalidated immediately.
Revoke a token
Delete the agent or freeze it:When agent tokens are enough
- Prototyping and local dev — fastest path to a working agent
- Trusted environments — agent runs on your own server, not user machines
- Low-value scopes — read-only agents, monitoring agents, observability collectors
- Backwards compatibility — existing agents don’t need to migrate
When to upgrade to Ed25519 sessions
- Production — real money, real merchant traffic
- Agent runs on customer hardware — keypair never leaves the machine
- You need replay protection — sessions bound to nonces
- You need granular revocation — kill one session without rotating the token
- You want push events —
sess_*tokens unlock the persistent SSE channel
RequestContext.
Comparison with API keys
Agent tokens and API keys both send a long-lived secret in the header. The differences:Agent token (agent_*) | API key (pk_*) | |
|---|---|---|
| Actor | One specific agent | Whole tenant |
| Scope enforcement | Per-agent policy + KYA tier | Scope list + tenant |
| KYA tier applies | Yes | No |
| Wallet policy applies | Yes | No |
| Typical lifespan | Weeks-months, rotated per agent lifecycle | Months-years, rotated per security policy |
