fix: block mixed-case cron shell jobs from agent tool [AI]#101350
Conversation
|
ClawSweeper proof for current head 3c3dbf2 Behavior proved: the agent-facing cron tool now denies shell-backed cron jobs even when Environment: local PR checkout plus GitHub Actions PR CI for the exact current head. The local proof exercises Command/artifact:
Evidence:
Compatibility/operator note: this changes only agent-tool behavior for already-forbidden command/on-exit cron jobs. It does not change cron schemas, persisted cron data, config/defaults, or the trusted CLI/Gateway command-cron path. Live gaps: I inspected issue-appropriate package scripts and found cron Docker/integration lanes ( |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 1:28 AM ET / 05:28 UTC. Summary PR surface: Source 0, Tests +12. Total +12 across 2 files. Reproducibility: yes. from source inspection: current main checks raw lowercase strings before cron normalization lowercases kind values, so Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the narrow agent-tool boundary hardening after current-head checks, preserving the trusted CLI/Gateway command cron path. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main checks raw lowercase strings before cron normalization lowercases kind values, so Is this the best way to solve the issue? Yes. The PR fixes the existing agent-tool denial point with the same normalization helper used by cron normalization; moving the denial into Gateway cron would risk blocking the trusted CLI/Gateway command-cron path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 01d6ea1f0e87. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source 0, Tests +12. Total +12 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
ClawSweeper proof for current head 3c3dbf2 Behavior proved: the agent-facing cron tool denies shell-backed cron jobs even when Real environment and entry point: local checkout at the current PR head plus GitHub Actions PR CI. The denied-path terminal proof uses Exact commands and artifacts:
Denied/fixed security path evidence:
Protected sink/source result:
Positive benign control:
Compatibility/operator note: this changes only agent-tool behavior for already-forbidden command/on-exit cron jobs. It does not change cron schemas, persisted cron data, config/defaults, or the trusted CLI/Gateway command-cron path. Live gaps: I inspected issue-appropriate package scripts and found cron Docker/integration lanes ( |
|
@clawsweeper re-review |
|
Verification before merge: Behavior addressed: agent-facing cron tool calls can no longer bypass the shell-execution guard with mixed-case command/on-exit kinds.
Regression Risk: Best fix verdict: appropriate. The fix belongs at the agent tool guard because the Gateway/CLI command-cron path is intentionally trusted; moving the denial to Gateway would break that supported surface. User behavior change: |
|
Land-ready verification for exact head
Best-fix verdict: this is the right boundary. |
|
Merged via squash.
|
…101350) * fix: normalize cron tool shell guard kinds * fix(cron): narrow mixed-case shell guard --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…101350) * fix: normalize cron tool shell guard kinds * fix(cron): narrow mixed-case shell guard --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
What Problem This Solves
Agent-created cron jobs could bypass the cron tool's shell-execution restriction by sending
payload.kind: "Command". The tool checked for the exact lowercase spelling before cron normalization later canonicalized the payload to an executablecommandjob.Why This Change Was Made
The agent cron tool now applies the existing lowercase-string normalizer at its command-payload deny boundary for both add and update. The change intentionally leaves the separate
on-exitguard unchanged: cron tool canonicalization already converts a schedule containingcommandtoon-exitbefore this guard, including mixed-case input.User Impact
Agent and MCP tool calls can no longer create or edit command-backed cron jobs by changing the casing of the payload kind. CLI and direct Gateway cron APIs retain their existing command-job support.
Evidence
run_21427c843258combined the regression tests with currentmain; both mixed-case command add/update cases failed as expected before the fix.run_beacbda457f9proved mixed-case on-exit add/update were already rejected on currentmain(2/2 passed), so the redundant on-exit change was removed.run_b62a042cc371, provideraws, leasecbx_e4653c3a8908:pnpm test src/agents/tools/cron-tool.test.tspassed 142/142 tests.git diff --checkpassed.efcdfa377123298cea8f4cf3c17cfad82775ecffwas clean with 0.91 confidence.