Repository navigation
feat(gateway): add deployment-scoped tool and action policy - #174547
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 changesThis PR adds an optional deployment-wide allowlist for model-directed Gateway tools and actions. Example: A deployment permits sessions with only the patch action.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep this PR open: it supplies a distinct, maintainer-sponsored deployment policy missing from main, and source review established no actionable introduced defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway tool assembly combines conversation permissions, plugins, and workspace capabilities; the new policy filters those tools and checks final arguments before execution across native, catalog, HTTP/MCP, and worker paths. flowchart TD
A[Deployment configuration] --> B[Tool assembly and ordinary grants]
B --> C[Shared deployment policy]
C --> D[Native and catalog tools]
C --> E[HTTP MCP and workers]
D --> F[Hooks and live authority checks]
E --> F
F --> G[Final action authorization]
G --> H[Tool effect]
Technical reviewBest possible solution: Retain the shared policy owner and captured deployment contract, then qualify final effects and existing-install compatibility before merging. Do we have a high-confidence way to reproduce the issue? This is a new capability rather than a reproducible bug report; current source establishes the missing deployment action ceiling, and no target execution was performed. Is this the best way to solve the issue? A shared evaluator at assembly and final argument authorization is a coherent first stage using existing execution and inheritance owners; the separate automation and Codex adapter work should remain separately scoped. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 353c6989892e. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete bypass was identified, but this new authorization boundary remains unqualified. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +323, Tests +632, Docs +25, Generated 0. Total +980 across 52 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 (6 earlier review cycles)
Reviewed October 19, 2026, 9:05 PM ET / October 20, 2026, 01:05 UTC (Revision 7). |
|
Codex: Clarified @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
|
Codex: integrated current main and resolved the conflicts at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Preserve deployment-scoped policy enforcement alongside upstream tool metadata and worker fixture changes. Regenerate configuration baselines and remove the obsolete HTTP test port argument.
…#174547) Add an optional deployment-wide Gateway tool and action policy after ordinary tool and plugin grants. Filter advertised tools and authorize final arguments before execution. Policy changes activate through restart or replacement. Preserve existing behavior when no policy is configured, trusted human Gateway administration, and Codex native tools.
What Problem This Solves
Deployment owners need to limit which Gateway tools and actions model-directed work can use, including administrator-started conversations and plugin-provided tools.
tools.gatewayPolicyapplies a tool allowlist and explicit action lists after ordinary grants, then authorizes final arguments after preparation and hooks.Tools capture the deployment policy when assembled. Adding, changing or removing it requires Gateway restart or replacement after affected old work ends. Ordinary tool-policy reloads, direct human administration, native Codex tools and deployments without this setting keep their existing behavior.
Tool Search, Code Mode, HTTP/MCP invocation and dedicated workers share the policy rules. Both turn and stable session catalogs are filtered. Children retain their parent's applicable whole-tool restrictions and apply the deployment's action policy themselves. Workspace-dependent delegation uses the shared publisher schema and existing policy evaluator without inserting a callable publisher into the parent's catalog.
This provides RFC-0021 items 1/2, caller-independent propagation for 3, and native execution coverage for 8. Automation restrictions, Codex adapter integration, OCE policy delivery and Harness-local protection remain separate work.
Evidence
92477a723819in8c9d271c2cc. Fresh correctness and maintainability review confirms the publication merge preserves sandbox-specific actions and fields, operator permissions, explicit publishing and omitted-action compatibility.8c9d271c2ccpassed, including the final CI, dependency-review and security-sensitive-review gates. Local focused suites could not execute because the installed TypeScript package lacks the requiredtypescript/astexport.Real-Gateway runtime qualification remains pending. An isolated driver with fake credentials and a scripted local provider is prepared for allowed/denied tool effects, hook rewrites, human administration and activation after joined replacement. No current-head runtime qualification is claimed.