Skip to main content

openshell policy

Alias: pol Manage sandbox policies. Network and inference policy sections are hot-reloadable on running sandboxes without a restart.
Pass --global to any subcommand to operate on the gateway-wide global policy instead of a per-sandbox policy.

openshell policy set

Apply or replace a policy on a running sandbox (or gateway-global).
string
Sandbox name. Defaults to the last-used sandbox. Ignored when --global is set.
string
required
Path to a policy YAML file.
boolean
Apply as a gateway-global policy that overrides sandbox-level policies for all sandboxes. Prompts for confirmation unless --yes is also set.
boolean
Skip the confirmation prompt when setting a global policy.
boolean
Wait for the sandbox to confirm it has loaded the new policy. Not supported for global policies (global policies are effective immediately).
integer
default:"60"
Timeout in seconds for --wait.

Examples

--wait polls the sandbox until it reports the expected policy revision. Use this in scripts that apply a policy and then immediately run a command that depends on it.

openshell policy get

Show the active policy for a sandbox or the gateway-global policy.
string
Sandbox name. Defaults to the last-used sandbox. Ignored when --global is set.
integer
default:"0"
Specific policy revision to retrieve. Defaults to the latest revision.
boolean
Print the full policy document as YAML instead of a summary.
boolean
Show the gateway-global policy revision.

Examples


openshell policy list

List policy revision history for a sandbox or the gateway-global policy.
string
Sandbox name. Defaults to the last-used sandbox. Ignored when --global is set.
integer
default:"20"
Maximum number of revisions to return.
boolean
List gateway-global policy revisions.

Examples


openshell policy delete

Delete the gateway-global policy lock, restoring per-sandbox policy control. Only operates on global policy; per-sandbox policy delete is not supported.
boolean
required
Required. Delete the global policy setting.
boolean
Skip the confirmation prompt.

Example


Policy behavior

Global policy overrides per-sandbox policy. Deleting the global policy with policy delete --global restores each sandbox’s own policy. See Policy Schema for the full YAML format.