oz0 policy edit

Change one rule, by its ID (oz0 policy show lists them): only what a flag names changes, and the rule keeps its place and its ID.

For: Operators and developers looking up a command.

Change one rule, by its ID (oz0 policy show lists them): only what a flag names changes, and the rule keeps its place and its ID. --action is allow, ask or refuse; --match its pattern; --enforce turns a shadow rule on (it then decides), --shadow back to watching; the other flags are oz0 policy allow's, and --no-when, --no-expires, --no-callers and --no-deciders take a setting away.

--class and --agent write the rule's whole condition, so on a rule with a condition give the part to keep with --when too, or --no-when to drop it. A command rule takes --action, --command (its pattern), --default, --agent, --no-agents, --caller, --no-callers, --target, --shadow, --enforce, --expires and --no-expires. To move a rule, remove it and add it again, or export the policy, reorder it and apply it.

The change's reason (--reason or $OZ0_REASON) becomes the rule's reason; a change that loosens the policy waits for another admin where four eyes are on.

Usage

oz0 policy edit <id> [flags]

Flags

FlagTypeDefaultDescription
--actionstringallow, ask or refuse
--after-classstringArraya sequence rule's first call: its action class; repeatable
--after-compartmentstringArraya sequence rule's first call: a compartment its result's labels name; repeatable
--after-functionstringa sequence rule's first call: its function, a pattern
--after-levelstringa sequence rule's first call: a level its result's labels reach, a name of the tenant's list
--after-outboundstringa sequence rule's first call: yes if it can send data out, no if it cannot
--after-pluginstringa sequence rule's first call: its plugin
--after-truststringa sequence rule's first call: the trust of its result's labels
--agentstringArrayonly for calls of this agent's jobs: for functions, the condition caller.agent (beside --when); for a command rule, its agents; repeatable or comma-separated
--callerstringArrayonly for calls by plugins: plugin:<name>, publisher:<namespace> or source:<kind> (git, workspace, bundle, oci, hub, mcp, npm, archive); repeatable
--classstringArrayonly for calls of functions of this action class: read, write, egress (Sends out) or destructive, host tools included (it writes the condition with each class's host form); repeatable
--commandstringa command rule's pattern instead of functions: the program after its wrappers and its flags and operands, * for one operand, ** for the rest, [class] for an operand of a class (home, root, inside-workdir, outside-workdir, unresolvable, device, default-branch, host:<name>), such as 'git push --force * [default-branch]'
--confirmstringfor an ask rule: the argument a decider types to confirm each call
--deadlinestringfor an ask rule: how long its approvals wait, 1m to 720h
--decidersstringArrayfor an ask rule: who decides: role:<role>, team:<name>, user:<name> or key:<API key ID>; repeatable or comma-separated
--decision-refstringthe decision or case the change follows, such as a case number (at most 200 characters)
--defaultstringa command rule over a default command rule by its ID, such as cmd.download-run: allow turns it off, refuse makes it refuse, for the agents, callers and targets named (oz0 policy show lists the defaults)
--enforceboolturn a shadow rule on: it then decides
--escalationstringfor an ask rule: its escalation ladder: default, off, or steps such as 0.25:deciders,0.5:owner
--expiresstringwhen the rule stops: a time in RFC 3339 or a duration from now, such as 72h
--idstringthe new rule's ID (rule-<letters and digits>); the server gives one when empty
--jsonboolprint JSON instead of a table
--matchstringthe rule's pattern, <tool>.<function> with * for anything
--no-agentsboola command rule: take its agents away
--no-callersbooltake the rule's callers and --other-plugins away
--no-decidersbooltake the rule's deciders and --not-starter away
--no-expiresbooltake the rule's end away: it lasts until removed
--no-whenbooltake the rule's condition away
--not-starterboolfor an ask rule: never the job's starter (four eyes)
--originstringArrayan origin rule's floor: <argument>=<origin> or role:<role>=<origin>, origin request, identity, record or any; repeatable
--other-pluginsboolonly for calls of another plugin's functions (granted uses)
--reasonstringwhy, required for every governance change (at most 500 characters; default $OZ0_REASON); the audit log keeps it
--shadowbooldecide nothing: record what the rule would have decided (oz0 tenant tool-policy shadow-report)
--targetstringArrayfor a rule over a default: only what it finds of this class: home, root, outside-workdir, unresolvable, device or default-branch; repeatable
--tenantstringdefaulttenant
--then-classstringArraya sequence rule's later call, which the rule decides: its action class; repeatable
--then-functionstringa sequence rule's later call, which the rule decides: its function, a pattern
--then-outboundstringa sequence rule's later call, which the rule decides: yes if it can send data out, no if it cannot
--then-pluginstringa sequence rule's later call, which the rule decides: its plugin
--typestringArrayonly for functions of this kind: read (says readOnlyHint: true; never a remote server's), destructive (says destructiveHint: true), declares-nothing (no annotations at all), not-read or reaches-outside; repeatable
--whenstringa CEL condition over each call, such as "args.repo.startsWith('acme/')": the rule decides only the calls it holds for
--withinstringa sequence rule's scope: job (default) or tree (the whole job tree)

Inherited flags

FlagTypeDefaultDescription
--contextstring$OZ0_CONTEXT or <config dir>/orchestrator-zero/context.jsonCLI context file written by server init
--log-levelstringinfolog level: debug, info, warn or error

See all oz0 commands and the global flags.

On this page
Copyright © 2026