Skip to content

Agent Privilege Scoping

Put your agents in a sandbox you define, without trading away the capabilities the use case needs.

Runs on

Tool call. Pattern rules over the whole result also run on tool response.

The idea

Allowing or forbidding a whole tool is a blunt instrument. A support agent needs to write files, and forbidding the tool costs the capability. Scoping keeps the tool and narrows what it may be called with, argument by argument: which paths it may write to, which commands it may run, which recipients it may reach, which amounts it may move.

The walls are drawn in policy and enforced on the call, not built around a runtime. Nothing has to be containerized and no agent has to be rewritten.

The rule

Each tool in a tool call configuration takes as many Pattern rules as you need:

Part What it is
Key The named argument the rule looks at, such as a path, a command or a recipient
Regex A regular expression the value has to match
Deny Blocks the call when the value matches and lets the rest pass

On a tool response configuration a pattern rule has no key: its regex covers the whole response, which is denied when it matches.

To exempt a value from the PII filter, use the PII filter's Allowlist. Pattern rules are deny rules only.

Least privilege

Least privilege has been the rule for service accounts for decades. It has been hard to apply to agents, because an agent decides at runtime what to call and with what. Scoping puts the boundary where the decision lands, on the call itself, so the principle holds for something that improvises.