You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a151c1e
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(exec): retire legacy session execSecurity/execAsk; doctor migrates to permission modes (#132740)
* refactor(exec): retire legacy session exec policy
Remove persisted execSecurity and execAsk from session resolution,
protocol patches, runtime contexts, and reset/recovery carry-forwards.
Keep placement and sandbox state unchanged and reserve the retired names.
Route security and ask directives only to their message, with truthful
acknowledgements. Migrate restrictive historical policy through doctor
into permission modes without ever granting full-mode approval bypass.
Regenerate Swift protocol models, update operator docs, and cover schema
rejection, migration/reopen/idempotency, run-only overrides, and slot
reservation. Production changes remain net-negative.
* fix(doctor): keep every-command approval when retiring legacy exec policy
Legacy execAsk=always required approval for every command. No permission
mode encodes that (guarded prompts only on allowlist misses), so migrating
those rows to guarded would let analyzed allowlisted commands run
unprompted. Retire them to read-only with an explicit operator notice.
* fix(exec): preserve migration restrictions and v4 patch compatibility
Resolve partial legacy session policy against global and per-agent config,
using the stricter base when sandbox availability is unknown. Keep deny and
inherited approval-on-every-command restrictions during doctor migration.
Retain the retired session patch fields in protocol v4, but reject them with
permissionMode and per-run /exec guidance before applying any mutations.
Regenerate Swift models and document the retirement contract.
Refs #132740
Copy file name to clipboardExpand all lines: docs/gateway/permission-modes.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,12 @@ New sessions, including managed worktree sessions, inherit the configured global
32
32
33
33
## Policy precedence and clamping
34
34
35
-
An explicit session mode takes precedence over the session's legacy `execSecurity` and `execAsk` overrides. When the mode is unset, those fields and the normal global or per-agent configuration continue to work as before.
35
+
Session-wide exec policy belongs to the permission mode. When the mode is unset, normal global or per-agent configuration applies. `/exec security=... ask=...` applies only to its message and can only tighten an explicit session mode; `host` and `node` remain session placement defaults. See [Exec session overrides](/tools/exec#session-overrides-exec).
36
36
37
-
An explicit `full` mode is the admin-authorized exception to host approval-file floors: its OpenClaw exec policy remains `full` with approvals off. Approval-file floors continue to tighten config-driven exec policy, legacy session overrides, unset modes, and every non-full session mode. Sandbox restrictions and tool allow/deny policy remain independent, and a harness may clamp an unsupported mode to a compatible safer policy tuple. Codex also continues to honor externally enforced `requirements.toml` constraints.
37
+
Before resuming sessions after upgrading a store with legacy session exec policy, run `openclaw doctor --fix`; the runtime no longer reads that policy. Missing policy values inherit the layered global and per-agent exec policy. When historical sandbox availability is unknown, migration uses the stricter sandbox base for automatic host selection. Restrictive policies migrate without broadening exec access to `read-only` or `guarded`. Existing permission modes remain unchanged. Legacy full-access policy is removed with a notice so configuration applies, never converted into a `full` permission grant.
38
+
39
+
The retired `execSecurity` and `execAsk` fields remain in the protocol v4 schemas for `sessions.patch` and `sessions.patchMany`. Requests containing either field, including `null`, are rejected with `INVALID_REQUEST` and guidance to set `permissionMode` (`read-only`, `guarded`, `workspace`, or `full`) or use `/exec` for one run. Neither field is stored as runtime session policy.
40
+
41
+
An explicit `full` mode is the admin-authorized exception to host approval-file floors: its OpenClaw exec policy remains `full` with approvals off unless a turn-scoped override tightens it. Approval-file floors continue to tighten config-driven exec policy, unset modes, and every non-full session mode. Tightening a full session's security restores those floors; tightening only `ask` does not. Sandbox restrictions and tool allow/deny policy remain independent, and a harness may clamp an unsupported mode to a compatible safer policy tuple. Codex also continues to honor externally enforced `requirements.toml` constraints.
38
42
39
43
For the independent sandbox, tool-policy, and elevated-exec controls, see [Sandbox vs tool policy vs elevated](/gateway/sandbox-vs-tool-policy-vs-elevated).
Copy file name to clipboardExpand all lines: docs/tools/exec.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ Example:
132
132
|`auto`|`allowlist`|`on-miss`| Allowlist/safe-bin matches run directly; everything else routes through OpenClaw's native auto reviewer before asking a human. |
133
133
|`full`|`full`|`off`| No approval gate. |
134
134
135
-
Per-session`/exec ask=always`still asks a human every time regardless of the persisted mode.
135
+
Use`/exec ask=always`with a message to require human approval for that run. It does not persist to later messages. Use [session permission modes](/gateway/permission-modes) for session-wide policy.
136
136
137
137
Auto-review approval is single-use. On the gateway, OpenClaw supplies the resolved executable path to the reviewer and pins execution to that same path. An enforceable command chain or pipeline can be reviewed as one request when every executable resolves and OpenClaw can rebuild the complete command with those exact paths. Commands that cannot be reduced to one enforceable execution plan—such as heredocs, shell expansions, or unsupported wrapper quoting—fall back to human approval even if the model would otherwise allow them.
138
138
@@ -162,15 +162,20 @@ Control UI: the **Devices** page includes a small "Exec node binding" panel for
162
162
163
163
## Session overrides (`/exec`)
164
164
165
-
Use`/exec`to set **per-session** defaults for `host`, `security`, `ask`, and `node`. Send `/exec` with no arguments to show the current values.
165
+
Send`/exec host=... node=...` on its own to set **per-session**placement defaults. `security` and `ask` apply to the **current message only**; include them with the task you want to run. Send `/exec` with no arguments to show the resolved defaults.
/exec security=allowlist ask=always inspect the build output
171
172
```
172
173
173
-
`/exec` is only honored for **authorized senders** through channel allowlists/pairing and access groups. Access-group enforcement is always on. It updates **session state only** and does not write config. Authorized external channel senders may set these session defaults. Internal gateway/webchat clients need `operator.admin` to persist them.
174
+
`/exec` is only honored for **authorized senders** through channel allowlists/pairing and access groups. Access-group enforcement is always on. It does not write config. Authorized external channel senders may persist placement defaults; internal gateway/webchat clients need `operator.admin` to do so. Turn-scoped `security` and `ask` do not require that persistence permission.
175
+
176
+
A standalone `/exec security=deny` acknowledges the run-only setting but starts no agent run and does not affect the next message. Use [session permission modes](/gateway/permission-modes) to keep a policy across messages.
177
+
178
+
The `execSecurity` and `execAsk` fields in `sessions.patch` and `sessions.patchMany` are retired. They remain in the protocol v4 wire schema, but requests containing either field (including `null`) are rejected with `INVALID_REQUEST` and replacement guidance. Set `permissionMode` (`read-only`, `guarded`, `workspace`, or `full`) for session-wide policy, or use `/exec` with a message for a single run.
174
179
175
180
When a session has a permission mode, per-turn `/exec` overrides can only tighten its security and approval policy. For example, `/exec security=deny` blocks exec for that turn even in a full-access session; an override requesting looser security or fewer approvals leaves the session mode's limits unchanged. Full-access sessions bypass host approval-file floors only while effective security remains `full`. Tightening `ask` alone still applies the requested approval level without restoring those floors.
| `/exec host=<auto\|sandbox\|gateway\|node> security=<deny\|allowlist\|full> ask=<off\|on-miss\|always> node=<id>` | Show or set exec defaults |
214
+
| `/exec host=<auto\|sandbox\|gateway\|node> security=<deny\|allowlist\|full> ask=<off\|on-miss\|always> node=<id>` | Show resolved exec defaults; persist host/node placement, apply security/ask to this message only. See [Session permission modes](/gateway/permission-modes) |
211
215
| `/login [codex\|openai\|openai-codex]` | Pair Codex/OpenAI login from a private chat or Web UI session. Owner/admin only |
212
216
| `/model [name\|default\|list\|status] [-s\|--session\|-a\|--agent\|-g\|--global]` | Show or select a model. `-s` changes only this session; owner/admin `-a` and `-g` also update configured defaults |
213
217
| `/models [provider] [page] [limit=<n>\|all]` | List configured/auth-available providers or models |
0 commit comments