Repository navigation
Recover native Codex command inputs before policy checks (T27) - #170
Merged
Merged
Conversation
erickb336
marked this pull request as ready for review
October 13, 2026 13:43
This was referenced Oct 13, 2026
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.
Closes #169
Sage task T27
Codex command policy now receives the original native command arguments, including requested shell, working directory, and permission fields. The normalized Bash hook contains only command text. The policy joins that hook to the protected pending native call, validates the complete envelope, and passes a separate copy to its evaluator.
This works with Sage on and off. Off-mode children prove native identity without creating admission records. After an awaited decision, the policy rechecks that the same command is still pending with unchanged arguments. These checks do not infer effective environment defaults or grant permission by themselves.
Source changes are in
packages/sage-codex/runtime/; generated plugin files come from the build. Claude's active state-tool and hook files are unchanged.Validation at
eb3352038f38da3db2293677745604d38799a457:npm run build: built 278 files.npm run check: all checks pass.git diff --check: clean.node --test scripts/codex-server.test.mjs: 115 tests, 115 pass, 0 fail.428cc47: the original envelope is absent and awaited decisions do not recheck it.node scripts/probe-codex-command.mjs: actual CLI 0.160.0 with simulated responses; exact requested fields reach the evaluator, and the fixed harmless command produces the expected output in the requested directory.--deny-command,--default-command, and--extended-command --sage-offpasses. Denial produces no execution or post-tool callback. Defaults remain omitted in the evaluator input. Each probe removes its temporary profile.npm test: 1,104 tests; 1,104 pass; 0 fail, cancelled, skipped, or todo. Exact-head CI run 38405927407 reports the same counts.Every test/probe uses fake
ps,pgrep, andkillfirst on PATH. Attack strings reach parsers only. The native probe executes only its fixed harmless command in its temporary workspace.Not verified: effective remote environment resolution, complete Sage policy composition, installed automatic enforcement, or real-model operation. Automatic Sage remains incomplete; see #88.