1. Prefer a sandbox key
A sandbox key simulates the metered HTTP contract without creating balances, checkout sessions, reservations, or end users. Use it for automated tests whenever provider content and live Stripe behavior are not under test.2. Stop live activity
Before retiring a test end user:- Stop issuing new calls, tokens, and top-ups for that identity.
- Let in-flight calls finish or fail so their reservations settle.
- Let any Locus-hosted Checkout complete or expire.
- Deallocate the remaining end-user balance to the workspace pool.
409 END_USER_RETIREMENT_BLOCKED with the remaining public blockers. Resolve those conditions and retry; do not attempt to bypass the lifecycle through another endpoint.
3. Reset a policy without losing its journal
tokens:manage; a dashboard caller must be a workspace owner or admin. This policy reset does not itself require step-up, but retiring the end user does.
The reset refuses to run while a reservation still depends on the policy. It
removes only operational policy/counter rows and appends a RESET decision.
Historical decisions remain available at:
reset: false and does not append a second event.
4. Retire the test end user
- revokes active end-user JWT records;
- revokes scoped Agent Connection credentials bound to that end user;
- cancels outstanding MCP cost approvals;
- resets the active policy while preserving its audit events;
- freezes the credit account; and
- marks the identity inactive so minting a new token cannot reactivate it.