Guide/governance3 min read

How to Revoke an AI Agent's Access Instantly

How to revoke an AI agent's access instantly: suspend the agent profile or revoke an MCP session so the governance gateway denies all further tool calls.

Read the docs →

/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
/governance /governance /governance /governance /governance /governance /governance /governance /governance /governance
Guide/governance
TL;DR
  • Revoking an AI agent means cutting off its ability to act immediately, without redeploying or rotating your workspace key.
  • On Naïve, agentProfile.revoke() suspends the profile; the governance gateway denies all further tool calls.
  • Revoke is absolute applies mid-action, cascades to sub-agents, releases runtime slots.
  • For narrower scope, sessions.revoke() kills one MCP connection without suspending the whole profile.
  • Surfaces: SDK, REST, CLI, and MCP tools.
  • Wire revoke into offboarding, incident response, and customer churn flows before you need it under pressure.

Revoking an AI agent's access means every further action is denied — immediately, without redeploying your app or rotating your workspace API key. On Naïve, revoke is a first-class operation on the governed agent profile: suspend the profile and the governance gateway blocks all subsequent tool calls.

This guide covers agent-profile revoke (full stop) and session revoke (single connection). For spend caps and approval before things go wrong, see spend caps, approvals & revocation for AI agents.

When do you revoke?

  • Customer offboarding — their agent must stop now, not at end of billing period.
  • Suspected compromise — prompt injection, anomalous tool pattern, unknown runtime.
  • Runaway loop — agent retrying a failing call faster than caps can help.
  • Policy violation — customer tier changed; agent should lose capabilities immediately.

Revoke is the off switch. Approval is the pause button; caps are the volume knob.

Step 1 — Identify what to revoke

TargetScopeUse when
Agent profileEntire bundle — identity, money, comms, runtimeAgent itself is untrusted
MCP sessionOne MCP connectionOne runtime leaked; profile stays active

Most incident responses use agent profile revoke. Session revoke is for surgical cuts — see delegated MCP sessions.

Step 2 — Revoke the agent profile (SDK)

const op = await naive.forUser(tenant.id).provision("support", { idempotencyKey: `op:${tenant.id}` });
// … later, when you need to stop everything:
await op.revoke();

Revoke is absolute. The governance gateway denies all further tool calls, releases the runtime slot, rotates credentials, and cascades to sub-agents. Revoking a parent profile kills the whole multi-agent system.

Step 3 — Revoke via REST / CLI / MCP

REST:

curl -X POST "https://api.usenaive.ai/v1/agent-profiles/{id}/revoke" \
  -H "Authorization: Bearer nv_sk_your_key"

CLI:

naive agent profiles revoke <profile-id>

MCP tool: naive_revoke_agent_profile — useful when your ops agent itself runs over MCP.

See agent profiles docs for the full surface table.

Step 4 — Revoke a session (optional, narrower)

await naive.forUser(alice.id).sessions.revoke(sessionId);

The MCP client gets rejected on the next call. Other sessions and the agent profile keep working.

Step 5 — Verify access is cut

Attempt a tool call on the revoked profile — expect 403 forbidden from the gateway, not a provider error. List pending approvals; new actions should not start. If hosted runtime was running, confirm the slot released.

How do you know it worked?

  • Tool call after revoke → structured denial, logged.
  • MCP session after sessions.revoke → connection rejected.
  • Workspace key and other tenants → unaffected.
  • Re-provision requires a new profile (revoked profiles don't silently reactivate).

Wire revoke before you need it

The mistake teams make is treating revoke as an incident-only script. Put it in:

  • Offboarding webhooks — customer deleted → revoke their agent profile.
  • Admin UI — one button, not a runbook with twelve steps.
  • Automated guardrails — optional: revoke when hard budget exceeded N times in M minutes.

Revoke under pressure is only reliable if you've practiced the one-liner when calm.

Where to go next

That's instant revoke: profile for full stop, session for one connection. The architecture is in the governance gateway docs; the lifecycle context is the governed agent profile.

Frequently Asked Questions
How do you revoke an AI agent's access instantly?+
Call agentProfile.revoke() on the profile (SDK), POST /v1/agent-profiles/:id/revoke (REST), naive agent profiles revoke (CLI), or naive_revoke_agent_profile (MCP). Revoke suspends the profile — the governance gateway denies all subsequent tool calls, releases its runtime slot, and cascades to sub-agents. Revoke is absolute and applies mid-action.
What happens after you revoke an agent profile?+
Every regulated tool call returns forbidden. The card is frozen, sends halt, credentials rotate, and hosted runtime is torn down. Sub-agent profiles under a revoked parent are also stopped. The profile enters revoked status — it does not silently degrade to read-only.
Can you revoke just one session without killing the agent?+
Yes. sessions.revoke invalidates one MCP session immediately while the agent profile stays active. Use this when a single runtime connection is compromised; use agentProfile.revoke when the whole agent must stop.
Do you need to rotate API keys to revoke an agent?+
No. Revoke is scoped to the agent profile or session — your workspace key and other tenants are unaffected. Rotating the workspace key is the blunt instrument; revoke is the surgical one.
When should you revoke vs pause vs cap?+
Caps limit volume; approval pauses high-stakes actions until a human decides; revoke stops everything. Revoke when the agent itself is untrusted — offboarding, suspected injection, runaway loop — not when a single action needs review.
NT
Naïve Team

Building the agent-native backend.

Keep reading