What Least Privilege Means for AI Agent Tool Calls
Least privilege for an AI agent means the agent can only invoke the specific tools, actions, and parameters required for its current task, and nothing more. A Rego policy expresses this by starting from a deny-by-default posture and adding narrow, explicit allow rules rather than broad role-based grants.
Modeling Agent Identity and Task Context as Policy Input
Rather than treating an agent as a single opaque caller, the policy input should separate agent identity, the agent's assigned role, and the task context that triggered the request. Keeping these as distinct fields lets a policy reason about who is acting, what they are permitted to do in general, and what the current task actually requires, rather than collapsing all three into one blunt permission check.
Structuring the Rego Policy
A workable structure starts with a default deny rule, followed by allow rules scoped to a specific tool