Least privilege for AI agents: how to scope and enforce

An AI agent gets a token that expires and stays authorized to change everything. The clock works. Least privilege does not. To investigate safely, the grant has to limit reads by task and by resource. To write, a separate decision has to authorize the concrete action, with the target and the parameters checked at the destination.
A short expiry narrows the exposure window. It does not change the power granted inside that window. In RFC 6749, section 3.3, the authorization server may grant a scope other than the one requested, and it must tell the client about the difference. A request, then, is not proof of effective access.
Separating investigation from change is an architecture choice, not something the standards guarantee on their own. The procedure below starts from an approved policy and adds one condition: the approval travels with the plan to the point that executes the write. If that point can be bypassed, the approval becomes a ceremony with nothing controlling it.
Prerequisites for least privilege for AI agents
Least privilege for AI agents starts before the token is issued. An authenticated identity, a resource owner and an approved policy all have to exist first. The boundary has to stop deviations. Without it, the recorded rule does not control the operation, and a tool inventory grants no authorization to execute anything.
The platform team identifies the read and write operations the resource exposes, the environment where they will be used, and the point where the policy is enforced. The resource owner defines which data is reachable and who approves a write. The trusted issuer receives only requests that fit inside that limit. When the API does not support enough granularity, the team has to restrict access somewhere else or keep the task on hold.
The verifiable sequence is:
- Define identity and scope per task.
- Issue a short-lived token for reads.
- Validate the resource and the operation before the read.
- Bind the write approval to the plan.
- Execute, log and close the grant.
A policy on paper does not replace a refusal at the destination.
Step 1: define identity and scope per task
The AI agent identity names the workload; scope per task limits what that execution may ask for. The identity can stay the same across different tasks without requiring a durable secret or giving every task the same access. Authentication is not authorization.
Start from the AI agent permissions and traceability matrix that is already approved. For each execution, record subject, owner, task identifier, resource, environment, operation and end condition. The record has to answer who requested the read and who answers for the resource, without depending on the description the agent produced.
The matrix sets the ceiling, not the effective token. A persistent identity can request read access to an authorized resource in one task and receive a different limit in a separate execution. The issuer checks policy before granting access; the team has to verify that the destination can distinguish the resource, the environment and the data the task needs.
If the destination offers only one permission that is too broad, renaming the scope does not narrow access. The fix needs a point that actually filters the operation, or an integration with compatible permissions. Without either, the write stays blocked or held by local policy.
Step 2: issue a short-lived token for reads
A short-lived token for reads by an AI agent has to reflect the authorized limit, not just carry an expiry date. The grant combines a trusted issuer, an allowed resource, the effective scope and a renewal condition. Duration depends on policy and implementation. The sources impose no universal lifetime.
Identity is the recognized subject; proof of identity is the material presented to authenticate it. A static credential can serve as proof when the authentication method and the policy in force accept it; the access token represents a grant presented to the resource. Credential management per agent organizes how AI agent credentials are used, but identification alone does not decide what a task may read.
| Criterion | Static key | Short-lived token |
|---|---|---|
| Grant | The limit depends on the policy tied to the key | The limit depends on the policy and on what was issued |
| Duration | Usable for as long as the key is accepted | Valid for a limited period, set at issuance and validation |
| Exposure | A key obtained can be used while it is accepted | A bearer token obtained can be used during its validity |
| Revocation | Depends on the mechanism of the implementation | Depends on the issuer, the destination and the format |
| Destination-side check | Confirm the identity and the authorization attached to it | Confirm validity, audience and the authorization granted |
A static key does not necessarily mean broad permission. A short-lived token does not necessarily mean narrow permission. The comparison that matters is between the powers the destination actually accepts, not between the names of the artifacts.
RFC 8693, section 2.1 describes one option for token exchange; it does not require every system to use that flow. The issuer applies its policy, and the response can report the validity period. The team has to record the renewal criterion and store the token somewhere appropriate, without publishing it in examples or logs.
Step 3: validate the resource and the operation before the read
A resource must accept a read by an AI agent only after validating the credential and the authorization granted for that operation. Asking for a resource does not prove the token was issued for it; asking for a scope per task does not prove that scope was granted. Verification belongs to the destination.
The decision point checks trusted issuer, integrity and format according to the profile in use, validity, audience or equivalent, and permission for the operation. It also checks whether resource, environment and data match the authorized task. Preserving caller identity across components lets the decision be tied to the execution, but it does not replace the decision.
The resource parameter is a request to the issuer; the audience representation the destination accepts depends on the mapping the issuer performs under the profile and implementation in force. RFC 8707, section 2 recommends restricting the audience to the indicated resources, without turning that recommendation into a universal rule for every OAuth system. Its section 2.2 also covers combining resources and scopes in the request.
An opaque token does not oblige the destination to read JWT fields; in that case, the destination uses the validation mechanism the issuer provides and applies its own policy. If a JWT includes aud, RFC 7519, section 4.1.3 requires rejection when the recipient is not in the audience. If it includes exp, section 4.1.4 states that the JWT must not be accepted at the instant of expiration or after it, allowing a small tolerance for clock differences. Both fields are optional in the generic JWT; a specific profile may require them.
Step 4: bind the write approval to the plan
Write approval for AI agents has to apply to a defined action, not to an intention the model drafted. The plan identifies subject, task, resource, environment, operation, target, parameters, a verifiable version and validity. An authorized person approves that object, and the executor compares it with the action it receives.
The plan also records why the change is being made, the limits that apply and the identity of the approver, so that the authorized person decides on a specific operation and not on a generic intention. A verifiable version or digest makes changes in the content detectable; presenting a sentence as "approved" is not enough. If the target or any parameter changes, the old plan stops authorizing that action. The new plan goes back to the approver.
Governance outside the model is only effective when another route cannot ignore the control. At the moment of the action, the executor checks subject, task, resource, environment, target, operation, parameters, version and validity again. Divergence or an expired window means refusal.
The recommendation is to consume the authorization for an action atomically, with shared state across replicas. Simultaneous requests cannot receive independent authorizations for the same action. A signature or an identifier inside the token, on its own, does not guarantee that consumption and does not prevent replay.
Step 5: execute, log and close the grant
A write by an AI agent gets a separate grant only after a valid approval, and it still has to pass validation at the destination. Closing the task stops new issuance or renewal according to policy. That does not automatically invalidate tokens that were already issued. Expiry or revocation does not undo a completed write either.
The executor logs agent, task and plan identifiers, plus resource, operation, decision, approver, validity and result. The trail has to stay protected and tied to the action, without holding token content, keys or sensitive data that has no justification. A logging failure must not be disguised as proven execution.
Discovery in the tool catalog and discovery layer settles where to find the operation. It does not release the write. Access stays conditioned on the policy and the approved plan, even when the tool already appears in the agent catalog.
After a timeout or a failure that follows dispatch, the result is unknown, not necessarily rejected. While the result stays unknown, the trail has to preserve that condition, because no response does not confirm that the destination refused the write, nor that a new attempt will be safe. Before retrying, the team queries the destination or reconciles the operation through an idempotent identifier. Without destination support there is no exactly-once promise: an automatic retry could duplicate an effect that was already applied.
At the end, the team confirms the residual window of every token issued and the support for early revocation. An effective revocation makes the destination stop accepting that token, but on its own it does not stop an agent still running from attempting another write or obtaining a new credential. The destination must refuse requests without valid authorization and log the attempts; the team has to control resumption and check propagation delay, cache and derived tokens in each integration.
RFC 8693, section 2.1 does not establish automatic propagation of revocation in an exchange: invalidating the original credential does not demonstrate that the derived tokens were invalidated. A grant issued while the original token was valid can stay valid until its own expiry. Whether it does depends on the implementation and on any early revocation. If the issuer is unavailable, the policy has to define whether the read waits or is denied, without reaching for a broad credential as a shortcut.
How to verify that least privilege works
Least privilege is only demonstrated when the authorized operation works and operations outside the policy are refused at the execution point. The team has to test the AI agent identity in an authorized environment, with test data, and store decision and result without exposing real credentials.
| Test input | Expected result | Evidence |
|---|---|---|
| Read allowed for the task | Read accepted inside the granted limit | Decision, resource and operation logged |
| Write before approval | Write denied | Refusal at the execution point |
| Wrong resource or audience | Read or write denied | Reason for refusal and destination logged |
| Expired token | Operation denied | Validity check and decision |
| Plan changed after approval | Write denied | Approved version and mismatch logged |
| Second attempt, including a concurrent one | No second write authorized | Shared consumption state and decisions |
| Renewal after closure | New grant denied | Closed state and issuer response |
The table describes expected results, not tests that were run. The deviation still needs testing. The team has to include a failure after dispatch and keep the result unknown in the record until the query to the destination or the reconciliation clarifies the effect. The test verifies the alternative route, not just the path that goes through the planned control.
The evidence has to tie each refusal to the task and to the plan, so that an authorization failure can be told apart from a network failure. If the destination offers neither an idempotent identifier nor a sufficient query, record that limitation before releasing a retry. The concurrency test has to reach the replicas that share the consumption state.
Common mistakes when limiting permissions
A mistake when limiting AI agent permissions is confusing a control that is present with a control that works. The token expires, the approval exists and the log shows up, and none of them necessarily prevents an action outside the plan if the execution point does not enforce the policy. The team must test the refusal where the policy is applied.
A short-lived token with broad scope permits the excess operation until it stops being accepted. Shortening the lifetime does not fix the scope: adjust the effective grant and prove that the destination rejects the unauthorized operation. If the destination does not distinguish the operations, the limitation has to exist before it, or the write has to be held.
A generic or reusable approval fails when the target changes or when concurrent calls pass the same acceptance. Bind the approval to the parameters and to the plan version; consume the authorization atomically across replicas. Identifying the agent also does not replace checking whether it is authorized for that operation.
Revocation does not guarantee a cascade. The team checks the residual validity of derived tokens and the real revocation capability at the issuer and at the destination. Logging a secret to make diagnosis easier creates another exposure; log identifiers and decisions, not credential content. If the issuer goes down, the wait-or-deny policy has to be defined before the failure.
Frequently asked questions
AI agent credentials need limits that can be verified at the destination: a short lifetime on its own neither prevents misuse nor replaces the separation between reads and writes. Approval bound to the plan and revocation of derived tokens require confirmation in the integration, even when the product already offers general permissions.
Does a short-lived token prevent misuse?
No. A bearer token used by an AI agent can be used by anyone else who obtains it while it is accepted, inside the powers it grants. Duration limits exposure, but it does not fix broad scope and does not guarantee single use. Validation and a revocation policy remain necessary.
Can the agent investigate without write access?
Yes, when the resource and the policy can grant the AI agent only the read operations the task needs. The agent identity still has to be authenticated, and the destination has to verify the grant. If the integration does not separate reads from writes, that limit is not demonstrated.
Does write approval hold after the target changes?
Not in the design recommended for AI agents. The approval stays tied to the target, the parameters and the verifiable version of the plan; a change requires a new plan and a new decision from the authorized person. The executor has to compare those attributes at the moment of the action and refuse any mismatch.
What happens to a derived token when the original is revoked?
Revoking the original token of an AI agent does not, on its own, imply revocation of the derived token. RFC 8693, section 2.1 does not guarantee that propagation. In each integration, the team checks the residual window and early revocation, according to the issuer and the destination implementation.
References and Further Reading
The standards cited define parts of authorization and validation for AI agents, but they do not prescribe the full write approval flow and do not guarantee that an implementation offers the proposed controls. That flow is a recommendation. Policy per task, atomic consumption and reconciliation after failure all require verification in the implementation.
- RFC 6749, section 3.3: requested scope, granted scope and the difference reported in the response.
- RFC 8693, section 2.1 and section 2.2.1: token exchange, request parameters and response; the exchange does not establish automatic propagation of revocation.
- RFC 8707, sections 2 and 2.2: resource indication, the recommendation to restrict the audience and the combination of resources and scopes.
The rules of one format are not the rules of every format. The profile and the implementation have to define what the destination actually validates.
- RFC 7519, section 4.1.3 and section 4.1.4: handling of audience and expiration when those fields are present in a JWT.
- OpenID Connect Core, section 2: the ID Token describes end-user authentication; it is not a synonym for an API access token and does not prove workload federation.
- NIST SP 800-207: no implicit trust from location or asset ownership, and the distinction between authentication and authorization.
What the buyer should ask for at the next evaluation
A useful demonstration of write approval for AI agents shows a refusal, not just an acceptance screen. The buyer should ask for tests of target change after approval, simultaneous calls, an expired token and renewal after closure, with logs and a policy for an unknown result after dispatch.
Ask also for the residual token window and the revocation mechanism in each integration. Nexforce Agents designs and implements agents for B2B operations, and Nexforce Work offers an approvals and permissions layer. That does not prove these controls. The demonstration has to show whether they exist and where they are enforced.

Deploy Work and Code Agentswith zero software licensing costs
Automate operational tasks and code writing autonomously with dedicated agents integrated into your systems
Free TrialRelated articles

Buyer agents: what does your software need to expose?
The Universal Commerce Protocol, published on January 11, 2026, gives agents a standardized path to catalog, cart and checkout, and Vercel made Vercel Shop generally available on October 16, 2026. For a B2B ISV, exposing the offer as data requires deciding the ceiling, the allowed catalog and the term before switching checkout on.
Read more
Evals in CI: the gate that passes the pull request and fails in production
An eval gate in the pull request only catches an agent regression when the filter sits at the job level, the provider is pinned, the threshold was measured against the noise of the measurement itself and the test set cannot be loosened by whoever wants the merge.
Read more
A million agent skills in seven months, almost half installed once
The State of agent skills report, from Vercel, records 1 million skills and nearly 280 million installs in seven months, with almost half of the catalogue installed a single time. The corporate reading is that an install measures supply, and an agent's result depends on review, permission and maintenance.
Read more