How to Revoke an AI Agent's Access to a Customer Data MCP Server Mid-Session
Revoke at more than one layer. Revoking the token or credential stops future authentication, but an agent holding a valid or cached token may keep calling tools. Add a policy enforcement point in the execution path that checks every tool call against current entitlements, so a revocation decision blocks the agent's next call even while its token is still valid. Define how in-flight calls behave, and record the decision and the calls allowed and blocked on either side of it.
A revocation flow that blocks subsequent calls
- 1
1. Detect and decide
A trigger such as anomaly detection, a policy violation, or an entitlement change reaches the decision point, which selects a response: token revocation, session termination, access restriction, or step-up approval.
- 2
2. Update entitlement state
Mark the agent identity or session as revoked in the store the enforcement point reads, and stamp the decision with a policy version and time.
- 3
3. Block at the enforcement point
Every subsequent tool call for that identity or session is denied, regardless of token validity. Other sessions continue unchanged.
- 4
4. Revoke credentials
Revoke the access token and any refresh token, and stop issuing new ones to that identity, so the block does not depend on one layer.
- 5
5. Handle in-flight calls
Apply the behavior you defined for calls already started, and record each one as completed, aborted, or rejected.
- 6
6. Confirm and test
Issue a test call from the revoked identity, confirm it is denied, and measure the time from decision to first blocked call.
Why credential-only revocation leaves a gap
A customer data MCP server exposes tools that read or change records. An agent connected to it usually holds a token and some session state. When something goes wrong, such as prompt injection, scope creep or a withdrawn entitlement, the security team wants the next tool call to fail. Token revocation does not guarantee that.
NIST digital identity guidance notes that an OAuth access token, and any associated refresh tokens, may remain valid long after the authentication session has ended. It also says the presence of a token should not be read as the presence of the subscriber without other signals. A cached token, or a resource that never checks revocation state, can keep working after the decision has been made.
NIST IR 8587 adds two qualifications. It recommends that access and identity tokens be valid for no more than one hour, which limits the window but does not close it. It also says revocation has to operate together with compromise detection to be effective. Revocation is a response action, not a detection capability.
A NIST post on agent identity makes the agent case directly: without runtime verification, an agent operating under a valid token cannot be interrupted if it is hijacked or manipulated mid-task.
Comparing the three revocation points
Each layer has a different strength and a different failure mode. Treat the speed of each as something to measure in your own environment rather than assume. Actual latency depends on token lifetime, caching, and how quickly updates reach the component that enforces them.
- Credential layer: Strength: removes the agent's ability to obtain or refresh access, and short-lived, task-scoped tokens shrink the exposure window. Limit: an unexpired or cached token can outlive the decision unless the resource checks revocation state.
- MCP server: Strength: the server is closest to the data and can refuse a call based on entitlement or session state. Limit: it depends on each server implementing the check, and behavior differs between servers.
- Policy enforcement point in the execution path: Strength: evaluates every tool call against current entitlements, so revocation takes effect on the next call even with a valid token. Limit: it only governs traffic that passes through it, and it needs fast distribution of decisions.
Enforcing policy on each tool call
Zero trust architecture separates the decision from the enforcement. A policy decision point determines whether a session should continue, be limited, or be revoked. A policy enforcement point carries that out by denying requests made on an active session or by disconnecting it. NIST IR 8587 describes a similar pattern as advanced authorization: authorization updates are pushed rapidly to enforcement points at the protected resource, which can terminate sessions tied to compromised tokens without direct token revocation.
For MCP, this means placing an enforcement point between the agent and the server so that each tool invocation is evaluated against current state, not state captured at session start. The outcome does not have to be binary. A call can be allowed, redacted, blocked, or escalated to a human approver when a risk threshold is crossed. Decisions should be deterministic, since NIST describes deterministic capabilities as the primary mechanism for access decisions in agentic scenarios.
Isolation depends on identity. If each agent has a unique, traceable identity and policy is scoped to that identity or session, revoking one agent does not touch other sessions or users. Delegation matters too. NIST describes authority attenuating as it passes to sub-agents and downstream services, so decide in advance whether revoking a parent also ends its children, and encode that rule rather than leaving it implicit.
Designing for in-flight calls and evidence
NIST SP 800-53 notes that revocation rules can differ by type of access. If a subject is removed from a group, access may not be revoked until the next time an object is opened or the next time the subject attempts access. Apply the same reasoning to agents: a decision made while a tool call is executing may not affect that call. Decide what your design does in that case. Options include letting short read calls finish while blocking everything after them, holding or rejecting calls that write or return sensitive records, and requiring approval for anything ambiguous. Whichever you choose, document the intended timing and test it, because the behavior is a property of your architecture rather than of the token.
Treat evidence as a design requirement, not an afterthought. A reviewer will want to reconstruct what the agent was permitted to do and what it did. A practical record includes the trigger, the decision and who or what made it, the policy version in force, timestamps for the decision and for the first blocked call, and the tool calls allowed and blocked before and after, with the outcome of each in-flight call. These fields are a design recommendation. Generating them at the point of enforcement keeps the record consistent with what was actually enforced.
Where Trussed fits
Trussed enforces policy in the execution path across models, agents, tools and MCP servers, at the level of individual interactions and tool calls. Outcomes include allow, redact, block, rate limit, and escalate for human approval. That is the enforcement point described above: revocation is enforced at runtime, not reviewed after the fact, and does not depend on a token expiring.
Enforcement produces audit-ready evidence as it happens, mapped to frameworks including NIST. Trussed can be self-managed in the customer cloud, with configurable retention and data residency, which matters when evidence about customer data access has to stay within a regulated enterprise's boundary. Credential revocation and server-side checks remain your responsibility and should stay in place as complementary layers.
Three places to cut access mid-session
Credential layer
Short-lived, audience-specific tokens and token revocation.
MCP server
The server checks entitlement or session state before serving a call.
Policy enforcement point
Every tool call is evaluated in the execution path against current entitlements.
See per-call enforcement and evidence for MCP traffic
Walk through how policy is enforced on agent tool calls and what audit-ready evidence a revocation produces.
See How Evidence Is ProducedHow does your AI governance program compare?
See where your program has gaps in less than 2 minutes.