Policy reference
The policy document, field by field, from schema/policy.schema.json — the one schema the Python package publishes (agent-shield policy schema prints it), the TypeScript types are generated from, and IAM validates an organization's document against.
Built: every field below is read by agent_shield.policy and decided on (Agent Shield policy). Not built: nothing of this page is pending; a field that is not here is not a field.
The document
One policy document, one scope.
| Field | Type | Required | What it says |
|---|---|---|---|
authorize | list of read | write | send | buy | delete | execute | no | The classes that need an authorizer's allow beside the Rules: a deny wins over any Rule, an unreachable authorizer is a deny. Empty needs none (local-only); Datalayer's documents name read, write, execute, send and buy. |
authorizer | AuthorizerConfig or null | no | The decision point a standalone Shield asks: local (grants in this file), openfga {url, store, model}, authzen {url}, opa {url, package} or cedar {policies}. On Datalayer the authorizer is IAM's and a managed document names none. |
dogwood | Dogwood or null | no | A Dogwood policy set deciding every classed action over the session's history (AgentCore Policy's language): a deny wins over any Rule, as the authorizer's does; an allow only lets the Rules decide. |
expires | string or null | no | When a pulled copy stops being honoured. |
firewall | FirewallCeiling or null | no | The organization's ceiling on its agents' firewall rules (policy.shield): the most any agent may be granted, egress and ingress, '' allowing ''. An organization document's alone. |
harnesses | Harnesses | no | |
limits | Limits | no | |
mcp | Mcp | no | |
network | Network | no | |
rate_limits | RateLimits or null | no | Per user, across tools, models and agents: the requests, tokens and connections each person may spend per second or per minute through the organization's AgentCore Gateways, pushed to them as Gateway rate limits. An organization document's alone. |
rules | list of Rule | no | |
scope | organization | team | session | yes | |
version | integer | no |
AuthZenAuthorizerConfig
| Field | Type | Required | What it says |
|---|---|---|---|
headers | object | no | |
url | string | yes |
AuthorizerConfig
authorizer: in a policy document: exactly one decision point (standalone).
| Field | Type | Required | What it says |
|---|---|---|---|
authzen | AuthZenAuthorizerConfig or null | no | |
cedar | CedarAuthorizerConfig or null | no | |
local | LocalAuthorizerConfig or null | no | |
opa | OpaAuthorizerConfig or null | no | |
openfga | OpenFgaAuthorizerConfig or null | no |
CedarAuthorizerConfig
cedar: {policies}: a Cedar policy set inline, or the path of a .cedar file.
| Field | Type | Required | What it says |
|---|---|---|---|
policies | string | yes | A Cedar policy set, inline, or the path of a .cedar file. |
Dogwood
A Dogwood policy set (Cedar, and when temporal over the session's events).
Read as it is loaded: the temporal clauses parsed, AgentCore's quotas held
(20 temporal policies, 3 temporal operators in one, a 24-hour window at
most) and, when cedarpy is installed, the Cedar parsed too.
| Field | Type | Required | What it says |
|---|---|---|---|
mode | enforce | log_only | no | enforce: what the set denies is refused; log_only: decided and recorded, then let through. |
policies | string | yes | The policy set, as AgentCore Policy takes it: permit and forbid over Datalayer::User principals, Datalayer::Action::"<server>___<tool>" actions and the Datalayer::Runtime resource, with when temporal { formerly within | since within | count | sum } over the session's request, response and error events. Deny by default; a forbid overrides any permit. |
FirewallCeiling
An organization's firewall: the most any of its agents may be granted.
The same grammar as :class:FirewallRules. A direction left out (None)
bounds nothing; an empty egress list grants nothing beyond the base layer,
an empty ingress list nothing beyond platform. * allows *.
:func:agent_shield.firewall.bounds.bounded holds an agent's rules to it.
| Field | Type | Required | What it says |
|---|---|---|---|
egress | list of string or null | no | The most an agent's egress may be: '' (any public address) alone, or ':port' (any public address on that port), exact hosts, host:port, IPv4 addresses, CIDRs, each with an optional :port. Left out bounds nothing; empty grants nothing beyond the platform's endpoints. |
ingress | list of string or null | no | The most an agent's ingress may be: '*', or addresses and CIDRs with an optional :port. 'platform' is always kept. Left out bounds nothing; empty keeps 'platform' only. |
Grant
One line of the local authorizer: who may do what to what, as patterns (fnmatch).
| Field | Type | Required | What it says |
|---|---|---|---|
object | string | yes | workspace:/src/, tool:earthdata/*, connection:acme.example |
relation | string | yes | can_read, can_execute, can_call, can_act, or an action class |
subject | string | yes | user:alice, account:*, deployment:01… |
Harnesses
The harnesses an organization admits, and whose credentials run them.
| Field | Type | Required | What it says |
|---|---|---|---|
admit | list of string | no | Harness ids of the catalogue this scope admits; empty admits every registered harness. |
credentials | account | platform | either | no | Whose key runs a harness: the account's own declared secret, the platform's, or either. |
Limits
The stateful limits of a session.
Three count the harness's actions; two count what its model costs: the model budget in tokens and the spend in credits (the deployment's spend limit; 100 credits are one USD). Each has a soft threshold, where the next call asks the person, and a hard one, where each further call is refused and the sentence says what would let it go on.
| Field | Type | Required | What it says |
|---|---|---|---|
bytes_written | Threshold or null | no | Bytes written to the workspace. |
model_tokens | Threshold or null | no | The model budget: tokens the session's model requests spend, in and out. |
spend | Threshold or null | no | The spend limit: credits the session spends on models (100 credits a USD). |
terminals_open | Threshold or null | no | Terminals open at once. |
tool_calls | Threshold or null | no | Classed actions per session. |
LocalAuthorizerConfig
| Field | Type | Required | What it says |
|---|---|---|---|
grants | list of Grant | no |
Mcp
The MCP servers the agent is lent, by name; everything else is cut from session/new.
| Field | Type | Required | What it says |
|---|---|---|---|
allow | list of string | no |
Network
What the agent may reach over the network, through the Shield.
| Field | Type | Required | What it says |
|---|---|---|---|
fetch | list of string | no | Hosts a fetch may reach (exact host, or *.example.com); empty refuses every fetch. |
OpaAuthorizerConfig
| Field | Type | Required | What it says |
|---|---|---|---|
headers | object | no | |
package | string | no | The Rego package answering decision and context. |
url | string | yes | OPA's address: http://opa:8181 |
OpenFgaAuthorizerConfig
| Field | Type | Required | What it says |
|---|---|---|---|
model | string or null | no | |
store | string | yes | |
url | string | yes |
Rate
A rate: at most rate per per.
| Field | Type | Required | What it says |
|---|---|---|---|
per | second | minute | yes | second or minute. |
rate | number | yes | How many, at most, in each period. |
RateLimits
What each person may spend through the organization's AgentCore Gateways.
Per user — the Gateway's OAuth subject, or its IAM principal — across its tools, models and agents, as AgentCore's Gateway rate limits count them. The Shield does not count these in process: they are pushed to the Gateways of an organization that runs on AgentCore.
| Field | Type | Required | What it says |
|---|---|---|---|
connections | Rate or null | no | Connections a person holds open to a Gateway. |
requests | Rate or null | no | Requests a person makes through a Gateway. |
tokens | Rate or null | no | Tokens a person's requests process. |
Rule
One line of a policy: what it matches and what it decides.
| Field | Type | Required | What it says |
|---|---|---|---|
classes | list of read | write | send | buy | delete | execute | no | The classes the rule names; empty names every class. |
commands | list of string | no | Regular expressions on the whole command line; any matches. |
decision | allow | ask | deny | yes | |
kinds | list of read | edit | delete | move | search | execute | think | fetch | switch_mode | other | no | The ACP tool kinds the rule names; empty names every kind. |
name | string | yes | A short name; every sentence quotes it. |
paths | list of string | no | Globs on the path relative to the workspace (fnmatch); any matches. |
reason | string or null | no | Why; shown in the sentence. |
where | inside | outside | any | no | inside: only a path inside the workspace; outside: only one outside; any: both, and actions with no path. |
Threshold
A soft threshold asks once; a hard one refuses each call that would cross it.
| Field | Type | Required | What it says |
|---|---|---|---|
hard | integer | yes | |
soft | integer | yes |
The classes and the kinds
Every action is classed as one of read, write, send, buy, delete, execute; ACP's tool kinds are read, edit, delete, move, search, execute, think, fetch, switch_mode, other, and other fails closed to write.
Soft and hard limits
A Threshold has a soft count, where the next call asks the person once, and a hard count, where each further call is refused and the sentence says what would let the session go on. The limits are stateful per session; the strictest scope's decides first.