Definition
What is Principle of least privilege?
Principle of least privilege is the principle of least privilege says a person, program or AI agent should get only the minimum access it needs to do its job, so a mistake or a hijack can do limited damage.
Least privilege is a security rule with a simple shape: give every user, program and AI agent the smallest set of permissions that still lets it do its job, and nothing more. NIST's glossary describes it as a design principle where each entity gets only the minimum system resources and authorizations it needs for its function.
Why agents make it urgent
A chatbot that only answers questions can say something wrong. An AI agent can act: read your files, send email, call APIs, spend money. When it gets something wrong, or when someone tricks it with a prompt injection, the damage is bounded by what it was allowed to touch.
Think of a house key. You give the dog walker a key to the front door, not the safe, and not a copy they can hand to someone else. If the key is lost, the loss is small.
What it looks like in practice
For an agent, least privilege usually means a handful of habits:
- Narrow files. Give access to one folder, not the whole disk.
- Narrow network. Let it reach only the sites the task needs, ideally inside an agent sandbox.
- Narrow credentials. Use a scoped API key or short-lived access token instead of your own login, and keep it in proper secrets management.
- Read before write. Start with read-only access and add write access only when a task proves it needs it.
- Ask first. Require human-in-the-loop approval for actions that are hard to undo, such as deleting, paying or sending.
- Time limits. Permissions that expire after the task are safer than ones that last forever.
Why people skip it
It is faster to click "allow everything" than to work out what a tool needs. Permissions also tend to grow: a tool is given broad access for one job and keeps it. Least privilege asks you to review that access on a schedule, and to remove what is no longer used.
How it relates to neighboring ideas
Least privilege limits what an agent can do. Guardrails limit what it will do. An AI kill switch lets you stop it. You want all three, because each covers a failure the others miss.
It also cuts data exfiltration risk: an agent that cannot read a secret cannot leak it.
The test
Ask one question about every permission an agent holds: if this agent were hijacked today, what is the worst thing this access allows? If the answer is worse than the task deserves, narrow it.
Questions people ask
What is the principle of least privilege?
It is the security rule that each user, program or AI agent gets only the minimum access it needs to do its function, no more.
How do I apply least privilege to an AI agent?
Limit its files, network and credentials to what the task needs, start read-only, use scoped short-lived keys, and require human approval for actions that are hard to undo.