openclaw - ✅(Solved) Fix [Bug]: exec-approvals.json not honored after gateway restart — isolated cron sessions still prompt [1 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59224Fetched 2026-04-08 02:27:18
View on GitHub
Comments
3
Participants
3
Timeline
18
Reactions
2
Timeline (top)
cross-referenced ×10commented ×3subscribed ×3labeled ×1

After editing ~/.openclaw/exec-approvals.json to set security: full and ask: off at both the defaults level and per-agent level (main and *), isolated cron sessions still prompt for exec approval after gateway restarts. The running gateway appears to hold stale exec policy state that doesn't match the file on disk.

Root Cause

After editing ~/.openclaw/exec-approvals.json to set security: full and ask: off at both the defaults level and per-agent level (main and *), isolated cron sessions still prompt for exec approval after gateway restarts. The running gateway appears to hold stale exec policy state that doesn't match the file on disk.

Fix Action

Fix / Workaround

  • The main session (webchat) partially works — simple commands pass but heredocs still prompt regardless of security: full
  • Isolated cron sessions show Security: allowlist in the approval prompt UI, ignoring the file on disk entirely
  • The only workaround is clicking "Always allow" on each approval prompt manually

Consequence: Failed overnight builds (Nemo/Nemotron build pipeline stalls), missed content generation (blog posts, social media, SEO pipelines don't fire), silent monitoring gaps (cloudflared health checks, security audits don't execute), and significant operator time spent diagnosing and re-applying the same fix after every update. There is currently no permanent fix — the only workaround is manually clicking "Always allow" on each prompt after every restart, which defeats the purpose of unattended automation.

PR fix notes

PR #60010: docs(exec-approvals): clarify defaults fallback and allowlist pattern matching

Description (problem / solution / changelog)

Summary

  • Problem: Users configuring exec approvals hit two undocumented pitfalls: (1) an empty defaults: {} silently falls back to restrictive policy (security: "allowlist", ask: "on-miss"), blocking unattended cron/headless sessions; (2) allowlist patterns that include arguments (e.g., /path/to/python3 scripts/*.py) never match because patterns match resolved binary paths only, not full command strings.
  • Why it matters: These two issues account for multiple open bug reports (#59224, #59600, #27843) and hours of operator debugging. The current docs mention binary-path matching in passing but do not call it out prominently or warn about the defaults fallback behavior.
  • What changed: Added an admonition block clarifying defaults fallback behavior, strengthened the allowlist pattern documentation with explicit correct/incorrect examples, and added a "Troubleshooting" section covering the three most common exec approval pitfalls.
  • What did NOT change (scope boundary): No code changes. No changes to CLI behavior, exec policy logic, or approval flow. Only docs/tools/exec-approvals.md was modified.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Related #59224
  • Related #59600
  • Related #27843
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

N/A — documentation gap, not a code regression.

Regression Test Plan (if applicable)

N/A

User-visible / Behavior Changes

None — docs only.

Diagram (if applicable)

N/A

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: macOS 15 (arm64)
  • Runtime/container: N/A
  • Model/provider: N/A
  • Integration/channel: Telegram (cron-triggered exec)

Steps

  1. Set defaults: {} in exec-approvals.json
  2. Add allowlist entries with arguments (e.g., /opt/homebrew/opt/[email protected]/bin/python3.12 *)
  3. Trigger a cron job that invokes Python scripts
  4. Observe: commands are denied with "allowlist miss"

Expected

  • Docs should clearly state that empty defaults fall back to restrictive policy
  • Docs should clearly state that patterns match binary paths only, not command+args

Actual

  • Docs mention binary-path matching only in passing ("Patterns should resolve to binary paths")
  • Docs do not explain what happens when defaults is empty or missing

Evidence

  • Trace/log snippets

Firsthand reproduction: configured defaults: {} with argument-including patterns, spent multiple debugging cycles before discovering (1) defaults must be explicit and (2) patterns match binary path only.

Human Verification (required)

  • Verified scenarios: reproduced both pitfalls on a live OpenClaw 2026.4.1 deployment with Telegram cron jobs; confirmed the fix (explicit defaults + binary-only patterns) resolves both issues
  • Edge cases checked: verified that openclaw approvals set replaces the entire file (documented in troubleshooting)
  • What I did not verify: other exec policy combinations beyond allowlist+deny; node-host vs gateway-host differences

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Changed files

  • docs/tools/exec-approvals.md (modified, +71/-1)

Code Example

1. Gateway restart should re-read `exec-approvals.json` and apply settings to ALL session types, including isolated cron sessions
2. Consider supporting an `exec.defaults` key in `openclaw.json` for persistent config that survives updates
3. If `security: full` is set, heredoc execution should also be allowed without prompting
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After editing ~/.openclaw/exec-approvals.json to set security: full and ask: off at both the defaults level and per-agent level (main and *), isolated cron sessions still prompt for exec approval after gateway restarts. The running gateway appears to hold stale exec policy state that doesn't match the file on disk.

Steps to reproduce

  1. Edit ~/.openclaw/exec-approvals.json:
    • Set defaults.security to "full"
    • Set defaults.ask to "off"
    • Set agents.main.security to "full"
    • Set agents.main.ask to "off"
    • Set agents.*.security to "full"
    • Set agents.*.ask to "off"
  2. Restart gateway (openclaw gateway restart)
  3. Trigger an isolated cron job that uses exec (e.g., a cron with sessionTarget: isolated)
  4. The cron session's exec approval prompt shows Security: allowlist instead of full

Expected behavior

After gateway restart, all sessions (including isolated cron sessions) should read exec policy from exec-approvals.json and honor security: full / ask: off.

  1. Gateway restart should re-read exec-approvals.json and apply settings to ALL session types, including isolated cron sessions
  2. Consider supporting an exec.defaults key in openclaw.json for persistent config that survives updates
  3. If security: full is set, heredoc execution should also be allowed without prompting

Actual behavior

  • The main session (webchat) partially works — simple commands pass but heredocs still prompt regardless of security: full
  • Isolated cron sessions show Security: allowlist in the approval prompt UI, ignoring the file on disk entirely
  • The only workaround is clicking "Always allow" on each approval prompt manually

OpenClaw version

OpenClaw version: v2026.3.31

Operating system

OS: macOS 15 (arm64), Mac Studio M3 Ultra

Install method

npm global

Model

Anthropic/claude-opus-4.6

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

1. Gateway restart should re-read `exec-approvals.json` and apply settings to ALL session types, including isolated cron sessions
2. Consider supporting an `exec.defaults` key in `openclaw.json` for persistent config that survives updates
3. If `security: full` is set, heredoc execution should also be allowed without prompting

Impact and severity

Affected users/systems/channels: Any OpenClaw deployment running cron-based automation with exec commands. Specifically affects isolated cron sessions (the primary mechanism for overnight builds, content pipelines, and monitoring scripts). Gateway host exec in the main session is also partially affected (heredocs always prompt). All channels that depend on cron output are downstream casualties (Telegram notifications, content publishing, build pipelines).

Severity: Blocks workflow. Cron jobs that require exec stall silently overnight waiting for approval prompts that no human is awake to click. Builds don't ship, content doesn't generate, monitoring doesn't run. The operator has to manually re-run everything the next morning after discovering the failure. In our case, this has consumed 7+ hours of debugging across three incidents (March 17, March 31, April 1) and repeatedly broken a 20+ job overnight automation fleet.

Frequency: Always, after every gateway restart or OpenClaw update. The exec-approvals.json file on disk is consistently ignored by isolated cron sessions. The issue has reproduced on three separate OpenClaw versions (v2026.3.17, v2026.3.28, v2026.3.31). It is not intermittent — it is 100% reproducible.

Consequence: Failed overnight builds (Nemo/Nemotron build pipeline stalls), missed content generation (blog posts, social media, SEO pipelines don't fire), silent monitoring gaps (cloudflared health checks, security audits don't execute), and significant operator time spent diagnosing and re-applying the same fix after every update. There is currently no permanent fix — the only workaround is manually clicking "Always allow" on each prompt after every restart, which defeats the purpose of unattended automation.

Additional information

  • This has been a recurring issue across multiple updates (first hit on v2026.3.17, again on v2026.3.28, and now v2026.3.31)
  • Each OpenClaw update appears to reset or re-initialize exec state independent of the approvals JSON file
  • Adding an exec key to openclaw.json (the gateway config) was rejected with Unrecognized key: "exec" — so there's no persistent config-level way to set this
  • Heredoc execution (python3 << 'EOF') always prompts regardless of any setting, including security: full — this appears to be hardcoded in the gateway binary from the Feb 2026 security hardening commit (2b63592)

extent analysis

TL;DR

The issue can be mitigated by manually clicking "Always allow" on each approval prompt after every gateway restart, but a permanent fix requires resolving the stale exec policy state issue.

Guidance

  • Verify that the exec-approvals.json file is correctly formatted and that the changes are saved before restarting the gateway.
  • Check if there are any other configuration files or settings that might be overriding the exec-approvals.json settings.
  • Consider filing a feature request to add an exec.defaults key in openclaw.json for persistent config that survives updates.
  • Investigate if there are any other workarounds or temporary fixes that can be applied to isolated cron sessions to prevent them from prompting for exec approval.

Example

No code snippet is provided as the issue is related to configuration and not code.

Notes

The issue seems to be related to the gateway not re-reading the exec-approvals.json file after restart, and the security: full setting not being applied to isolated cron sessions. The fact that heredoc execution always prompts regardless of the security: full setting suggests that there might be a hardcoded limitation in the gateway binary.

Recommendation

Apply workaround: Manually click "Always allow" on each approval prompt after every gateway restart, as there is no permanent fix available yet. This is because the issue is related to the gateway not re-reading the exec-approvals.json file after restart, and there is no other known workaround that can be applied to isolated cron sessions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After gateway restart, all sessions (including isolated cron sessions) should read exec policy from exec-approvals.json and honor security: full / ask: off.

  1. Gateway restart should re-read exec-approvals.json and apply settings to ALL session types, including isolated cron sessions
  2. Consider supporting an exec.defaults key in openclaw.json for persistent config that survives updates
  3. If security: full is set, heredoc execution should also be allowed without prompting

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING