Policy Syntax
In v11 a policy is an entry in a typed policy document: your organization's document for the policies you write, and the platform's own for the policies AxonFlow ships. This page documents the shape of one policy, then the categories, actions, severities and pattern syntax behind the shipped policies. For the lifecycle around a document (validate, publish, activate), see Typed Policy Authoring.
Policy Structure
Every policy, shipped or yours, has the same parts. This is one of the condition-based policies AxonFlow ships, as the platform stores it (bookkeeping fields omitted):
{
"id": "corpus:dynamic_policies:sys__dyn__anomalous__access",
"authority": "requirement",
"root": "system",
"scope": { "organization": true },
"actions": { "any": true },
"where": {
"kind": "and",
"operands": [
{ "kind": "compare", "path": "signal.risk_score", "op": "gt", "literal": 0.6 },
{ "kind": "compare", "path": "args.context.user_2e_access__pattern", "op": "eq", "literal": "anomalous" }
]
},
"obligations": [
{ "type": "notification", "params": { "kind": "alert", "severity": "warning" }, "mandatory": false }
],
"assurance": "advisory"
}
| Part | What it says |
|---|---|
id | The policy's identifier. It is what a decision's evaluated_policies names when the policy matches |
authority | What the policy may do: permission (a grant), constraint (a ceiling), requirement (a mandatory safeguard) or inspection |
root | Whose policy it is: system for the platform's, organization for your organization's |
scope | Which principals it applies to: the whole organization, or named groups |
actions | Which registered actions it reaches, or any action |
where | The condition, over request arguments, identity attributes and detector findings. Paths are typed by the deployment's vocabulary, and a path the vocabulary does not declare is refused at validation |
obligations | For a requirement, the safeguards it attaches: a redaction, a notification, an audit record, an approval |
assurance | How a failure to evaluate the policy is treated: enforcement and gating_risk controls fail closed, an advisory one does not |
GET /api/v1/typed-policies/edition reports the vocabulary your deployment validates against, and the validator returns every finding with a code and the value that caused it.
How a shipped action maps to a policy
A shipped policy's action is its authority and obligations, and changing the action for your organization changes which of these it carries:
| Action | Authority | Obligation |
|---|---|---|
block | constraint | none: a matching constraint denies |
redact | requirement | a mandatory redaction of the matched content |
warn | requirement | a notification |
log | requirement | an audit record |
Categories
The shipped pattern-based policies are classified by category, and the category is what Shipped Policy Posture groups them by. A category-wide override your organization records (for example, every platform PII policy to redact) re-actions the platform's policies in that category; it does not reach the 22 organization-editable policies, which your organization changes in its own typed policy document.
| Category | Description | Example Use Case |
|---|---|---|
security-sqli | SQL injection detection | UNION SELECT, stacked queries, blind injection |
security-admin | Admin access control | Users table access, audit log access |
security-dangerous | Dangerous-instruction patterns | Indirect prompt injection: template markers, instruction-override and role-reassignment phrases, system-prompt exfiltration; and the organization-editable dangerous-command blocks |
pii-global | Universal PII detection | Email, phone, credit card, passport |
pii-us | US-specific PII | SSN, bank account numbers |
pii-eu | EU-specific PII | IBAN |
pii-india | India-specific PII | PAN, Aadhaar (DPDP Act 2023) |
pii-singapore | Singapore-specific PII | NRIC, FIN, UEN |
pii-indonesia | Indonesia-specific PII | NIK, NPWP, +62 phone numbers, bank account numbers |
code-secrets | Secret/credential patterns | AWS keys, API tokens, private keys |
code-unsafe | Unsafe code patterns | eval(), exec(), shell injection |
code-compliance | Code compliance patterns | License violations, deprecated APIs |
sensitive-data | Credentials and secrets in user queries | Passwords, API keys, tokens, connection strings |
Actions
The action decides what happens when a shipped policy matches:
| Action | Description | Effect on Request |
|---|---|---|
block | Refuse the request | Request returns an error naming the policy |
redact | Mask sensitive content | Request proceeds with the matched content masked |
warn | Record the match and raise a notification | Request proceeds |
log | Record the match on the audit trail | Request proceeds |
Your organization can give any shipped policy any of these four actions, or disable it. On Enterprise, a policy you write can additionally require a human approval, as a requirement. Approval requirements are an Enterprise construct.
Action Hierarchy
There is no single restrictiveness ranking that decides between two matching policies. The engine combines them by kind: a matching constraint (block) denies whatever else matched; redactions compose toward less disclosure; notifications and audit records are combined. See Policy Hierarchy → How policies combine.
Nor is there a rule that a change may only tighten a shipped policy. v10.x let an override only make a system policy more restrictive (block > require_approval > redact > warn > log); in v11 your organization can make a shipped policy stricter or more lenient, because the shipped action is a default your organization owns.
Severities
The shipped pattern-based policies carry a severity:
| Severity | Description | Typical Use |
|---|---|---|
critical | Highest severity, immediate attention required | SQL injection, credit card exposure, SSN detection |
high | Important security or compliance issue | Admin access patterns, sensitive table access |
medium | Moderate concern, should be reviewed | Email detection, IP address exposure |
low | Informational, for audit purposes | Booking references, general logging |
Severity is not the same as restrictiveness, and it does not block on its own: the action does. For what severity changes, see Policy Parameters Explained → Severity.
Pattern Syntax
The shipped pattern-based policies match Go-compatible regular expressions (RE2 syntax) against request and response text. The detector runs the pattern, and the policy's condition reads the detector's finding: the organization-editable shipped policies, for example, match on signal.detector.<policy> rather than restating the pattern. A policy you write reads findings, arguments and identity attributes the same way, through the vocabulary.
Pattern Examples
| Pattern | Description | Matches |
|---|---|---|
(?i)union\s+select | Case-insensitive UNION SELECT | UNION SELECT, union select |
\b\d{3}-\d{2}-\d{4}\b | SSN with dashes | 123-45-6789 |
\b[A-Z]{3}[PCHABGJLFT][A-Z]\d{4}[A-Z]\b | Indian PAN | ABCPD1234E |
(?i)\b(drop|truncate)\s+table\b | Destructive SQL | DROP TABLE, truncate table |
Pattern Tips
- Use
(?i)at the start for case-insensitive matching - Use
\bfor word boundaries to reduce false positives - Use non-capturing groups
(?:...)when you don't need capture groups - Avoid catastrophic backtracking (nested quantifiers like
(a+)+)
Combination Order
There is no evaluation order to reason about. On every request the engine reads the platform's policies and your organization's together, restricted to what the plane can evaluate, and combines them by kind:
Request → identity admission
→ platform policies + your organization's policies
(restricted to this plane)
→ a matching ceiling denies; otherwise allow, with every
safeguard the matching requirements attach
Creating Policies
Write a policy into your organization's document, then validate, publish and activate it:
curl -X POST http://localhost:8080/api/v1/typed-policies/publish \
-H "Content-Type: application/json" \
-H "Authorization: Basic $(echo -n 'CLIENT_ID:CLIENT_SECRET' | base64)" \
--data @my-document.json
The response carries the version's digest, which is what activation names. Typed Policy Authoring covers every step.
The v10.x way of creating a pattern policy, POST /api/v1/system-policies, answers 409 LEGACY_POLICY_WRITE_FROZEN in v11 and names /api/v1/typed-policies.
Testing Patterns
In v11 a pattern is tested where it is published: publication runs the test cases your document declares against the bundle it just compiled, and policy simulation runs an input through the policies that govern your organization, with the engine that enforces.
The v10.x pattern-test route, POST /api/v1/system-policies/test, is removed in v11: it tested a pattern outside the engine that decides. See Policy Testing.
Best Practices
- Start from the shipped posture -- read what ships before you write anything
- Use descriptive identifiers --
deny-pan-outside-fraudnotpolicy-1 - Declare test cases -- publication runs them, and a document nobody tested has not been shown to do anything
- Start with warn/log -- give a shipped policy
warnorlogfirst, watch what it records, then make it block once you trust it - One rule per policy -- simpler policies are easier to test, monitor, and disable independently
- Review regularly -- audit your document quarterly for relevance and false positive rates
Related
- Typed Policy Authoring - Validate, publish, activate and roll back
- Policy Parameters Explained - What the v10.x parameters became in v11
- Shipped Policy Posture - Every shipped policy and its action
- Policy Testing - Test and validate policies
- System Policies - The detection patterns behind the platform policies
Rollout Checklist
Use this page as one layer of the broader governance rollout:
- decide where the rule belongs with Policy Hierarchy
- test the request path with Runtime Request Paths
- connect review workflows to HITL Approval Gates when a block should become a human decision
- compare Community vs Evaluation vs Enterprise when simulation, evidence export, SSO, SCIM, or portal operations become requirements
