Rightshold™ Sign up

Answers · agent controls

How do I revoke an AI agent's access immediately?

Last updated

TL;DR: Revoke at the source that issued each credential, starting with the ones that can mint new access: OAuth refresh tokens and grants, app installations, then personal access tokens and API keys. Then deal with what revocation doesn't stop. An OAuth access token that's already been issued can keep working until it expires if the service checks tokens locally: RFC 7009 warns that if a server doesn't support access-token revocation, access tokens aren't invalidated when their refresh token is revoked, and Microsoft Entra access tokens default to 60-90 minutes. Some revocations also leave side doors open, like SSH keys a GitHub token created. 'Immediately' really means: revoke everything the agent holds, block it in a layer you control while short-lived tokens expire, and confirm with a test call that it's locked out.

What should I check, step by step?

1. List everything the agent holds: OAuth grants (Google, GitHub, Slack, Microsoft), app installations, personal access tokens, API keys, SSH keys, cloud credentials, payment cards and any credentials it saved to disk or a secrets store.

  1. Revoke what can create new access first: refresh tokens and OAuth grants, app installations, then long-lived keys and tokens. A revoked access token is little use if a live refresh token can mint another.
  2. Use the issuing service's revocation, not just deleting the token on your side: Google's https://oauth2.googleapis.com/revoke, GitHub's app authorization and token endpoints or settings pages, Slack's auth.revoke, Microsoft Graph revokeSignInSessions.
  3. Cover the gap until short-lived tokens expire: block the agent in your own gateway, proxy or tool layer, where the decision takes effect on the next call.
  4. Look for side doors: SSH keys or deploy keys the agent added, webhooks it registered, new API keys it created, and scheduled jobs or second workers that will restart it with the same secrets.
  5. Stop the trigger too: disable the schedule, queue consumer or CI workflow that starts the agent, or it may start again with whatever credentials it still has.
  6. Test it: make a call with each old credential and confirm it's refused, then check the services' audit logs for activity after the revocation time.
  7. Write down what you revoked and when, so you can explain the timeline later and know exactly what to reissue if the agent goes back to work.

How revocation works at common providers (checked Oct 30, 2026)

Google: an app can POST the token to https://oauth2.googleapis.com/revoke; the token can be an access or refresh token, and revoking an access token that has a refresh token revokes the refresh token too. Google says revocation removes all scopes granted to the project, invalidating issued access and refresh tokens for all of its clients. Users can also remove an app's access in their Google Account settings.

Why revoked isn't always gone

RFC 7009 says the authorization server invalidates a revoked token immediately, but allows a propagation delay between servers, and that self-contained access tokens can be checked by a resource server without asking the authorization server. Those keep working until they expire.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “My agent is misbehaving. Revoke its Rightshold credential now so every Rightshold check refuses it, reason compromised_key.”

One-click setup

{
  "tool": "revoke_agent",
  "arguments": {
    "subject_id": "crd_YOUR_AGENT_CREDENTIAL",
    "reason": "compromised_key",
    "note": "token leaked in a log, revoking at Google and GitHub too"
  }
}

Rightshold can only refuse what your code asks Rightshold about. It can't revoke your Google, GitHub, Slack or Microsoft tokens, delete SSH keys or stop a process; revoke those at each provider.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'