An AI agent with perfectly scoped credentials can still do serious damage if it is free to decide, chain and repeat actions with no limit, and a tightly supervised agent can still cause harm if the one token it holds is far too broad. Least privilege answers the first half of that problem: what an identity is allowed to access. Least agency, the term OWASP uses in its Top 10 for Agentic Applications, answers the second: how much autonomy an agent is given to choose and take actions. This guide sets the two principles side by side, maps them to OWASP Excessive Agency, works through one agent with both controls applied, and sets out approval thresholds and review metrics. It is written for security architects and AI platform teams deploying agents into production; for the detailed method of scoping tool credentials, see Least Privilege for AI Agent Tool Use.
Key takeaways
- Two different questions. Least privilege limits what an identity can reach; least agency limits how many tools, decisions, steps and resources an agent may use without a human or a policy stepping in.
- OWASP names both. OWASP LLM06:2025 Excessive Agency traces the risk to excessive functionality, excessive permissions and excessive autonomy; the agentic Top 10 leaders write that they "expand on the concepts of Least-Privilege and Excessive Agency by citing Least-Agency".
- Each control fails differently. Missing least privilege turns any agent mistake into a large blast radius; missing least agency lets a correctly scoped agent repeat, chain or escalate actions faster than anyone notices.
- Enforce outside the model. Scopes, tool allow-lists, approval gates and budgets must live in tokens, gateways and policy engines that a prompt cannot change.
- Tie approvals to consequence. Reversible, low-value actions run automatically; destructive, irreversible, high-value or privilege-changing actions need a human or a policy decision, every time.
Least privilege recap
NIST SP 800-53 Rev. 5 control AC-6 requires organisations to "employ the principle of least privilege, allowing only authorized accesses for users (or processes acting on behalf of users) that are necessary to accomplish assigned organizational tasks." For an agent, that means every credential it uses (an OAuth token, a workload identity, an API key, a database role) carries only the scopes, resources and duration the task needs. The enhancements that matter most for agents are AC-6(1) on authorising access to security functions, AC-6(5) on privileged accounts, AC-6(9) on logging use of privileged functions and AC-6(10) on stopping non-privileged identities from executing privileged functions.
Least privilege is static in a useful sense: it is written into policy before the agent runs, it applies whether the caller is a person, a script or a model, and it is reviewed through ordinary access governance. The broader techniques (just-in-time access, short-lived credentials, attribute-based policy) are covered in the Least Privilege Techniques Guide.
What least agency means
Agency is an agent's ability to decide which tools to call, in what order and how often, based on model output. OWASP LLM06:2025 defines Excessive Agency as "the vulnerability that enables damaging actions to be performed in response to unexpected, ambiguous or manipulated outputs from an LLM, regardless of what is causing the LLM to malfunction", and names three root causes:
- Excessive functionality: the agent can call tools or functions it does not need, such as a document connector that can also delete.
- Excessive permissions: the identity behind a tool can do more downstream than the task requires.
- Excessive autonomy: high-impact actions are not independently verified or approved.
The OWASP Top 10 for Agentic Applications for 2026 (published 9 December 2025) builds on this. Its leaders' letter introduces Least-Agency alongside least privilege and notes that deploying agentic behaviour where it is not needed expands the attack surface without adding value. Its first mitigation for ASI02 Tool Misuse and Exploitation is headed "Least Agency and Least Privilege for Tools". In practice, least agency means giving an agent the fewest tools, the narrowest functions, the shortest plans, the smallest budgets and the least independent authority that still let it complete the task, and asking whether the task needs an agent at all rather than a fixed workflow. OWASP released a 2026 edition of the Top 10 for LLM Applications in September 2026; a contributor quoted in the announcement describes Excessive Agency as now number three; this guide uses the 2025 identifier LLM06:2025, which remains widely referenced.
How the two principles differ
| Dimension | Least privilege | Least agency |
|---|---|---|
| Question answered | What can this identity access? | How much may this agent decide and do on its own? |
| Applies to | Every identity: human, workload, agent | Systems where a model selects or sequences actions |
| Unit of control | Scopes, roles, resources, credential lifetime | Tools exposed, functions per tool, steps, rate, spend, approval points, delegation |
| Typical controls | OAuth scopes, IAM policies, database roles, just-in-time access, token exchange | Tool allow-lists, parameter limits, approval gates, action and cost budgets, plan length limits, kill switch |
| Where enforced | Identity provider, resource server, cloud IAM | Agent gateway, tool server, policy engine, orchestration runtime |
| Failure mode | One wrong call reaches far more data or systems than intended | Many permitted calls are chained, repeated or escalated with no checkpoint |
| OWASP mapping | LLM06:2025 excessive permissions; ASI03 Identity and Privilege Abuse | LLM06:2025 excessive functionality and excessive autonomy; ASI02 Tool Misuse and Exploitation |
| Reviewed through | Access reviews, entitlement analytics | Agent design review, tool inventory, approval logs, budget breaches |
The principles overlap at the tool boundary. Removing a delete function from a tool reduces both agency (one less action to choose) and effective privilege (one less operation reachable). They still need separate owners: identity teams usually own scopes, while platform teams own the agent runtime where agency is set.
OWASP mitigations mapped to each principle
| LLM06:2025 mitigation | Principle it serves | Example control |
|---|---|---|
| Minimise extensions | Least agency | Expose only the three tools the task needs |
| Minimise extension functionality | Both | Read-only mailbox tool without send or delete |
| Avoid open-ended extensions | Least agency | A file-write tool instead of a shell tool |
| Minimise extension permissions | Least privilege | Database role with SELECT on one table |
| Execute extensions in the user's context | Least privilege | OAuth on-behalf-of token with the user's own scope |
| Require user approval | Least agency | Confirmation inside the tool before posting or paying |
| Complete mediation | Both | Downstream policy check on every request, not model judgement |
Applying both to an AI agent
Consider a customer service agent for an online retailer that answers order queries and issues refunds. The table shows the same agent designed twice.
| Control | Unconstrained design | Least privilege and least agency applied |
|---|---|---|
| Identity | Shared service account with admin on the order system | Dedicated agent identity; on-behalf-of token per customer session |
| Scopes | Read and write on all orders and customers | orders:read for the authenticated customer only; refunds:create limited to that customer's orders |
| Tools exposed | Twelve connector functions including customer delete and address change | Three: look up order, check refund eligibility, create refund |
| Parameter limits | Any amount, any order | Refund no greater than the order value, one refund per order |
| Autonomy | Agent decides and executes all refunds | Automatic up to a set value (for example £50); above it, a human approves from a summary showing order, amount and reason |
| Budgets | None | At most 20 tool calls and 3 refunds per session; daily refund total capped per agent |
| Delegation | Can call other agents and new tools it discovers | No agent-to-agent calls; tool list fixed and version controlled |
| Stop control | Restart the service | Kill switch that revokes the agent's tokens and disables the refund tool |
With only least privilege, a prompt-injected agent could still issue the maximum permitted refund on every order the customer owns, as fast as the API allows. With only least agency, the budget and approval controls would sit in front of a token able to refund any customer's order. Together, an attacker who fully controls the conversation can obtain at most the small automatic refunds the business already accepts, on one account, before a budget stops the session.
The cost of skipping both is visible in the PocketOS Database Deletion 2026 incident, where an AI coding agent used an account-scoped platform token found in an unrelated file and deleted a production database and its backups in a single call, with no approval step. A token scoped to one environment would have contained it (least privilege); an approval gate on destructive calls would have stopped it (least agency).
Controls: scopes, tool allow-lists, approvals, budgets
- Scopes: derive scopes from the task, issue short-lived tokens and narrow them at run time through OAuth token exchange or cloud session policies. Prefer acting in the user's context for user-facing agents. See AI Agent Service Accounts vs On-Behalf-Of Access and Delegation Chains and Attenuated Authority for AI Agents.
- Tool allow-lists: fix the tools per agent in version-controlled configuration, split broad connectors into narrow functions, and block open-ended tools such as shell or arbitrary URL fetch unless the task needs them. OWASP ASI05 advises keeping any auto-execution allow-list under version control. See Static Tool Allowlists vs Dynamic Tool Discovery for AI Agents.
- Approvals: enforce approvals in the tool or a downstream policy engine, show the approver the exact action and parameters, and bind the approval to that action so it cannot be reused. The Human-in-the-Loop for AI Agents Guide covers approver experience and fatigue.
- Budgets: cap tool calls, plan length, spend, records touched and wall-clock time per session and per day; a breached budget pauses the agent and alerts its owner rather than failing silently.
- Containment: provide a tested kill switch that revokes credentials and disables tools. See the AI Agent Kill Switch and Containment Guide.
Human-in-the-loop thresholds
OWASP's agentic guidance calls for human confirmation of high-impact or destructive actions (it gives delete, transfer and publish as examples) and human approval for high-privilege or irreversible actions, but it sets no numeric thresholds. Set your own per action class and record them in the agent's permission matrix.
| Tier | Action characteristics | Examples | Required control |
|---|---|---|---|
| 1. Automatic | Read-only or easily reversed, low value, own scope | Look up an order, draft a reply | Logged, within budget |
| 2. Policy approved | Reversible, value under a set limit, single record | Small refund, reopen a ticket | Policy engine check on parameters and budget |
| 3. Human approved | Above value limit, external communication, many records | Large refund, bulk email, publish content | Named approver per action, action-bound approval |
| 4. Human approved with separation of duties | Irreversible, destructive, privilege or security change | Delete data, change permissions, rotate or create credentials, move money between accounts | Two-person approval or not delegated to agents at all |
How to implement
- Inventory: list each agent, its owner, identities, tools, functions and the downstream systems each tool reaches. Record the result in the AI Agent Permission Matrix Template.
- Challenge the agency: for each task, ask whether a deterministic workflow would do. Remove tools and functions the task does not need.
- Scope the credentials: replace shared or standing credentials with per-agent, short-lived, task-scoped tokens.
- Classify actions into tiers and add approval and budget controls at the gateway or tool layer, starting in log-only mode to see how often each would trigger.
- Pilot with one agent: run enforcement for two to four weeks, tune thresholds where approvals are too frequent, and confirm that blocked actions fail safely.
- Roll out and keep a rollback: keep the previous tool list and policy version deployable; if a control breaks a business process, revert the policy version, not the identity scoping, and log the exception with an expiry.
- Govern: re-review agents when tools, models or prompts change, and include agents in quarterly access reviews.
Small teams can start with fixed tool lists, read-only defaults and approval on every write. Larger organisations need a central agent gateway or policy engine so tiers, budgets and approvals are consistent across teams.
Measuring and reviewing
- Granted against used: share of scopes and tools each agent used in the last 30 to 90 days; unused grants are candidates for removal.
- Tool surface: number of tools and functions exposed per agent, tracked release by release.
- Approval rate and outcome: approvals requested per 100 sessions and the share rejected; a near-100% approval rate suggests rubber-stamping or a threshold set too low.
- Budget breaches: sessions stopped by action, spend or plan-length budgets, and how many were genuine faults or attacks.
- Tier 4 exposure: count of agents able to perform irreversible or privilege-changing actions; target zero without separation of duties.
- Time to contain: time from alert to tokens revoked and tools disabled in kill-switch tests.
Log every tool call with agent identity, the human principal, parameters, policy decision and approver, as AC-6(9) expects for privileged functions, and send the logs to the SOC. See Agent Permission Drift for watching scopes creep over time.
Common failure patterns
- Instructions used as controls: "never delete production" in a system prompt limits nothing; only tokens, tools and policy do.
- Scoped token, unlimited loop: a correctly scoped agent repeats a permitted action thousands of times because no budget exists.
- Approval on the wrong layer: the model is asked to confirm with itself, or approval is a chat message the agent can satisfy.
- Connector defaults: a third-party tool exposes every function its API offers and the team never trims it.
- Credentials in the workspace: the agent finds a broader secret on disk and uses it, as in the incident above.
- Approval fatigue: thresholds so low that reviewers approve everything without reading.
Framework mapping
| Framework | Reference | Principle |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AC-6, AC-6(1), AC-6(5), AC-6(9), AC-6(10) | Least privilege, privileged function logging |
| NIST SP 800-53 Rev. 5 | AC-2 Account Management; AU-12 Audit Record Generation | Agent identity lifecycle and action logging |
| NIST CSF 2.0 | PR.AA-05 | Least privilege and separation of duties in authorisation policy |
| OWASP Top 10 for LLM Applications 2025 | LLM06:2025 Excessive Agency | Both principles |
| OWASP Top 10 for Agentic Applications 2026 | ASI02 Tool Misuse and Exploitation; ASI03 Identity and Privilege Abuse | Least agency; least privilege |
See the OWASP LLM Top 10 LLM06 Excessive Agency Guide, the OWASP Agentic Top 10 ASI02 Guide and the OWASP Agentic Top 10 ASI03 Guide for each risk in depth.
Practitioner checklist
- Record each agent's owner, identities, tools, functions and downstream systems in one permission matrix.
- Remove tools and functions the task does not need, and replace open-ended tools with narrow ones.
- Issue per-agent, short-lived, task-scoped credentials; act in the user's context where users are involved.
- Keep secrets out of agent workspaces so an agent cannot find broader credentials.
- Classify actions into tiers and enforce approvals outside the model, bound to the specific action.
- Set call, spend, record and plan-length budgets per session and per day.
- Deny irreversible and privilege-changing actions to agents unless two-person approval applies.
- Test the kill switch and measure time to contain.
- Review granted against used permissions and tool surface at least quarterly.
Standards and references
- OWASP GenAI Security Project: OWASP Top 10 for Agentic Applications for 2026
- OWASP GenAI Security Project: Top 10 for LLM Applications 2025 (LLM06:2025 Excessive Agency)
- OWASP GenAI Security Project: OWASP Top 10 for Agentic Applications announcement
- OWASP GenAI Security Project: 2026 Top 10 for LLM Applications announcement
- NIST: SP 800-53 Rev. 5 Security and Privacy Controls (AC-6 Least Privilege)
- NIST: Cybersecurity Framework 2.0
Related NHI Mgmt Group resources: Least Privilege for AI Agent Tool Use · Human-in-the-Loop for AI Agents Guide · Agentic AI Identity Guide · AI Agent Permission Matrix Template · OWASP LLM Top 10 LLM06 Excessive Agency Guide