Repository navigation
feat: restrict model automation administration through Gateway policy - #174580
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesAdds caller-scoped model automation policy, command-job restrictions, and worker-aware inference-account capture. Example: An administrator-started model turn uses tools.gatewayPolicy.automations with scope "caller" and allowCommandJobs false.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-authored feature adds distinct policy controls absent from main, and the earlier RPC admission finding is fixed. No additional definite code defect was established. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherModel automation calls enter Gateway RPC admission, pass through cron ownership and live-authority checks, and reach persistent job mutations or run reservation; inference capture separately records the account needed for later execution. flowchart TD
A[Model automation tool] --> B[Gateway RPC admission]
B --> C[Cron caller and policy checks]
C --> D[Persistent cron owner]
D --> E[Scheduled execution]
F[Inference account capture] --> D
G[Authorized human administration] --> B
Technical reviewBest possible solution: Keep policy enforcement in the existing grant and cron mutation owners, with worker execution retaining the intended credential boundary. Do we have a high-confidence way to reproduce the issue? This is an intentional feature extension; source inspection confirms the existing administrator-management behavior and the new restriction paths, without executing target code. Is this the best way to solve the issue? The implementation uses the existing authority and persistence owners, checks stored job kinds, preserves human administration, and fixes the previously identified admission gap. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9dd47e67ded4. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete authorization bypass was established, but worker inference authority still needs final-effect qualification. EvidenceWhat I checked:
PR surfaceSource +147, Tests +615, Docs +37, Generated 0. Total +799 across 20 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 16, 2026, 10:40 PM ET / October 17, 2026, 02:40 UTC (Revision 2). |
|
Codex: Addressed the caller-owned RPC admission finding in 2f1333a044b. Under the managed caller policy, a server-owned runtime identity with write scope can reach The existing integration fixture now routes through |
|
Codex: The required-worker scheduling fix is published at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex update: pushed Current-head CI is queued. Local runtime/type checks and config-baseline regeneration remain blocked by dependency downloads; the generated baseline still needs refreshing. The earlier ClawSweeper review had no code finding. Its required-worker account/revocation and old-version upgrade proof requests remain unqualified, rather than being treated as closed by source review. No merge or deployment was performed. |
|
|
Codex: The scheduling-authentication changes and their tests have moved to #179696. This PR now contains only the deployment-scoped automation policy; either PR can merge first. Worker/provider execution qualification remains open in the auth PR. Current head @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…openclaw#174580) * feat(gateway): enforce required model tool and action policy * fix(gateway): accept unvalidated tool descriptors in policy helpers * test(gateway): qualify tool policy fixtures and config schema * test(gateway): type the action rewrite fixture * refactor(agents): keep final tool policy assembly together * feat: restrict model automation administration through Gateway policy * fix(worker): retain prepared prompt report in turn results * fix(gateway): admit caller-owned automation mutations * fix(cron): avoid host auth capture for required workers * fix(worker): preserve Gateway tool errors across proxy calls * fix(cron): use selected Harness authentication for schedules * refactor(gateway): scope tool policy to deployments * refactor(gateway): simplify policy wrappers and coverage * fix(agents): preserve publication scope under gateway tool policy * refactor(agents): separate delegation policy from tool availability * refactor(agents): clarify tool assembly and child policy capture * fix(tools): preserve structured worker failures * fix(agents): narrow explicit tool error results before validation * test(cron): cover command-only deployment policy fallback * fix: refresh automation baseline and simplify tool descriptions * refactor: separate scheduling authentication from Gateway automation policy --------- Co-authored-by: stevenlee-oai <[email protected]>
What Problem This Solves
OCE needs caller-scoped scheduling without giving model turns an administrator’s authority over other automations or Gateway command jobs.
User Impact
Set
tools.gatewayPolicy.automationsto{ scope: "caller", allowCommandJobs: false }. Administrator-started model conversations retain caller-owned scheduling. Model calls cannot create, convert, edit, enable or manually run command jobs or on-exit command watchers. Direct authorized human administration remains available.The policy is optional and activates through Gateway restart or replacement after affected old work ends, matching merged #174547. Ordinary deployments and native Codex tools retain existing behavior. Stream schedules, scripts and triggers retain their separate controls.
Why This Change Was Made
Tool/action filtering cannot distinguish ordinary scheduling from administrative operations. Existing automation grants, ownership checks and commit guards now enforce the deployment policy. Live grant expiry/revocation and stream-approval safeguards remain intact.
The scheduling-authentication changes and their tests have moved to #179696. Neither PR depends on the other; either can merge first. This PR changes no inference-account selection or stored-job format.
Implements RFC-0021 items 3, 4 and the automation portion of 8 in the RFC.
Evidence
Current-head CI remains pending for
894421f4812.provider_throttlewithout a review verdict.