Least privilege is the principle that an actor should have only the permissions required to do its job, and no more. It is one of the oldest ideas in security and one of the least consistently applied. For AI agents, it is also the control that most directly determines how much damage a manipulated agent can do.

Why agents break the usual approach

Least privilege is normally implemented at provisioning time. An administrator decides what a user or service account needs, assigns roles, and reviews them occasionally. That works well enough when the actor’s behavior is predictable. An agent’s behavior is decided at runtime by a model reading untrusted content, so the permission it needs for a given task is narrower than the union of everything it might ever do, and any permission it holds but does not need is available to an attacker who manipulates it.

Three things make this provisioning-time model fail for agents:

1) Tasks vary. The same coding agent might need read access to one repository today and write access to another tomorrow. Granting the union up front is over-privilege; granting nothing is useless.

2) Authority is delegated. The agent should never exceed what its owner is entitled to. If the owner’s role changes, the agent’s ceiling should change with it, immediately.

3) Scale. A single over-privileged human is a relatively bounded risk. A fleet of over-privileged agents running continuously is not.

Least privilege per action

The alternative is to enforce least privilege at the moment of each action rather than at provisioning. Every tool call the agent makes is checked, by a system outside the agent’s own reasoning, against a policy that answers: is this specific action within the scope of the task this agent was assigned, by an owner who is still entitled to it? If yes, the call proceeds with a credential scoped to that action. If no, it is refused.

This changes the shape of permission from a standing grant to a ceiling plus a per-call decision:

1) Ceiling: The maximum an agent could ever be allowed, derived from its owner’s entitlements in the identity provider. No policy can grant beyond it.

2) Task scope: The subset of the ceiling that the current task requires, defined when the task is assigned. A ticket-triage agent has read on tickets and write on comments, not administrative access to the ticketing system.

3) Per-call check: Each request is evaluated against the task scope, with the actual parameters of the call, so that “delete repository” is refused even if “read repository” is allowed.

What per-call decisions require:

A place to enforce. The check has to happen somewhere the agent cannot bypass, typically a gateway in the call path between the agent and its targets.

Scopes that map to real actions. Coarse scopes (“full access to GitHub”) defeat the purpose. Useful scopes name the operation and the resource.

Credentials that match the scope. If the credential injected into the call carries more authority than the policy allowed, the policy is ineffective. Short-lived, action-scoped credentials issued per call close that gap.

Revocation that is immediate. When a task ends or an owner is disabled, the agent’s ability to act should end at the same moment, not at the next token expiry.

Least privilege per action does not make an agent harder to manipulate. It limits what a manipulated agent can do, which is what really matters.

Next Article: What is Platform Attestation for AI Agents?