AI CompendiumA public chart of the language
Home / Tools & Environment / Least Privilege
Tools & Environment

Least Privilege

Give the agent the minimum access the task requires.

Definition

Scoping credentials, tools and permissions to exactly what the current task needs: a read-only token for a read-only job, one directory rather than the filesystem, an allowlisted network rather than open access.

It matters more for agents than for services because the instruction source is untrusted text. An agent that reads a web page can be talked into using whatever access it holds, so the size of its access is the size of the worst case.

The threat model it addresses is specific: an agent that reads untrusted content can be steered by it, so its access defines the blast radius of a successful injection. Scoping credentials is therefore a security control, not a tidiness preference.

How people use it
Provisioning an agent for an unattended run.
"It only needs to read, so give it a read-only token. If it gets injected, the injection inherits read-only too."
Worked example

Splitting one powerful agent into two narrow ones

A workflow needs to read external documents and write to an internal system.

Have the reader with network access produce a structured summary, then a separate writer with database access consume only that summary and never the raw documents. Neither agent alone can both be injected and act on it.

Avoid

Reusing a human’s credentials for an agent because it is quicker. The agent has no judgement about scope, and the audit trail becomes uninterpretable.

Sources
  • standardLLM01: Prompt injection ↗OWASP Gen AI Security Project · 2025

    Defines direct versus indirect injection and the downstream effects — data disclosure, unauthorised tool use, command execution — with least privilege and human approval as the recommended controls.

  • docsComputer use tool ↗Claude platform docs · 2026

    Screenshot, mouse and keyboard as a tool loop, with the safeguards that belong around it: isolated environments, minimal privileges, network limits, human confirmation.

  • docsConfigure permissions ↗Claude Code docs · 2026

    Allow, ask and deny rules for edits, shell commands and other tools: what a permission mode looks like when it is written down.

Related terms