Troubleshooting
Match the symptom or code an agent, key or MCP client gets, then apply the fix.
Every refusal has a code. Find it in the response (code, or detail.code), the CLI line (denied: / hint:), or Activity. In a terminal, tvault explain <CODE> prints what it means and how to fix it.
The order Token Vault checks
The first failing check answers. A request refused at "Grant" never reaches your policies.
Symptom, code, fix
| Symptom / code | Status | Cause | Fix |
|---|---|---|---|
MISSING_KEY | 401 | No agent key sent | Send Authorization: Bearer tvagent_... (or tvkey_...). Never ?key= |
INVALID_KEY | 401 or 403 | Key revoked, rotated or unknown. A tvkey_ or stale scoped agent key gets 401; an unknown classic tvagent_ gets 403 | Rotate or recreate. CLI exit 12 |
KEY_EXPIRED | 401 | The key passed its expiry | Create a new key. CLI exit 10 |
KEY_SUSPENDED | 403 | The key is suspended | Resume it. CLI exit 11 |
AGENT_INACTIVE | 403 | Agent is suspended | Resume the agent. CLI exit 11 |
VAULT_LOCKED | 423 | You pressed Stop all access | Resume access. CLI exit 5 |
SCOPE_DENIED | 403 | The key lacks a scope; body has missingScope | Create a key with that scope. CLI exit 8 |
NO_GRANT | 404 | This agent or key was never granted this credential, or the name is wrong | Give access (Access); check the name |
GRANT_EXPIRED | 403 | It was granted, and the grant ended. Activity says when and for how long | Grant again with a later expiry |
GRANT_TOOLS_ONLY | 403 | The grant is MCP only: it can call the credential's MCP servers but not read the value | Edit access, add Value; or use the tools |
GRANT_USES_EXCEEDED / GRANT_SERVERS_EXCEEDED | 403 | A key tried to hand out more than it holds | Grant from a holder with the access, or as you |
POLICY_DENIED | 403 | A rule said no; policy and rule name it | See below |
POLICY_DENIED with Retry-After | 429 | A rate_limit rule | Wait retryAfter seconds or raise the limit |
JSON-RPC -32029 | 429 | Rate limit or policy rate limit on an MCP call | Wait data.retryAfter |
RATE_LIMITED | 429 | Token Vault's own limit, not your policy | Slow down. See rate limits |
WEB_CONSOLE_REQUIRED | 403 | An access-channel rule makes this change web-app-only | Do it in the web app |
HUMAN_ONLY | 403 | Only a person may do this | Do it signed in. CLI exit 9 |
SCOPE_NOT_DELEGABLE | 403 | You tried to put a human-only scope on a key or agent | Do it signed in as a person. CLI exit 1 |
REAUTH_REQUIRED | 401 | The action needs a sign-in within 5 minutes | Sign in again, retry. CLI exit 2 |
IDENTITY_ONLY_SESSION | 403 | An identity-only pass, such as the one a Token Vault sign-in MCP server receives, proves who is calling and nothing else; it cannot fetch credentials or call Token Vault | Use the client's own OAuth session or an agent key |
MCP_SERVER_NOT_FOUND | 404 | No such MCP server on that credential | Check {service}/{server} |
WEBHOOK_NOT_CONFIGURED | 502 | No webhook bound | Finish setup |
WEBHOOK_UNAVAILABLE | 502 | Webhook unreachable | See below |
WEBHOOK_AUTH_FAILED | 502 | Webhook rejected Token Vault's signed request (secret out of sync) | Re-bind |
WEBHOOK_REDIRECT_BLOCKED | 502 | Webhook answered with a redirect | Remove the redirect in front of it |
WEBHOOK_CIRCUIT_OPEN | 503 | Webhook failed repeatedly; calls are paused | Fix the webhook. Wait for Retry-After |
| CLI exit 3 | n/a | The CLI cannot reach the API or your webhook | Check your network and the webhook URL |
NO_GRANT versus GRANT_EXPIRED
Token Vault does tell them apart. NO_GRANT (404) means no grant exists for that holder and name. GRANT_EXPIRED (403) means one did, and it ended. The Activity sentence says: "cursor's access to github ended 2 days ago (granted for 24 hours)."
NO_GRANT is never a penalty-box strike, because typos and stale configs are common. Repeated misses have their own cap of 10 per minute per agent.
A value grant made in the UI defaults to 24 hours. MCP-only grants default to no expiry.
POLICY_DENIED
- Read
policyandrulein the response. - Open Activity and filter
outcome=denied. The drawer says in plain words which policy, where it is attached (agent, key, credential, label or MCP server) and gives a fix button. - Fix the rule, or detach:
tvault policy detach <policyId> --label ai.
The agent's own body leaves out policyId, appliedVia and ruleSettings. Only you see them.
Needs your approval
A policy with manual_approval denies everything, because approvals cannot be asked for yet. Detach or delete it.
Rate limited
Policy rate_limit denials send retryAfter and Retry-After (1 to 900 s). Token Vault's own limits (RATE_LIMITED, penalty box) also send Retry-After. The penalty box starts at 1 second after repeated denials, doubles each strike, and caps at 15 minutes. The tvault CLI makes up to 3 attempts at a GET (2 retries) when the wait is 10 seconds or less; otherwise it exits 7.
Webhook unreachable
- Settings > Webhook > Health shows endpoint health. Run its tests.
- Open
https://<your-webhook>/v1/healthin a browser. - If it is down, fix or redeploy it. Token Vault resumes calling it by itself.
- If you changed the secret or redeployed without your
TV_WEBHOOK_SEED, re-bind.
MCP client keeps asking to sign in
MCP sessions (tvsess_, refresh tvrefresh_) end when something they depend on changes: changing the webhook URL revokes every session, and suspending the agent ends that agent's sessions. The next call gets 401 invalid_token or 400 invalid_grant. The client re-runs OAuth: reconnect and press Authorize. Sessions are listed on the agent page.
MCP access is not enabled for this agent
An older agent can carry a stored "MCP off" setting, and MCP calls from it are refused with this message. Press Turn MCP on on the agent's Connect tab, or send PATCH /api/agents/{id} with {"mcpEnabled": true}. See Connecting apps.
Agent stopped
REST calls get 403 AGENT_INACTIVE, MCP refresh gets 400 invalid_grant. Press Resume on the agent page. Stop still works while all access is stopped.