Skip to content

[Bug]: 2026.6.10 isolated cron agentTurn loses exec when toolsAllow is exec/bash #97347

Closed as not planned

Description

@wangwllu

Summary

On OpenClaw 2026.6.10, an isolated cron agentTurn can access the shell/exec capability when payload.toolsAllow is omitted, but the same job loses that capability when payload.toolsAllow is set to ["exec"] or ["bash"].

This looks inverted from the intended allow-list semantics: requesting exec/bash should keep the shell tool family available, not produce a runtime where the command tool is missing.

This is related to #60841, but appears to be a distinct surface. In #60841, an upstream config allow-list had already filtered out the core tools and toolsAllow could not re-expose them. In this repro, the no-toolsAllow control succeeds; adding the narrow allow-list is what breaks the isolated cron run.

Environment

  • OpenClaw 2026.6.10 (aa69b12)
  • Surface: Gateway cron
  • Job shape: sessionTarget: "isolated", payload.kind: "agentTurn"
  • Affected values tested: payload.toolsAllow: ["exec"] and payload.toolsAllow: ["bash"]
  • lightContext: true does not cause the failure by itself

Smoke matrix

A minimal isolated cron smoke was run with a prompt that only needed to execute a simple command and report the working directory.

Case payload.toolsAllow payload.lightContext Result
Control omitted omitted succeeds, command returns OK:<workspace>
Control + light context omitted true succeeds, command returns OK:<workspace>
Narrow allow-list ["exec"] true fails with TOOL_MISSING
Alias allow-list ["bash"] true fails with TOOL_MISSING

A production isolated cron job hit the same failure mode after being tightened to a narrow command-oriented allow-list: the isolated session had no usable command tool (toolCount: 0 was observed), the model returned a business-failure summary, and the cron outer status still showed ok because an assistant final was delivered.

Expected behavior

  • payload.toolsAllow: ["exec"] should expose the exec/command tool family to the isolated cron agent.
  • payload.toolsAllow: ["bash"] should either normalize to the same shell/exec capability or fail validation with a clear preflight error if bash is not a supported alias.
  • Tool provider/runtime construction should happen before final allow-list filtering, so a final filter does not prevent the shell tool family from being created.
  • If a requested known core tool is absent after construction/filtering, cron should fail before the model turn with an actionable diagnostic.

Actual behavior

  • Omitting toolsAllow lets the isolated cron job run the command.
  • Setting toolsAllow to ["exec"] or ["bash"] causes the command tool to be unavailable and the agent reports TOOL_MISSING.

Impact

This makes the recommended least-privilege cron posture unsafe for deterministic script jobs: narrowing a cron job to only exec can remove the very tool the job needs. Operators are then pushed toward either broad tool exposure or migrating jobs to payload.kind: "command" as a workaround.

In production, the immediate mitigation was:

  1. Clear toolsAllow on affected isolated agentTurn cron jobs.
  2. Migrate deterministic script jobs to payload.kind: "command", so the command exit code determines the cron status directly.

Suggested fix

  • Add a regression test for isolated cron agentTurn with no allow-list vs ["exec"] vs ["bash"], including the lightContext: true path.
  • Separate tool-family/runtime provider construction from the final toolsAllow projection/filter.
  • Normalize or explicitly reject the bash alias consistently.
  • Add a cron preflight: if a payload requests a known core tool and the final isolated runtime does not expose it, fail the cron run before invoking the model, with a diagnostic such as requested tool exec was not available after runtime construction.

Activity

  1. clawsweeper commented on Jun 28, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

    Close as a duplicate of the open canonical tracker #60841, not as fixed; current main still source-reproduces the Codex app-server finite-allowlist failure, but #60841 already owns the same no-tools/wildcard-succeeds vs finite exec-missing behavior and the security-sensitive fix decision.

    Canonical path: PR #60842 closes #60841 and targets the generic embedded-runner allowlist problem, but it remains open and conflicting, so #60841 stays the canonical open tracker rather than a merged fix.

    So I’m closing this here because the remaining work is already tracked in the canonical issue.

    Review details

    Best possible solution:

    Keep #60841 as the canonical tracker and land a security-reviewed fix there that either materializes exact requested shell/file tools under existing deny/sandbox gates or fails cron preflight instead of recording ok.

    Do we have a high-confidence way to reproduce the issue?

    Yes, source-reproducible on current main: finite Codex app-server toolsAllow disables native shell/file tools and filters native-owned dynamic names before allowlist matching, while cron can still record a non-fatal assistant final as ok.

    Is this the best way to solve the issue?

    No as a separate issue; the best path is to preserve this report's v2026.6.10 matrix as duplicate evidence under #60841 and resolve the security-sensitive behavior once in the canonical tracker.

    Security review:

    Security review needs attention: The underlying canonical fix is security-sensitive because it changes how finite cron allowlists expose or fail shell/file execution tools.

    • [medium] Shell tool allowlist boundary remains unresolved — extensions/codex/src/app-server/dynamic-tool-build.ts:469
      Solving the canonical issue requires choosing whether finite scheduled-run allowlists can materialize exact shell/file tools under existing policy gates or must fail preflight when they cannot be honored.
      Confidence: 0.91

    AGENTS.md: found and applied where relevant.

    What I checked:

    Likely related people:

    • lin-hongkuan: Authored commit 67118d5, which added the current generic tool construction plan and Codex app-server dynamic tool filtering behavior implicated here. (role: recent area contributor; confidence: high; commits: 67118d5ab912; files: src/agents/embedded-agent-runner/run/attempt-tool-construction-plan.ts, src/agents/tool-policy-shared.ts, extensions/codex/src/app-server/dynamic-tool-build.ts)
    • joshavant: Committed the current-main 67118d5 change through PR fix(trajectory): preserve usage in truncated events #96811 and is listed in CONTRIBUTING for Core, CLI, Gateway, Security, and Agents. (role: committer and adjacent owner; confidence: medium; commits: 67118d5ab912; files: extensions/codex/src/app-server/dynamic-tool-build.ts, src/agents/embedded-agent-runner/run/attempt-tool-construction-plan.ts)
    • mmaps: Authored merged PR fix(cron): preserve scheduled turn tool policy [AI] #91499, which touched adjacent scheduled-turn tool policy preservation paths around cron and embedded attempts. (role: recent scheduled-tool-policy contributor; confidence: medium; commits: cc000e0ffee9; files: src/agents/embedded-agent-runner/run/attempt.ts, src/agents/agent-tools.ts, src/agents/tools/cron-tool.ts)
    • anagnorisis2peripeteia: Authored merged PR fix(cron): drop unenforceable default toolsAllow cap on CLI-backed runs #95615, which recently touched cron toolsAllow persistence and default allowlist handling near this report's surface. (role: recent cron toolsAllow contributor; confidence: medium; commits: 17066f2d7c01; files: src/cron/isolated-agent/run-executor.ts, src/cron/store/payload-codec.ts, src/cron/service/jobs.ts)
    • andyk-ms: Authored merged PR feat(cron): add --tools flag for per-job tool allow-list #58504, which introduced the per-job cron --tools allow-list surface used by this issue. (role: introduced cron tools surface; confidence: medium; commits: 4d8c07b97c0b; files: src/cron/isolated-agent/run.ts, src/cron/types.ts)

    Codex review notes: model internal, reasoning high; reviewed against d1b917120a47.

  2. added
    P2Normal backlog priority with limited blast radius.
    impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.
    maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.
    on Jun 28, 2026
  3. locked as resolved and limited conversation to collaborators on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions