New Your team’s decisions, in one playbook every coding agent works from. Never answer your agent twice

What is the Principle of Least Privilege?

2 min read Updated

The principle of least privilege states that every entity (user, agent, process) should have only the minimum permissions necessary to perform its intended function — and nothing more. For AI agents, this means access to only the MCP tools and arguments required for the specific task.

WHY IT MATTERS

Least privilege is the single most important security principle for AI agent tool access. An agent that only needs to read files should not have shell execution access. An agent that only queries a database should not have write permissions. An agent that only needs to search the web should not have filesystem access.

The principle has three dimensions for agents: scope (which tools can it invoke?), constraint (what arguments can it pass?), and time (for how long?). Each should be minimised. A policy that allows only read_file and list_directory, restricts file paths to the project directory, and is rate-limited to 60 calls per minute — that is least privilege in action.

The challenge is finding the right minimum. Too restrictive and the agent cannot function. Too permissive and a compromise causes maximum damage. Start restrictive and expand based on observed needs — it is easier to add permissions than to recover from excessive ones.

Every tool call decision logged, every policy versioned — the audit trail this page describes, by default.

GOVERN YOUR MCP SERVERS →

Enforced before the call runs. Nothing to install.

HOW POLICYLAYER USES THIS

PolicyLayer enforces least privilege for MCP tool access through its deny-by-default policy model. A grant with no policy denies every call, and the recommended default-deny starting point denies every tool until it is explicitly allowed. Operators allow only the tools the agent needs, with argument conditions limiting how those tools can be used. This inverts the default — instead of an agent having access to everything and trying to restrict it, the agent has access to nothing and must be granted specific capabilities.

FREQUENTLY ASKED QUESTIONS

How do you determine 'least privilege' for an agent?
Start by defining the agent's specific tasks. Identify which MCP tools are needed for each task. Allow only those tools, with the most restrictive argument constraints that still permit the task. Review PolicyLayer's audit logs to see which tools are actually being used and adjust accordingly.
Does least privilege hurt agent performance?
Minimally. An agent with correctly scoped tool access performs identically to one with broad access — it just cannot invoke tools outside its scope. If an agent frequently hits denied tool calls, the policy may need adjustment, not removal.
How does PolicyLayer's fail-closed default enforce least privilege?
A grant with no policy denies every call, and the recommended default-deny policy denies every tool that is not explicitly allowed. This means agents start with zero privileges and are granted only what they need — the definition of least privilege.

FURTHER READING

// THE REGISTRY

Every MCP server your agents touch has a registry record.

Type a name, get the breakdown: verified identity, auth posture, risk grade, every tool classified, recommended policy. Re-checked continuously.

Teams ship this data inside their own products. See what a licence covers →

Take your agents live. Without losing control.

Route your MCP traffic through PolicyLayer. Every tool call is checked against your policy before it runs: allow, deny, or require approval. Per-identity grants. Full audit log. Live in minutes.

Instant setup, no code required.

46,500+ MCP servers and 515,000+ tools scanned and risk-classified.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.