What is least privilege?
Every tool an agent holds is something it can be tricked or mistaken into using. An assistant that only needs to read a web page has no reason to also hold the power to send email.
Least privilege means offering the smallest set of tools and the narrowest access that the job in hand requires: read-only where possible, one folder rather than the whole disk, one customer's data rather than everyone's.
It does not stop an attack from fooling the model. It makes the fooled model harmless, which is a promise that can actually be kept.
Why does least privilege matter?
An assistant will, at some point, be mistaken or manipulated. What happens next depends on what it was able to do. If its key can only read, the worst outcome is a wrong answer. If its key can delete, the worst outcome is deletion. Giving each part only the powers its job needs sets a ceiling on any failure.
How does least privilege work?
- List exactly what the assistant needs to do its job.
- Create a key or account that allows those things and nothing else.
- Give separate parts separate keys, each as narrow as its own task.
- Widen a permission only when there is evidence it is needed and safe.
When should you use least privilege?
Use it when
- Granting an assistant access to any system
- Designing tools: prefer several narrow ones to one that can do everything
- Connecting to systems you do not control
Think twice when
- There is no real downside. The only cost is a little setup
Where does least privilege sit in a real system?
It is applied where access is granted: the database user, the API key, the file permissions, the sandbox. It is enforced by those systems, which is what makes it hold even when the model misbehaves.
What goes wrong with least privilege?
- Using an administrator's key because it was convenient.
- Asking the model to respect limits that the key does not enforce.
- Granting write access early, before any record shows it is needed.
What does least privilege look like in practice?
A code reviewer needs to read code and post comments. Its key allows exactly that. When a pull request contains a line telling it to approve the change, nothing happens, because the key cannot approve anything.