Least privilege
The security principle that each user, program or agent gets only the access it needs for its task, and nothing more.
NIST defines it as restricting "the access privileges of users (or processes acting on behalf of users) to the minimum necessary to accomplish assigned tasks". The idea is old; agents make it urgent. An agent decides its own steps, and anything it reads can try to steer it (prompt injectionPrompt injection: Input that makes a language model ignore or change the instructions its application gave it, so it does something the application did not intend.). You cannot fully control what it will try, so you control what it can do. OWASP calls the opposite excessive agencyExcessive agency: OWASP's name for an LLM application that can take damaging actions because it has more functions, permissions or autonomy than its task needs.: too many tools, too broad permissions, or too much autonomy.
What it means for an agent
- Tools. Offer only the tools the task needs. A research agent does not need
delete_filebecause the file server happens to offer it. - Arguments. A tool can be safe for one argument and dangerous for another, such as
queryon the reporting database versus production. - Credentials. Give each server its own scoped credential, and act as the user where possible, not as a shared admin account. The OWASP MCP cheat sheet says to "never share tokens across servers".
- Autonomy. Put a personHuman in the loop: A design in which a person can see, approve, change or stop an AI system's action before it takes effect, instead of the system acting alone. before actions that cannot be undone.
Example
A triage agent reads tickets and posts comments. It gets read_ticket and add_comment from the tracker server, not close_ticket or delete_project, and runs with a token scoped to one project. A malicious ticket that says "close every ticket in the project" then has nothing to call.
Common confusion
Least privilege is not a one-time setting. Agents gain tools as servers update, so the useful question is "what did this agent actually use?", asked again over time.
In L2M
All optional: MCP tool policy allows, denies or requires approval per role, server, tool and argument; No write tools blocks every write tool in a workflow; gateway toolsetsToolset: A named, curated group of tools, drawn from several MCP servers and workflows, served at one MCP endpoint so each client sees only the tools it needs. give each client its own tool list. Least privilege from real runs suggests rules from the calls agents really made.
Further reading
- NIST CSRC glossary: least privilege (nist.gov)
- OWASP LLM06:2025 Excessive Agency (owasp.org)
- OWASP MCP Security Cheat Sheet (owasp.org)