Skip to content

ironflow policy

Manage authorization policies.

Terminal window
ironflow policy <subcommand> [flags]

Policies define subtractive deny rules with actions, resource IRN patterns, and optional CEL conditions. Per ADR 0016 / #943, effect="deny" is the only accepted value at write — the legacy allow path was inert at evaluation and is now rejected with 400. RBAC roles (Layer 1) grant capabilities; these policies (Layer 2) narrow them. See Custom Roles & CEL Policies for full details.

Create a new authorization policy.

Terminal window
ironflow policy create [flags]

Flags:

FlagShortTypeDefaultDescription
--namestringPolicy name (required)
--effectstringdeny only (required; allow is rejected with 400 — #943, ADR 0016 T2)
--actionsstringComma-separated action patterns (required)
--resourcesstringComma-separated IRN resource patterns (required)
--conditionstringCEL condition expression (optional)
--bypass-self-lockout-preflightboolfalseSkip the self-lockout preflight (break-glass; audited)
--bypass-reasonstringRequired when --bypass-self-lockout-preflight is set
--server-sstringServer URL override

Output:

Created policy: deny-prod-delete (id: pol_x1y2z3)

List all policies, optionally filtered by organization.

Terminal window
ironflow policy list [flags]

Flags:

FlagShortTypeDefaultDescription
--orgstringFilter by organization
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Output:

ID NAME EFFECT ACTIONS RESOURCES
pol_x1y2z3 deny-prod-delete deny secrets:manage,apikeys:manage irn:ironflow:*:*:*:env_prod:*
pol_a4b5c6 deny-prod-writes deny functions:register,functions:invoke irn:ironflow:*:*:*:env_prod:*

Get detailed information about a policy.

Terminal window
ironflow policy get <id> [flags]

Arguments:

ArgumentRequiredDescription
idYesPolicy ID

Flags:

FlagShortTypeDefaultDescription
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Output:

ID: pol_x1y2z3
Name: deny-prod-delete
Effect: deny
Actions: secrets:manage,apikeys:manage
Resources: irn:ironflow:*:*:*:env_prod:*
Condition: request.environment == "env_prod"

Patch fields on an existing policy. Only flags you provide are sent to the server.

Terminal window
ironflow policy update <id> [flags]

Arguments:

ArgumentRequiredDescription
idYesPolicy ID

Flags:

FlagShortTypeDefaultDescription
--namestringNew name
--effectstringNew effect: deny only (#943, ADR 0016 T2). PATCH allowdeny on legacy rows is the admin fix path; setting effect=allow is rejected with 400.
--actionsstringNew comma-separated actions
--resourcesstringNew comma-separated resource IRNs
--conditionstringNew CEL condition
--clear-conditionboolfalseClear the existing CEL condition (sends empty string)
--bypass-self-lockout-preflightboolfalseSkip the self-lockout preflight (break-glass; audited)
--bypass-reasonstringRequired when --bypass-self-lockout-preflight is set
--server-sstringServer URL override

Delete a policy by its ID.

Terminal window
ironflow policy delete <id> [flags]

Arguments:

ArgumentRequiredDescription
idYesPolicy ID

Flags:

FlagShortTypeDefaultDescription
--server-sstringServer URL override

Output:

Policy deleted

Compile and evaluate a CEL condition (saved or inline) against caller-supplied request and subject activation maps. Nothing is persisted; mirrors POST /api/v1/policies/dry-run.

Terminal window
ironflow policy test [flags]

Flags:

FlagShortTypeDefaultDescription
--policy-idstringSaved policy ID whose condition to test
--conditionstringInline CEL condition to test (overrides saved condition)
--requeststringRequest activation map as inline JSON
--subjectstringSubject activation map as inline JSON
--request-filestringPath to request activation JSON file
--subject-filestringPath to subject activation JSON file
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Either --policy-id or --condition is required. Inline JSON wins when both inline and file flags are passed.

Output:

Condition: subject.org == "acme"
Matched: true

Show full version history for a policy, newest first. Each row is a full snapshot for client-side diffing.

Terminal window
ironflow policy versions list <policy_id> [flags]

Flags:

FlagShortTypeDefaultDescription
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Forward-save a prior version’s snapshot as a new version. History is append-only — rollback never rewrites past rows.

Terminal window
ironflow policy rollback <policy_id> <version> [flags]

Flags:

FlagShortTypeDefaultDescription
--server-sstringServer URL override

List installable policy templates visible to your tenant: tenant-private bundles plus platform-published bundles.

Terminal window
ironflow policy template list [flags]

Flags:

FlagShortTypeDefaultDescription
--jsonboolfalseOutput as JSON
--server-sstringServer URL override

Install a template bundle into your org. Validation runs against every spec; one bad condition or name collision rejects the whole install (no partial bundles).

Terminal window
ironflow policy template install <template_id> [flags]

Flags:

FlagShortTypeDefaultDescription
--server-sstringServer URL override

Examples:

Terminal window
# Deny destructive ops in production unconditionally
ironflow policy create --name deny-prod-destructive --effect deny \
--actions "secrets:manage,apikeys:manage,projections:manage" \
--resources "irn:ironflow:*:*:*:env_prod:*"
# Deny writes in production
ironflow policy create --name deny-prod-writes --effect deny \
--actions "functions:register,functions:invoke,events:emit" \
--resources "irn:ironflow:*:*:*:env_prod:*"
# Deny staging access for non-oncall callers (CEL condition on subject.roles)
ironflow policy create --name deny-staging-non-oncall --effect deny \
--actions "*" --resources "irn:ironflow:*:*:*:env_staging:*" \
--condition '!("oncall" in subject.roles)'
# List all policies
ironflow policy list
ironflow policy list --org org_default --json
# Update a policy's condition
ironflow policy update pol_x1y2z3 --condition "subject.org == 'acme'"
# Test a policy condition without saving
ironflow policy test --policy-id pol_x1y2z3 \
--request '{"action":"read"}' \
--subject '{"id":"u1","roles":["admin"]}'
# Browse and roll back versions
ironflow policy versions list pol_x1y2z3
ironflow policy rollback pol_x1y2z3 2
# Install a template bundle
ironflow policy template list
ironflow policy template install tpl_admin_basics
# Break-glass: bypass the self-lockout preflight (audited)
ironflow policy update pol_x1y2z3 --effect deny \
--bypass-self-lockout-preflight \
--bypass-reason "incident-217 emergency lockout recovery"
# Delete a policy
ironflow policy delete pol_x1y2z3