TL;DR
- Least privilege means starting from no access and adding only what the job needs.
- A badge that opens one floor is the everyday version of the same rule.
- Risk grows when a temporary role stays on or a shared account hides who did what.
- For AI agents, a refused approval is the behavior you want to see in the logs.
Before you start: the RBAC explainer shows how roles get attached to accounts. This article is about picking the right roles.
Every account in a company can do something. A payroll clerk can open salary files. A build server can push code. An AI agent can send email. Least privilege is the rule that each of these gets the smallest set of permissions that still lets it do its job, and nothing more.
What least privilege means#
The US standards body NIST defines it as restricting access privileges to “the minimum necessary to accomplish assigned tasks”. The idea is older than most of the software you use. Saltzer and Schroeder described it in 1975, when one computer was shared by many people at once.
The principle does not name the right set of permissions for you. It tells you where to start: from nothing, then add only what the job needs. Each addition should have a reason you can write down.
Two things matter. The first is which permissions an account holds, such as read, write, approve or delete. The second is how long it holds them. A permission needed for one afternoon should not stay open for the rest of the year.
A badge that opens one floor#
Think of an office access badge. It opens the floor where your team sits, and only during working hours. It does not open the server room, the executive floor or the building next door. Nobody calls that unfair. It is simply what the badge is for.
Least privilege for an app is the same idea. A reporting tool that needs to read invoices should get a role that reads invoices. It should not get a role that can also issue refunds, just because the vendor sells the two together in one bundle.
What it looks like in practice#
Take an expense agent that reads receipts and drafts a monthly summary. It needs read access to the receipt folder and write access to one draft file. It does not need to approve payments.
If the agent gets the finance admin role “to keep things simple”, one bad instruction or one stolen token can move money. The narrow version is a role limited to one folder, with a separate person who presses the final approve button.
The sequence below shows the narrow version working. The agent can read, and the approval is refused.
The refusal is the useful part. If the logs show the agent asking for approval and getting a no, the control worked, and someone can review why the agent asked.
Where it goes wrong#
The most common mistake is the temporary admin role that never gets removed. Someone needed it for a migration, the migration ended, and the role stayed.
The second is the shared account. When five people log in as one service user, the logs say that “service” did something. You cannot tell which person did it, and you cannot remove one person’s access without breaking everyone else’s.
A third problem is that the role was right on the day it was granted and nobody checked it again. Access that made sense for a project stays after the project ends. That is why access reviews exist: every few months someone asks whether each permission is still needed.
Least privilege for AI agents#
An agent is only as safe as the permissions it was given. Microsoft’s security team put it plainly in October: least privilege reduces exposure but does not eliminate risk, because an agent that starts a task with the right access can still meet a prompt injection in a document it reads.
So least privilege is one layer, not the whole answer. It limits what a hijacked agent can reach. Approval steps, logs and fast revocation limit what happens next. For delegation between agents, the scopes explainer shows how a permission list is asked for and agreed to.
Where to go next#
- Roles, attributes and relationships: the three models a policy engine uses to decide who may do what.
- Scopes vs consent: what an app asks for, and what you actually agreed to.
- Secrets or federation: how a CI job proves who it is without a stored password.
- Infostealers now take AI agent tokens: what a stolen token can do when its role is too wide.
Sources#
This post as Markdown · RSS · JSON feed
New posts by email
One email a week with new posts and labs. Unsubscribe anytime.
Your address is stored with Kit, which sends the emails. Details