Skip to content

feat(cron): enable automation triggers by default - #125025

Merged
steipete merged 3 commits into
mainfrom
feat/cron-triggers-default-on
Aug 17, 2026
Merged

steipete merged 3 commits into
mainfrom
feat/cron-triggers-default-on

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

cron.triggers.enabled defaulted to false, so condition watchers, script payloads, and stream schedules were dark-shipped: the capability existed, and the automations tool description actively told the model to say it was unsupported and to never poll in its place. Operators asking for "watch X and tell me when it changes" got a refusal for a feature that ships in the box.

Why This Change Was Made

An audit of the actual authority boundary found the gate was not buying what its warning implied:

  • No authority delta. cronJobUsesToolRuntime (src/cron/tools-allow.ts) treats agentTurn, script, and trigger.script identically for tool policy, and jobs are capped to the creating agent's allowlist via creatorToolAllowlist (src/agents/tools/cron-tool-creator-cap.ts). An agentTurn cron job was never gated — it already runs unattended, recurring, with that same creator-capped authority including exec.
  • Triggers are strictly tighter. A condition gate gets a 30s wall clock, 5 tool calls, 16KB state, and a 30s minimum interval. An ungated agentTurn has no such budget.
  • Sandboxing already applies. src/cron/trigger-script.ts resolves sandbox context and redirects the workspace when access is not rw, passing sandbox into tool construction — so a sandboxed deployment sandboxes its triggers.

So the gate blocked the bounded paths while leaving the broader one open. Absent config now means enabled; an explicit cron.triggers.enabled: false still disables everything it disabled before, and the error text now says so.

User Impact

Condition watchers, script payloads, and stream schedules work out of the box. Operators who want a hard stop set cron.triggers.enabled: false. No new config surface, no migration.

Docs updated alongside: the trigger warning no longer advises leaving the feature off, and the configuration reference records the new default.

Security doc accuracy pass

Two claims in the security docs had drifted from measured reality:

  • Prompt injection was described flatly as "not solved by system prompt guardrails alone." That understated model choice as a mitigation. A 2026 crowdsourced arena (272K attacks, 41 agent scenarios, scored only when the agent both executed the harmful action and concealed it) measured 0.5% ASR on Claude Opus 4.5, 1.0% Sonnet 4.5, 1.3% Haiku 4.5, and 8.5% Gemini 2.5 Pro. The text now states that, and keeps the two caveats that matter: adaptive attackers still exceed 80% against state-of-the-art defenses, and smaller/older models remain easy to steer. Hard enforcement is still recommended, now proportionate to blast radius rather than as a blanket.
  • Groups were framed as something to avoid ("avoid always-on group bots"). Groups are a supported deployment with sender identity threaded through and per-group settings; the guidance now points at mention gating and contextVisibility for scoping attention, reserving extra caution for genuinely public rooms.

The ATLAS threat-model entries (T-EXEC-001/002) keep their structure; residual risk is restated as model-tier dependent with the measured numbers rather than a flat severity label, since those rows are used for report triage.

Evidence

See the commit for full test output.

  • node scripts/run-vitest.mjs run src/cron/service src/cron/service.jobs.test.ts src/cron/service.stream-validation.test.ts src/cron/trigger-script.test.ts — 41 files, 692 tests passed
  • node scripts/run-vitest.mjs run src/agents/tools/cron-tool.test.ts src/agents/tools/cron-tool.schema.test.ts src/gateway/cron-stream-watchers.test.ts src/gateway/server.cron.test.ts src/gateway/server-methods/cron-error-classification.test.ts — 3 shards passed (202 tests in the agents-tools shard)
  • New regression test src/cron/service/jobs-validation.test.ts proves both directions: omitted cron.triggers allows a trigger job, and an explicit enabled: false still rejects it with the new message.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json clean. The root tsconfig.json lane fails only on two pre-existing tsdown.config.ts errors that reproduce identically on unmodified main.
  • oxfmt + oxlint clean on all 18 changed TypeScript files.

Note on a suite stall: node scripts/run-vitest.mjs run src/cron (raw path filter) stalls with no output and is killed at 120s. I verified this reproduces on clean main with zero changes — it is pre-existing and unrelated, caused by the path filter pulling in the three *.e2e.test.ts files that need live resources. The unit slice above covers the same code and passes.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime security Security documentation agents Agent runtime and tooling labels Aug 17, 2026
@steipete
steipete marked this pull request as ready for review August 17, 2026 03:57
@steipete
steipete requested a review from a team as a code owner August 17, 2026 03:57
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR size: M and removed size: S labels Aug 17, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 17, 2026, 4:08 AM ET / 08:08 UTC.

ClawSweeper review

What this changes

The branch changes omitted cron.triggers.enabled from disabled to enabled, exposing condition scripts, script payloads, and stream schedules by default while updating tool text, tests, snapshots, and security docs.

Merge readiness

⚠️ Ready for maintainer review - 7 items remain

Keep this PR open. Its cron-default change needs an explicit security-boundary decision, and the two prior security-documentation blockers remain unresolved: the new hierarchy puts model choice ahead of host-enforced controls, and its benchmark claims are uncited.

Priority: P2
Reviewed head: 5f239916bc517357779bfeebd0acd58a327ccd6e
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation follows a coherent shared gate, but unresolved security documentation and default-policy approval prevent a higher rating.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies the author as a member, so the external-contributor proof gate does not apply; the PR body provides focused test output but no live operator-flow artifact.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies the author as a member, so the external-contributor proof gate does not apply; the PR body provides focused test output but no live operator-flow artifact.
Evidence reviewed 8 items Current-main default: Current main rejects trigger and script-payload creation unless the setting is explicitly true, establishing the existing omitted-config behavior that this PR reverses.
Proposed runtime change: The branch constructs the script runtime and reconciles stream watchers whenever the setting is omitted; explicit false is the only disabling value.
Caller and owner boundary: Job creation and updates route trigger, script, and stream capability checks through the shared validation owner, so the default changes all three surfaces together.
Findings 2 actionable findings [P1] Restore the documented security control hierarchy
[P2] Cite or remove the benchmark claims
Security Needs attention Model mitigation is presented as the first security layer: The changed text encourages an ordering that conflicts with the repository security contract, where host/config, authorization, policy, sandboxing, and approvals are the actual boundaries.
Security measurements are not auditable: The new quantitative assertions have no linked study or primary citation, so operators cannot evaluate whether the metric or its concealment-scored definition applies to their risk model.

How this fits together

The Automations tool sends jobs to the Gateway scheduler. The scheduler validates jobs, builds a headless Code Mode runtime for scripts, and starts stream watchers; those paths then run with the owning agent’s configured tool and sandbox policy.

flowchart LR
A[Agent or MCP automation request] --> B[Automations tool]
B --> C[Gateway scheduler]
C --> D{Trigger setting}
D --> E[Headless script runtime]
D --> F[Stream watcher]
E --> G[Scheduled job outcome]
F --> G
Loading

Decision needed

Question Recommendation
Should existing deployments that omit cron.triggers.enabled begin allowing unattended condition scripts, script payloads, and stream commands by default? Keep explicit enablement: Retain the current opt-in default and improve the documented enablement path for operators who want these automation surfaces.

Why: This is a deliberate change to the current safe-default posture, not a mechanical correction; repository policy requires a human decision on the resulting execution boundary.

Before merge

  • Restore the documented security control hierarchy (P1) - SECURITY.md treats the model as untrusted and names host/config, auth, tool policy, sandboxing, and approvals as the security boundaries. Calling model choice the “first and cheapest layer” tells operators to sequence a fallible mitigation ahead of those controls; describe model tier as defense in depth while keeping enforced boundaries primary.
  • Cite or remove the benchmark claims (P2) - The precise arena size, model success rates, and adaptive-attacker rate are new security guidance but have no source link or citation. Add an auditable primary reference with its scoring limitations, or remove the figures rather than making the threat-model conclusions depend on unsupported measurements.
  • Resolve security concern: Model mitigation is presented as the first security layer - The changed text encourages an ordering that conflicts with the repository security contract, where host/config, authorization, policy, sandboxing, and approvals are the actual boundaries.
  • Resolve security concern: Security measurements are not auditable - The new quantitative assertions have no linked study or primary citation, so operators cannot evaluate whether the metric or its concealment-scored definition applies to their risk model.
  • Resolve merge risk (P1) - Existing deployments that omit the setting would begin constructing headless script and stream-runtime paths, changing an explicit current security default without an upgrade choice.
  • Resolve merge risk (P1) - The PR’s security documentation can cause operators to treat model selection as a control before hard boundaries, despite the repository’s model-untrusted security contract.

Findings

  • [P1] Restore the documented security control hierarchy — docs/gateway/security/index.md:233
  • [P2] Cite or remove the benchmark claims — docs/gateway/security/index.md:231-233
  • [medium] Model mitigation is presented as the first security layer — docs/gateway/security/index.md:233
  • [medium] Security measurements are not auditable — docs/gateway/security/index.md:231
Agent review details

Security

Needs attention: The patch broadens an unattended execution default and introduces security guidance that conflicts with the repository’s boundary-first model and lacks sources.

PR surface

Source +3, Tests +94, Docs +4. Total +101 across 27 files.

View PR surface stats
Area Files Added Removed Net
Source 9 36 33 +3
Tests 14 125 31 +94
Docs 4 29 25 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 27 190 89 +101

Review metrics

Metric Value Why it matters
Default behavior 1 changed: omitted trigger setting false → true This changes what existing configurations do after upgrade without adding a config key.
Production versus test delta production -3, docs +4, tests/test support/snapshots +100 The runtime diff is net-negative, while the substantial test and snapshot update records newly advertised model-facing behavior.

Merge-risk options

Maintainer options:

  1. Retain the opt-in security posture (recommended)
    Keep omitted configuration disabled and separate any discoverability improvement from the execution-default change.
  2. Accept default-on deliberately
    Approve the new behavior only after resolving the documentation findings and recording that existing omitted-config installations will enable these unattended surfaces.

Technical review

Best possible solution:

Restore boundary-first security guidance, cite or remove the benchmark statistics, and land a default-on posture only after its upgrade and unattended-execution tradeoff is explicitly approved.

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

Not applicable: this PR intentionally changes a default rather than repairing a reportable failing path; source establishes the old and proposed behaviors.

Is this the best way to solve the issue?

No. The runtime change may be a valid product direction, but the security docs must restore hard controls as the primary boundary and substantiate or remove the benchmark claims first.

Full review comments:

  • [P1] Restore the documented security control hierarchy — docs/gateway/security/index.md:233
    SECURITY.md treats the model as untrusted and names host/config, auth, tool policy, sandboxing, and approvals as the security boundaries. Calling model choice the “first and cheapest layer” tells operators to sequence a fallible mitigation ahead of those controls; describe model tier as defense in depth while keeping enforced boundaries primary.
    Confidence: 0.98
  • [P2] Cite or remove the benchmark claims — docs/gateway/security/index.md:231-233
    The precise arena size, model success rates, and adaptive-attacker rate are new security guidance but have no source link or citation. Add an auditable primary reference with its scoring limitations, or remove the figures rather than making the threat-model conclusions depend on unsupported measurements.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: The PR changes a default automation security posture and has concrete documentation blockers, but does not demonstrate an active exploit or outage.
  • merge-risk: 🚨 compatibility: Omitted existing configuration changes from rejecting to permitting trigger, script, and stream automation.
  • merge-risk: 🚨 security-boundary: The default change exposes unattended headless scripts and stream commands under the agent’s tool policy unless an operator opts out.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Repository state identifies the author as a member, so the external-contributor proof gate does not apply; the PR body provides focused test output but no live operator-flow artifact.

Evidence

Security concerns:

  • [medium] Model mitigation is presented as the first security layer — docs/gateway/security/index.md:233
    The changed text encourages an ordering that conflicts with the repository security contract, where host/config, authorization, policy, sandboxing, and approvals are the actual boundaries.
    Confidence: 0.98
  • [medium] Security measurements are not auditable — docs/gateway/security/index.md:231
    The new quantitative assertions have no linked study or primary citation, so operators cannot evaluate whether the metric or its concealment-scored definition applies to their risk model.
    Confidence: 0.99

What I checked:

  • Current-main default: Current main rejects trigger and script-payload creation unless the setting is explicitly true, establishing the existing omitted-config behavior that this PR reverses. (src/cron/service/jobs-validation.ts:80, 8e44c90f53c8)
  • Proposed runtime change: The branch constructs the script runtime and reconciles stream watchers whenever the setting is omitted; explicit false is the only disabling value. (src/gateway/server-cron.ts:520, 5f239916bc51)
  • Caller and owner boundary: Job creation and updates route trigger, script, and stream capability checks through the shared validation owner, so the default changes all three surfaces together. (src/cron/service/jobs.ts:172, 5f239916bc51)
  • Local Code Mode boundary: The changed cron runtime imports OpenClaw’s local runCodeModeScriptHeadless implementation and local tool construction; no affirmative dependency signal establishes reliance on the absent sibling Codex checkout. (src/cron/trigger-script.ts:18, 5f239916bc51)
  • Security contract: Repository security policy says the model is not a trusted principal and identifies host/config trust, auth, tool policy, sandboxing, and approvals as the boundaries; model tier is additive guidance. (SECURITY.md:229, 8e44c90f53c8)
  • Unresolved documentation claims: The branch still calls model choice the first layer despite the boundary contract and gives precise 2026 performance figures without a source link or citation. Public docs: docs/gateway/security/index.md. (docs/gateway/security/index.md:231, 5f239916bc51)

Likely related people:

  • steipete: Current-main blame attributes the existing trigger gate and tool exposure to Peter Steinberger, and this branch changes that same owner boundary. (role: recent feature owner and current PR author; confidence: high; commits: 54cbce25bdf1, ccf1df8c059d; files: src/cron/service/jobs-validation.ts, src/agents/tools/cron-tool.ts, src/gateway/server-cron.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Restore the boundary-first security wording.
  • Add auditable sources for the benchmark claims or remove them.
  • Obtain a maintainer decision on the default-on upgrade posture.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-17T04:09:14.269Z sha bcf67c1 :: found issues before merge. :: [P2] Update the MCP omitted-config expectation | [P2] Cite the security benchmark behind the threat-model change
  • reviewed 2026-08-17T04:19:59.857Z sha 013ccbf :: found issues before merge. :: [P1] Do not equate concealment-scored ASR with execution safety | [P2] Cite the security benchmark
  • reviewed 2026-08-17T07:48:31.030Z sha abb1a3b :: found issues before merge. :: [P1] Restore the documented security control hierarchy | [P2] Cite or remove the benchmark claims
  • reviewed 2026-08-17T07:59:07.786Z sha 75a231c :: found issues before merge. :: [P1] Restore the documented security control hierarchy | [P2] Cite or remove the benchmark claims

@steipete
steipete force-pushed the feat/cron-triggers-default-on branch from 013ccbf to abb1a3b Compare August 17, 2026 07:41
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 17, 2026
Condition watchers, script payloads, and stream schedules were gated behind
cron.triggers.enabled=false, so the capability shipped dark and the automations
tool told the model to call it unsupported.

The gate did not buy what its warning implied. cronJobUsesToolRuntime treats
agentTurn, script, and trigger.script identically for tool policy, and jobs are
capped to the creating agent's allowlist via creatorToolAllowlist -- but an
agentTurn cron job was never gated, so unattended recurring exec with that same
creator-capped authority was already reachable. The gated paths are strictly
tighter: a condition gate gets 30s, 5 tool calls, 16KB state and a 30s minimum
interval, where an agentTurn has no such budget. Sandboxing already applies to
trigger scripts, which resolve sandbox context and redirect the workspace when
access is not rw.

Absent config now means enabled; an explicit cron.triggers.enabled: false still
disables every surface it disabled before, and the error text names the opt-out
instead of telling operators to turn something on. No new config key, no
migration.

Docs: reword the trigger warning for default-on while keeping the unattended
execution note, and record the new default in the configuration reference.
Trigger, stream-schedule, and script-payload surfaces are now advertised in the
automations tool description by default, so the committed fixtures drift.

This also records the cost: dynamicToolsJson grows 49,477 -> 52,541 chars and
the snapshot total 76,861 -> 79,925 (~766 rough tokens per prompt). That is the
price of no longer dark-shipping the capability.
The MCP tools bridge mirrors the scheduler gate, so an absent cron.triggers
config now advertises the trigger surface. Explicit false still narrows it and
explicit true still widens it; both assertions are unchanged.
@steipete
steipete force-pushed the feat/cron-triggers-default-on branch from 75a231c to 5f23991 Compare August 17, 2026 08:02
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 17, 2026
@steipete
steipete merged commit d6b2e14 into main Aug 17, 2026
216 checks passed
@steipete
steipete deleted the feat/cron-triggers-default-on branch August 17, 2026 08:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
* feat(cron): enable automation triggers by default

Condition watchers, script payloads, and stream schedules were gated behind
cron.triggers.enabled=false, so the capability shipped dark and the automations
tool told the model to call it unsupported.

The gate did not buy what its warning implied. cronJobUsesToolRuntime treats
agentTurn, script, and trigger.script identically for tool policy, and jobs are
capped to the creating agent's allowlist via creatorToolAllowlist -- but an
agentTurn cron job was never gated, so unattended recurring exec with that same
creator-capped authority was already reachable. The gated paths are strictly
tighter: a condition gate gets 30s, 5 tool calls, 16KB state and a 30s minimum
interval, where an agentTurn has no such budget. Sandboxing already applies to
trigger scripts, which resolve sandbox context and redirect the workspace when
access is not rw.

Absent config now means enabled; an explicit cron.triggers.enabled: false still
disables every surface it disabled before, and the error text names the opt-out
instead of telling operators to turn something on. No new config key, no
migration.

Docs: reword the trigger warning for default-on while keeping the unattended
execution note, and record the new default in the configuration reference.

* test(cron): refresh prompt snapshots for default-on triggers

Trigger, stream-schedule, and script-payload surfaces are now advertised in the
automations tool description by default, so the committed fixtures drift.

This also records the cost: dynamicToolsJson grows 49,477 -> 52,541 chars and
the snapshot total 76,861 -> 79,925 (~766 rough tokens per prompt). That is the
price of no longer dark-shipping the capability.

* test(mcp): expect trigger surfaces by default in the tools bridge

The MCP tools bridge mirrors the scheduler gate, so an absent cron.triggers
config now advertises the trigger surface. Explicit false still narrows it and
explicit true still widens it; both assertions are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security Security documentation size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant