Repository navigation
Type sandbox policy review and confirm saved rules before applying - #3195
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 maintainer review before merge. What this changesThe PR types the Console policy editor and requires saved policy identity, version, and rules to match the review before requesting application. Example: An operator removes python-docs access to example.org:443, but the successful save response still lists that grant.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses unchecked policy responses still present on main; no introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Console submits Agent network proposals to OCC validation and save APIs, then optionally requests application; OCC retains IAM, ceiling, persistence, and worker enforcement ownership. flowchart TB
Operator --> Console
Console --> Validation
Validation --> Review
Review --> Save
Save --> Confirmation
Confirmation --> Apply
Apply --> Worker
Technical reviewBest possible solution: Retain this focused repair so only the confirmed reviewed policy can proceed to application, with explicit refresh resolving uncertain saves. Do we have a high-confidence way to reproduce the issue? Current-main source trusts incomplete successful previews and unchecked save responses; the supplied Chromium reproduction injects those responses after real controller processing, although this review ran no target code. Is this the best way to solve the issue? The repair uses the existing editor, response schema, equality helper, and admission APIs while preserving separate save/apply semantics and retained drafts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 067653868689. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
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 Reviewed October 22, 2026, 7:14 AM ET / 11:14 UTC. |
When an operator chooses Save and apply to current revision, the Console now checks that the save response describes the policy, Agent, Namespace, next version, and rules they reviewed. If it cannot confirm the save, it keeps the proposal, shows the last version it read, and offers Refresh policy before another change. A read started before that save cannot clear the warning. An incomplete validation response also keeps the proposal editable.
The policy editor is now strict TypeScript, using the controller's policy response type and the existing public JavaScript URL. The controller still owns authorization, the delegation ceiling, and policy admission. The two regression cases run in an existing browser suite, with no CI configuration changes.
Verification
I reproduced both failures in sandboxed Chromium against the real controller with in-memory state. For the save case, the controller removed a grant, then the test delivered a successful response that still listed the grant. Before the fix the browser sent Apply and the controller accepted it with
202. After the fix the browser sent exactly one save and no Apply. Delivering a real version 2 read after that save kept the warning in place. A separate, explicit refresh then showed the saved version 3. The fixture had no provider worker, so this demonstrates request admission, not a live policy change.All nine policy browser cases passed, including normal save and apply, ceiling and permission refusals, stale previews, version conflicts, and continued polling. Strict TypeScript for product and tests, ESLint, Prettier, docs and links, OpenAPI parity, workspace and test selection checks passed.
Storybook was rebuilt from this head. I opened Policy preview omits the validated rules, Policy save returns different rules than reviewed, Policy denials and reviewed network additions, and Sandbox policy capability unavailable. The previews simulate API state and serve the same policy module as the controller.
policy-save-refresh.webm