100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
AI Guardrails & Safety Engineering
30 minadvanced

Least Privilege for Agent Capabilities

An agent given one API key with full account permissions because "it might need those tools eventually" turns every guardrail built in the previous five lessons into a single point of failure: get past the input filter, get past the classifier, get past the rule layer just once, and the blast radius is whatever that one key can do — which, if it was provisioned for convenience rather than for the task, is usually far more than the agent's actual job requires. Guardrails built so far in this course reduce the probability an attack succeeds; least privilege is the layer that limits the damage when one eventually does, and the two are not substitutes for each other.

Least privilege for agent capabilities means granting a tool, a scope, or a permission only for the specific action the agent's specific task actually requires, only for the duration that task requires it, and never as a standing, always-on capability "in case it's needed later." A refund-support agent gets a tool that can issue refunds up to a defined limit against a specific order — not a general-purpose payments API key that can also move money between accounts, change a customer's billing address, or export the entire transaction database, even though provisioning the narrower tool takes more upfront design work than handing over the broad one.

This lesson builds the three practices that make least privilege concrete rather than aspirational: capability scoping down to the specific action an agent needs, time-bounded and task-bounded credentials instead of standing access, and the blast-radius thinking that turns "how do we prevent every possible failure" into the more tractable "what is the worst thing this specific capability, if compromised, could actually do." The two lessons after this one — sandboxing and network egress control — are specific instances of exactly this principle applied to code execution and network access.

Analogy🏏Cricket
🏏 Think of it like cricket: a stadium's groundskeeping staff carry a master key that opens every gate on the property, and a franchise's security review after an incident at a different ground concluded that was the actual root cause of how an unauthorized person reached the pitch during a break in play — not a failure of the perimeter fencing, which held, but a single master key that had been handed to a contractor for one specific job months earlier and never revoked once that job ended. The fix the review recommended was not a better fence; it was reissuing access as narrow, task-specific keys — a groundskeeper gets a key to the equipment shed and the outfield gate, nothing more, and a contractor doing a one-day repair gets a key that is programmed to stop working at the end of that specific day, rather than a master key that happens to also open everything else on the property because provisioning individual keys for every specific job felt like more upfront effort. That narrow provisioning does not make every gate unbreachable on its own — it means that if any one key is lost, copied, or misused, the damage is bounded to exactly what that key could open, not the entire ground. The insight is that least privilege: it does not prevent every possible compromise, it bounds the damage a compromise can do to exactly the scope that specific credential was ever given, which is why the narrow key that takes more work to issue is worth issuing over the broad one that is easier to hand out.
Lesson 13 of 35
0% complete