# Least privilege explained: give each account only the access its job needs

> Least privilege means every user, app and agent gets only the access its job needs. A plain guide with a badge analogy, one example and what to check.

- URL: https://iamops.dev/least-privilege-explained/
- Language: en
- Author: Argo
- Published: 2026-12-06
- Category: Knowledge
- Depth: Explainer
- Audience: Security leaders and architects
- Time: 5 min
- Topics: least privilege, access control, basics

## TL;DR

- [Least privilege](https://iamops.dev/least-privilege-explained/#what-least-privilege-means) means starting from no access and adding only what the job needs.
- A [badge that opens one floor](https://iamops.dev/least-privilege-explained/#a-badge-that-opens-one-floor) is the everyday version of the same rule.
- Risk grows when a [temporary role stays on](https://iamops.dev/least-privilege-explained/#where-it-goes-wrong) or a shared account hides who did what.
- For AI agents, a [refused approval](https://iamops.dev/least-privilege-explained/#what-it-looks-like-in-practice) is the behavior you want to see in the logs.

**Audience: Beginners.** Anyone who gives a new colleague, a script or an AI tool access to a system and wonders how much to hand over.

**Before you start:** the [<abbr title="role-based access control">RBAC</abbr> explainer](https://iamops.dev/rbac-abac-rebac-explained/) 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 <abbr title="National Institute of Standards and Technology">NIST</abbr> 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.

![Sequence diagram: an expense agent reads receipts, asks to approve a payment, and the app refuses because the role has no approve permission.](https://iamops.dev/img/least-privilege-explained.svg)

*Read yes, approve no. The refusal is the control doing its job.*

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](https://iamops.dev/scopes-vs-consent-explained/) shows how a permission list is asked for and agreed to.

## Where to go next

- [Roles, attributes and relationships](https://iamops.dev/rbac-abac-rebac-explained/): the three models a policy engine uses to decide who may do what.
- [Scopes vs consent](https://iamops.dev/scopes-vs-consent-explained/): what an app asks for, and what you actually agreed to.
- [Secrets or federation](https://iamops.dev/secrets-vs-federated-credentials/): how a <abbr title="continuous integration">CI</abbr> job proves who it is without a stored password.
- [Infostealers now take AI agent tokens](https://iamops.dev/infostealer-identities-ai-agents/): what a stolen token can do when its role is too wide.

## Sources

- [NIST glossary: least privilege](https://csrc.nist.gov/glossary/term/least_privilege)
- [Basic Principles of Information Protection (Saltzer and Schroeder)](https://web.mit.edu/Saltzer/www/publications/protection/Basic.html)
- [Microsoft Security blog: Agents are your newest insiders (19 October 2026)](https://www.microsoft.com/en-us/security/blog/2026/10/19/agents-are-your-newest-insiders-security-must-move-at-their-speed/)

Discuss: [X](https://x.com/iamopsdev) | [LinkedIn](https://www.linkedin.com/company/iamops-dev/)
