Skip to main content

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.

FieldTypeRequiredWhat it says
authorizelist of read | write | send | buy | delete | executenoThe 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.
authorizerAuthorizerConfig or nullnoThe 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.
dogwoodDogwood or nullnoA 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.
expiresstring or nullnoWhen a pulled copy stops being honoured.
firewallFirewallCeiling or nullnoThe 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.
harnessesHarnessesno
limitsLimitsno
mcpMcpno
networkNetworkno
rate_limitsRateLimits or nullnoPer 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.
ruleslist of Ruleno
scopeorganization | team | sessionyes
versionintegerno

AuthZenAuthorizerConfig​

FieldTypeRequiredWhat it says
headersobjectno
urlstringyes

AuthorizerConfig​

authorizer: in a policy document: exactly one decision point (standalone).

FieldTypeRequiredWhat it says
authzenAuthZenAuthorizerConfig or nullno
cedarCedarAuthorizerConfig or nullno
localLocalAuthorizerConfig or nullno
opaOpaAuthorizerConfig or nullno
openfgaOpenFgaAuthorizerConfig or nullno

CedarAuthorizerConfig​

cedar: {policies}: a Cedar policy set inline, or the path of a .cedar file.

FieldTypeRequiredWhat it says
policiesstringyesA 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.

FieldTypeRequiredWhat it says
modeenforce | log_onlynoenforce: what the set denies is refused; log_only: decided and recorded, then let through.
policiesstringyesThe 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.

FieldTypeRequiredWhat it says
egresslist of string or nullnoThe 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.
ingresslist of string or nullnoThe 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).

FieldTypeRequiredWhat it says
objectstringyesworkspace:/src/, tool:earthdata/*, connection:acme.example
relationstringyescan_read, can_execute, can_call, can_act, or an action class
subjectstringyesuser:alice, account:*, deployment:01…

Harnesses​

The harnesses an organization admits, and whose credentials run them.

FieldTypeRequiredWhat it says
admitlist of stringnoHarness ids of the catalogue this scope admits; empty admits every registered harness.
credentialsaccount | platform | eithernoWhose 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.

FieldTypeRequiredWhat it says
bytes_writtenThreshold or nullnoBytes written to the workspace.
model_tokensThreshold or nullnoThe model budget: tokens the session's model requests spend, in and out.
spendThreshold or nullnoThe spend limit: credits the session spends on models (100 credits a USD).
terminals_openThreshold or nullnoTerminals open at once.
tool_callsThreshold or nullnoClassed actions per session.

LocalAuthorizerConfig​

FieldTypeRequiredWhat it says
grantslist of Grantno

Mcp​

The MCP servers the agent is lent, by name; everything else is cut from session/new.

FieldTypeRequiredWhat it says
allowlist of stringno

Network​

What the agent may reach over the network, through the Shield.

FieldTypeRequiredWhat it says
fetchlist of stringnoHosts a fetch may reach (exact host, or *.example.com); empty refuses every fetch.

OpaAuthorizerConfig​

FieldTypeRequiredWhat it says
headersobjectno
packagestringnoThe Rego package answering decision and context.
urlstringyesOPA's address: http://opa:8181

OpenFgaAuthorizerConfig​

FieldTypeRequiredWhat it says
modelstring or nullno
storestringyes
urlstringyes

Rate​

A rate: at most rate per per.

FieldTypeRequiredWhat it says
persecond | minuteyessecond or minute.
ratenumberyesHow 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.

FieldTypeRequiredWhat it says
connectionsRate or nullnoConnections a person holds open to a Gateway.
requestsRate or nullnoRequests a person makes through a Gateway.
tokensRate or nullnoTokens a person's requests process.

Rule​

One line of a policy: what it matches and what it decides.

FieldTypeRequiredWhat it says
classeslist of read | write | send | buy | delete | executenoThe classes the rule names; empty names every class.
commandslist of stringnoRegular expressions on the whole command line; any matches.
decisionallow | ask | denyyes
kindslist of read | edit | delete | move | search | execute | think | fetch | switch_mode | othernoThe ACP tool kinds the rule names; empty names every kind.
namestringyesA short name; every sentence quotes it.
pathslist of stringnoGlobs on the path relative to the workspace (fnmatch); any matches.
reasonstring or nullnoWhy; shown in the sentence.
whereinside | outside | anynoinside: 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.

FieldTypeRequiredWhat it says
hardintegeryes
softintegeryes

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.