Token VaultDocs
Policies and Activity

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

Loading diagram...

The first failing check answers. A request refused at "Grant" never reaches your policies.

Symptom, code, fix

Symptom / codeStatusCauseFix
MISSING_KEY401No agent key sentSend Authorization: Bearer tvagent_... (or tvkey_...). Never ?key=
INVALID_KEY401 or 403Key revoked, rotated or unknown. A tvkey_ or stale scoped agent key gets 401; an unknown classic tvagent_ gets 403Rotate or recreate. CLI exit 12
KEY_EXPIRED401The key passed its expiryCreate a new key. CLI exit 10
KEY_SUSPENDED403The key is suspendedResume it. CLI exit 11
AGENT_INACTIVE403Agent is suspendedResume the agent. CLI exit 11
VAULT_LOCKED423You pressed Stop all accessResume access. CLI exit 5
SCOPE_DENIED403The key lacks a scope; body has missingScopeCreate a key with that scope. CLI exit 8
NO_GRANT404This agent or key was never granted this credential, or the name is wrongGive access (Access); check the name
GRANT_EXPIRED403It was granted, and the grant ended. Activity says when and for how longGrant again with a later expiry
GRANT_TOOLS_ONLY403The grant is MCP only: it can call the credential's MCP servers but not read the valueEdit access, add Value; or use the tools
GRANT_USES_EXCEEDED / GRANT_SERVERS_EXCEEDED403A key tried to hand out more than it holdsGrant from a holder with the access, or as you
POLICY_DENIED403A rule said no; policy and rule name itSee below
POLICY_DENIED with Retry-After429A rate_limit ruleWait retryAfter seconds or raise the limit
JSON-RPC -32029429Rate limit or policy rate limit on an MCP callWait data.retryAfter
RATE_LIMITED429Token Vault's own limit, not your policySlow down. See rate limits
WEB_CONSOLE_REQUIRED403An access-channel rule makes this change web-app-onlyDo it in the web app
HUMAN_ONLY403Only a person may do thisDo it signed in. CLI exit 9
SCOPE_NOT_DELEGABLE403You tried to put a human-only scope on a key or agentDo it signed in as a person. CLI exit 1
REAUTH_REQUIRED401The action needs a sign-in within 5 minutesSign in again, retry. CLI exit 2
IDENTITY_ONLY_SESSION403An 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 VaultUse the client's own OAuth session or an agent key
MCP_SERVER_NOT_FOUND404No such MCP server on that credentialCheck {service}/{server}
WEBHOOK_NOT_CONFIGURED502No webhook boundFinish setup
WEBHOOK_UNAVAILABLE502Webhook unreachableSee below
WEBHOOK_AUTH_FAILED502Webhook rejected Token Vault's signed request (secret out of sync)Re-bind
WEBHOOK_REDIRECT_BLOCKED502Webhook answered with a redirectRemove the redirect in front of it
WEBHOOK_CIRCUIT_OPEN503Webhook failed repeatedly; calls are pausedFix the webhook. Wait for Retry-After
CLI exit 3n/aThe CLI cannot reach the API or your webhookCheck 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

  1. Read policy and rule in the response.
  2. 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.
  3. 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

  1. Settings > Webhook > Health shows endpoint health. Run its tests.
  2. Open https://<your-webhook>/v1/health in a browser.
  3. If it is down, fix or redeploy it. Token Vault resumes calling it by itself.
  4. 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.

On this page