[codex] Validate approval responses against pending authority#30963
Draft
bookholt-oai wants to merge 6 commits into
Draft
[codex] Validate approval responses against pending authority#30963bookholt-oai wants to merge 6 commits into
bookholt-oai wants to merge 6 commits into
Conversation
Approval responses were keyed only by string ID and could return values the server did not offer. That allowed one approval kind to consume another kind’s waiter and trusted client-supplied persistence payloads too broadly. Key pending approvals by request kind, record the exact accepted ReviewDecision values, and consume each waiter once before applying an amendment or continuing execution. Preserve ordinary session approval and the exact server-proposed restrictive network-deny path, while treating unoffered responses as denied. Route delegated cancellation to the matching exec or patch waiter and keep Guardian-only reviews independent of the approval ledger. Add unit, integration, delegation, and telemetry coverage for exact payloads, kind isolation, cancellation, replay, and compatibility.
…/psec-4922-approval-integrity
…/psec-4922-approval-integrity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Approval responses were matched only by a string ID, so an exec response could consume a patch waiter with the same ID. The server also accepted persistence payloads that it had not offered. This made the approval boundary depend too heavily on client-supplied response data.
This is the generic approval-integrity layer in the PSEC-4922 stack. It is based on draft #30628's parser-provenance work; later layers compose the runtime PowerShell policy. It does not close PSEC-4922 by itself.
What
How
Pending approval entries now carry their request kind, one-shot sender, and accepted decisions. Occupied entries retain the original waiter and fail the duplicate request closed. Exec and patch handlers take only a matching entry, convert unoffered responses to denial, and then apply any accepted amendment or deliver the result. Tests cover kind isolation, duplicate IDs, exact payload validation, replay, cancellation, delegation, telemetry, and compatibility behavior.
Testing
just test -p codex-protocol(241 passed)just test -p codex-core pending_approvaljust test -p codex-core duplicate_same_kind_pending_approvaljust test -p codex-core duplicate_same_kind_approval_requestjust test -p codex-core approval(147 passed outside the outer sandbox; after the base refresh, 141 passed locally and six sandbox-dependent cases could not write proxy state or start nested Seatbelt)codex-corewas attempted locally; stage-owned tests passed, while unrelated sandbox/fixture-dependent tests could not run successfully in the outer sandboxRelated: PSEC-4922