Policy Authoring
Understand Iron Gorilla's structured policy model, catalog-driven selectors, nested conditions, and bounded cross-action references.
Iron Gorilla policies use a typed rule model for guided authoring, simulation, and AI-assisted drafting. Rules are structured around selectors, condition trees, explicit effects, and catalog-backed action metadata.
The Mental Model
Each action rule answers one question:
- What action does this rule apply to?
- Under what conditions does it match?
- What effect should it produce?
That maps directly to:
selectorwheneffect
The rule also has a required name and an optional description.
Rule Anatomy
{
"id": "rule_high_value_payment",
"name": "Require approval for large payments",
"description": "Pause payment calls over the review threshold.",
"effect": "require_approval",
"selector": {
"kind": "action",
"family": "tool.invoke",
"match": "resource",
"resourceId": "payments.charge"
},
"when": {
"kind": "group",
"op": "and",
"children": [
{
"kind": "predicate",
"left": { "source": "current_action", "field": "input.amount" },
"operator": ">=",
"right": { "source": "literal", "value": 10000 }
}
]
}
}Effects
Rules can produce three effects:
allowdenyrequire_approval
If multiple rules match, precedence is:
denyrequire_approvalallow
If nothing matches, the governance profile decides the default behavior.
Selectors
Selectors are structured objects, not typed strings.
Supported families:
tool.invokellm.calldata.readdata.writeagent.delegatenowrandomuuidstep.startstep.end
Supported match modes:
allresourcegroup
The valid resources and groups come from GET /policies/catalog. Clients use catalog-provided
selector ids rather than deriving ids from labels or user input.
Conditions
The when tree supports:
- nested
andgroups - nested
orgroups - typed predicates
Predicates compare operands from these sources:
literalcurrent_actiongovernance_contexthistory_ref
Cross-Action References
history_ref is how a rule can depend on prior actions in the same job.
It supports only two modes:
exists: did a prior matching action happen?latest: read one normalized field from the latest matching prior action
Cross-action references are bounded:
- only prior completed or replayed actions are considered
- only normalized action facts are exposed
- arbitrary result-body inspection is not supported
Catalog-Driven Authoring
The catalog endpoint gives the editor the metadata it needs to stay valid:
- action families
- resources
- groups
- fields
- field-specific operators
- governance fields
- starter templates
The UI can present domain-specific choices like “Tools” or “Providers” and restrict available options to the selected scope.
Simulation
POST /policies/simulate evaluates draft rules against a typed frame:
currentActiongovernanceContexthistory
The response includes rule traces that explain the final decision and show why each relevant rule matched or failed.
Assist
POST /policies/assist uses the same catalog and rule grammar as the manual editor. Generated
drafts stay within the available tools, fields, operators, and supported constructs.
This keeps human-authored rules and AI-authored rules on the same backend-owned contract.