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 4d83fbc
Browse filesBrowse the repository at this point in the historyBrowse files
feat(approvals): standing-grant ledger, revocation, and configurable terms
Completes the operator half of cron standing grants (#129526):
- Grants are listable and revocable. New gateway methods
exec.approval.grants.list/revoke (operator.approvals scope), CLI
'openclaw approvals grants list|revoke', and a Standing grants section
on the Control UI approvals page with per-row revoke. Revocation is
idempotent, records the acting client, and takes effect at the next
occurrence's spawn boundary.
- Grant terms are frozen at mint and configurable. Default stays
until-revoked (matching what shipped Always allow has always meant);
tools.exec.grantExpiryDays sets a day-bounded default for future
grants (enterprise fleet policy), and resolve surfaces may override
per grant via grantExpiresInDays / --expires-in-days. Existing grants
keep their minted terms; config changes are never retroactive.
- expires_at_ms goes nullable (NULL = until revoked). The mandatory-
expiry shape never reached a release tag, so the lazy ensure rebuilds
it in place; grants are re-derivable authority, so the fail-closed
cost is one re-prompt.
- Approval cards say what Always allow does. Automation approvals carry
a standing-grant ApprovalScope (new union member) built server-side
from the cron run registry (now carrying the job display name); the
Control UI inbox card and modal render it via i18n, e.g. 'Always
allow runs this exact command for "grant-demo" without asking, for
10 days (revocable)'.
- Aux method registries stay in lockstep: new parity test fails when a
GATEWAY_AUX_METHODS entry lacks a lazy handler (this gap produced
live unknown-method errors during bring-up).
Live-proven on a hermetic gateway: until-revoked grant ran 62 promptless
occurrences; UI and CLI revocation each returned the prompt on the next
occurrence; config default stamped exactly 10.0 days via a UI resolve;
--expires-in-days 99 override stamped 99.0 days; ledger and card
screenshots captured from the running Control UI.
Copy file name to clipboardExpand all lines: docs/automation/cron-jobs.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -298,6 +298,8 @@ Before an isolated run starts, OpenClaw checks reachable local endpoints for con
298
298
Command payloads run deterministic scripts inside the Gateway scheduler without starting a model-backed turn. They execute on the Gateway host, capture stdout/stderr, record the run in the job's run history, and reuse the same `announce`, `webhook`, and `none` delivery modes as agent-turn jobs.
299
299
300
300
<Note>
301
+
When an agent-turn automation's exec needs approval, the card is delivered to connected approval surfaces and the run waits for the decision; answering **Always allow** mints a scoped standing grant so later occurrences run without prompting. See [Standing grants for automations](/tools/exec-approvals#standing-grants-for-automations) for lifetime, listing, and revocation.
302
+
301
303
Command payloads are an operator-admin Gateway automation surface, not an agent `tools.exec` call. Creating, updating, removing, or manually running automation jobs requires `operator.admin`; scheduled command runs later execute inside the Gateway process as that admin-authored automation. Agent exec policy (`tools.exec.mode`, approval prompts, per-agent tool allowlists) governs model-visible exec tools, not command payloads.
Standing grants minted by allow-always on automation approvals are listed and
111
+
revoked from the same command group:
112
+
113
+
```bash
114
+
openclaw approvals grants list
115
+
openclaw approvals grants list --json
116
+
openclaw approvals grants revoke <grant-id>
117
+
```
118
+
119
+
The list shows the owning automation, the exact command, the use count, and
120
+
each grant's state (until revoked, expires in N days, expired, or revoked).
121
+
Revocation is idempotent and takes effect at the next occurrence's spawn
122
+
boundary — that occurrence prompts again. Editing or deleting the automation
123
+
invalidates its grants without needing an explicit revoke.
124
+
97
125
The CLI reads the unified approval record to select its kind, checks the requested decision against the record's allowed decisions, and then calls the unified resolver. A first successful decision exits `0`. Repeating the recorded decision also exits `0` and reports `already resolved (same decision)`. A conflicting decision, missing approval, expired approval, or decision unavailable for that approval kind prints a clear error and exits non-zero.
98
126
99
127
`--reason` adds a local note to the CLI confirmation. The current Gateway approval record has no free-text resolution-reason field, so this note is not persisted or sent to other approval surfaces.
Copy file name to clipboardExpand all lines: docs/gateway/config-tools.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,8 @@ Control UI repository previews and project discovery use the separate optional `
287
287
288
288
Values shown are defaults except `applyPatch.allowModels` (empty/unset by default, meaning any compatible model may use `apply_patch`). `approvalRunningNoticeMs` emits a running notice when approval-backed exec runs long; `0` disables it.
289
289
290
+
`tools.exec.grantExpiryDays` (unset by default) sets the default lifetime, in days (1–3650), for standing grants minted by Always allow on automation approvals. Unset keeps grants valid until revoked or the owning automation changes. Terms freeze at mint, so changing the value affects only future grants; see [Standing grants for automations](/tools/exec-approvals#standing-grants-for-automations).
291
+
290
292
### `tools.loopDetection`
291
293
292
294
Tool-loop safety checks are **disabled by default**. Set `enabled: true` to activate detection. Settings can be defined globally in `tools.loopDetection` and overridden per-agent at `agents.entries.*.tools.loopDetection`.
0 commit comments