pi-codex-auto-review 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +4 -2
- package/README.ko.md +85 -0
- package/README.md +51 -52
- package/dist/approval-commands.d.ts +3 -3
- package/dist/approval-commands.js +112 -58
- package/dist/approval-commands.js.map +1 -1
- package/dist/approval-settings.d.ts +1 -1
- package/dist/approval-settings.js +17 -10
- package/dist/approval-settings.js.map +1 -1
- package/dist/approvals.d.ts +9 -9
- package/dist/approvals.js +195 -75
- package/dist/approvals.js.map +1 -1
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +37 -13
- package/dist/audit.js.map +1 -1
- package/dist/cli.js +60 -31
- package/dist/cli.js.map +1 -1
- package/dist/context-files.d.ts +2 -2
- package/dist/context-files.js +40 -19
- package/dist/context-files.js.map +1 -1
- package/dist/contracts.d.ts +39 -39
- package/dist/contracts.js +117 -51
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +145 -48
- package/dist/index.js.map +1 -1
- package/dist/pi-host.js +3 -3
- package/dist/pi-host.js.map +1 -1
- package/dist/policy/domains.js +17 -7
- package/dist/policy/domains.js.map +1 -1
- package/dist/policy/index.d.ts +7 -7
- package/dist/policy/index.js +379 -141
- package/dist/policy/index.js.map +1 -1
- package/dist/policy/paths.js +31 -18
- package/dist/policy/paths.js.map +1 -1
- package/dist/policy/rule-engine.d.ts +2 -0
- package/dist/policy/rule-engine.js +283 -0
- package/dist/policy/rule-engine.js.map +1 -0
- package/dist/policy/rule-types.d.ts +30 -0
- package/dist/policy/rule-types.js +2 -0
- package/dist/policy/rule-types.js.map +1 -0
- package/dist/policy/rules-sync.d.ts +1 -0
- package/dist/policy/rules-sync.js +14 -0
- package/dist/policy/rules-sync.js.map +1 -0
- package/dist/policy/rules-worker.d.ts +1 -0
- package/dist/policy/rules-worker.js +14 -0
- package/dist/policy/rules-worker.js.map +1 -0
- package/dist/policy/rules.d.ts +4 -31
- package/dist/policy/rules.js +126 -38
- package/dist/policy/rules.js.map +1 -1
- package/dist/policy/shell.js +70 -41
- package/dist/policy/shell.js.map +1 -1
- package/dist/policy/starlark/builtins.d.ts +6 -0
- package/dist/policy/starlark/builtins.js +764 -0
- package/dist/policy/starlark/builtins.js.map +1 -0
- package/dist/policy/starlark/evaluator.d.ts +18 -0
- package/dist/policy/starlark/evaluator.js +518 -0
- package/dist/policy/starlark/evaluator.js.map +1 -0
- package/dist/policy/starlark/lexer.d.ts +14 -0
- package/dist/policy/starlark/lexer.js +189 -0
- package/dist/policy/starlark/lexer.js.map +1 -0
- package/dist/policy/starlark/parser.d.ts +140 -0
- package/dist/policy/starlark/parser.js +508 -0
- package/dist/policy/starlark/parser.js.map +1 -0
- package/dist/policy/starlark/validation.d.ts +4 -0
- package/dist/policy/starlark/validation.js +183 -0
- package/dist/policy/starlark/validation.js.map +1 -0
- package/dist/policy/starlark/values.d.ts +46 -0
- package/dist/policy/starlark/values.js +363 -0
- package/dist/policy/starlark/values.js.map +1 -0
- package/dist/reports.d.ts +1 -1
- package/dist/reports.js +66 -30
- package/dist/reports.js.map +1 -1
- package/dist/review/context.d.ts +3 -3
- package/dist/review/context.js +207 -71
- package/dist/review/context.js.map +1 -1
- package/dist/review/investigation.d.ts +2 -2
- package/dist/review/investigation.js +57 -16
- package/dist/review/investigation.js.map +1 -1
- package/dist/review/lifecycle.d.ts +1 -1
- package/dist/review/lifecycle.js +70 -27
- package/dist/review/lifecycle.js.map +1 -1
- package/dist/review/policy.js +10 -5
- package/dist/review/policy.js.map +1 -1
- package/dist/review/upstream-policy.js +1 -1
- package/dist/review/upstream-policy.js.map +1 -1
- package/dist/review/user-input.d.ts +3 -3
- package/dist/review/user-input.js +39 -16
- package/dist/review/user-input.js.map +1 -1
- package/dist/reviewer.d.ts +8 -8
- package/dist/reviewer.js +253 -75
- package/dist/reviewer.js.map +1 -1
- package/dist/signals.js +24 -9
- package/dist/signals.js.map +1 -1
- package/dist/startup.d.ts +4 -4
- package/dist/startup.js +139 -41
- package/dist/startup.js.map +1 -1
- package/dist/tools/controller.d.ts +16 -12
- package/dist/tools/controller.js +432 -121
- package/dist/tools/controller.js.map +1 -1
- package/dist/tools/environment.js +3 -1
- package/dist/tools/environment.js.map +1 -1
- package/dist/tools/executor.d.ts +1 -1
- package/dist/tools/executor.js +45 -28
- package/dist/tools/executor.js.map +1 -1
- package/dist/tools/external.d.ts +8 -8
- package/dist/tools/external.js +22 -11
- package/dist/tools/external.js.map +1 -1
- package/dist/tools/mcp.d.ts +6 -6
- package/dist/tools/mcp.js +208 -80
- package/dist/tools/mcp.js.map +1 -1
- package/dist/tools/mutation-queue.js.map +1 -1
- package/docs/publishing.ko.md +114 -0
- package/docs/publishing.md +49 -47
- package/docs/security/dependencies.ko.md +54 -0
- package/docs/security/dependencies.md +27 -26
- package/docs/testing/auto-review-protection.ko.md +158 -0
- package/docs/testing/auto-review-protection.md +104 -99
- package/docs/usage.ko.md +242 -0
- package/docs/usage.md +125 -121
- package/package.json +106 -95
- package/dist/native/darwin-arm64/artifact.json +0 -5
- package/dist/native/darwin-arm64/pi-guard-execpolicy +0 -0
- package/dist/native/linux-x64/artifact.json +0 -5
- package/dist/native/linux-x64/pi-guard-execpolicy +0 -0
- package/native/execpolicy/LICENSE +0 -201
- package/native/execpolicy/NOTICE +0 -6
|
@@ -1,130 +1,135 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Automatic review protection verification
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** | [한국어](auto-review-protection.ko.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Verification checks **policy decisions, actual Pi tool results, and file and network effects** together. An allowed control case must succeed before a blocked result is meaningful. Exceptions or error messages alone do not establish successful protection.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The current source is an approval assistance extension. It does not enforce OS isolation, configure a network proxy, or recursively inspect directories. Approved tools use Pi's original executor. The earlier sandbox verification records below do not establish guarantees for the current execution structure.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Current approval and execution checks
|
|
10
|
+
|
|
11
|
+
| Target | Result checked |
|
|
10
12
|
| --- | --- |
|
|
11
|
-
| `/approve` | Codex
|
|
12
|
-
| `/approve-model` |
|
|
13
|
-
|
|
|
14
|
-
| Pi
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
13
|
+
| `/approve` | Original Codex descriptions, English UI, narrow-terminal wrapping, actual file effects of the selected approval method, and persistence |
|
|
14
|
+
| `/approve-model` | Current `/scoped-models` scope; exclusion of unavailable and duplicate models; rejection of scope changes during selection; actual Pi reviewer selection without changing the main model |
|
|
15
|
+
| Settings changes | Concurrent selection merging, preservation on save failure, and blocking late approvals from previous reviews |
|
|
16
|
+
| Pi execution | Original SDK execution with cwd, environment, output, timeout, and cancellation signal preserved |
|
|
17
|
+
| Startup | Execution without an exhaustive scan even when unrelated directories cannot be traversed |
|
|
18
|
+
| Protection and denial | Direct protected paths and deny rules rejected before review; failures, cancellation, and timeouts never lead to execution |
|
|
19
|
+
| Network review before execution | curl requests with omitted schemes, configuration files, or both allowed URLs and configuration files pass through automatic or user review. Only the allowed control reaches the owned HTTP server |
|
|
20
|
+
| TypeScript rules | Replay 280 actual results captured from the pinned Codex helper; preserve rule outputs and rejected inputs, cancellation, budgets, and strict request validation |
|
|
21
|
+
| Distribution package | Startup through the actual Pi loader; synchronous and worker-based rule evaluation from the archive; absence of Rust artifacts, `.node` files, sandbox output, and bundled dependencies |
|
|
22
|
+
|
|
23
|
+
Checks that replay the reviewer and UI use actual Pi and file results, but do not establish the judgment accuracy of a live model. The OS does not restrict indirect file access inside approved shells, hard links, or network changes during execution. Caller environment values are preserved for execution; authentication variables are excluded only from review evidence.
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
`verify:guard` saves the current operating system's results, source hash, and audit records. Other operating systems and live models require separate results. Unexecuted scopes are not marked as passed.
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
Approval descriptions follow the [official approval picker](https://learn.chatgpt.com/docs/security-administration). Reviewer separation, denial feedback, stopping after three consecutive denials or ten in the latest fifty reviews, and cancellation are compared with the [official Auto-review documentation](https://learn.chatgpt.com/docs/sandboxing/auto-review). The current implementation does not enforce OS boundaries; this does not guarantee security equivalent to Codex's sandbox.
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
The reference corpus is [`test/fixtures/execpolicy-reference.json`](../../test/fixtures/execpolicy-reference.json). It records the original executable's revision and SHA-256 hash and contains 201 accepted and 79 rejected cases, including Unicode whitespace, invalid Unicode escapes, and numeric conversion boundaries. The TypeScript implementation is checked through its public asynchronous API; the original binary is no longer required by tests or builds. POSIX-specific path cases are excluded from Windows replay, where the existing platform-specific path tests still run. This is a recorded compatibility corpus, not proof of equivalence for every possible Starlark program.
|
|
25
30
|
|
|
26
|
-
##
|
|
31
|
+
## Historical OS isolation verification
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
The following records concern `v0.1.2` and earlier source versions that included a sandbox. GLM5.3 verification distinguished four SDK cases and one CLI case. Earlier platform verification is preserved in the [platform qualification handoff](../handoffs/auto-review/17-platform-qualification.json), and the earlier 112 checks in the [protection matrix handoff](../handoffs/auto-review/10-protection-matrix.json). Check current execution results against the latest run records with a matching source hash.
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
Before the improvements, at `85008b0`, the same source passed 142 checks each on macOS, actual Linux x64, native Docker, and emulated Docker. Four GLM5.3 cases and separate Windows rule and pre-execution denial checks also passed. The record confirmed that 217 audit entries and seven live model logs and reports did not expose keys. A later comprehensive review found defects not covered by those checks. These historical results do not replace the regression cases below or passing results for the current source.
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
The changes from that comprehensive improvement, final execution evidence, and remaining platform conditions are documented in the [Pi runtime alignment handoff](../handoffs/auto-review/25-pi-runtime-alignment.md).
|
|
33
38
|
|
|
34
|
-
###
|
|
39
|
+
### Protected and allowed cases in the earlier structure
|
|
35
40
|
|
|
36
|
-
|
|
|
41
|
+
| Boundary | Allowed control | Blocked or reviewed target | Final observation |
|
|
37
42
|
| --- | --- | --- | --- |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
| HTTP
|
|
50
|
-
|
|
|
51
|
-
| Docker
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
| HTTPS CONNECT |
|
|
55
|
-
| SOCKS5
|
|
56
|
-
| IPv6 |
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
| MCP
|
|
60
|
-
|
|
|
61
|
-
| MCP
|
|
62
|
-
| MCP
|
|
63
|
-
| MCP
|
|
64
|
-
| Pi
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
| Pi
|
|
71
|
-
| MCP
|
|
72
|
-
|
|
73
|
-
###
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
| Codex
|
|
43
|
+
| Six file tools | Workspace `read`, `grep`, `find`, `ls`, `write`, and `edit` | Same tool calls on absolutely protected paths | Tool error, zero reviewer calls, protected files unchanged, no content exposure |
|
|
44
|
+
| Default read and temporary paths | Ordinary external file reads and default temporary-path writes | Same write after excluding the temporary writable root | Reads still work; writes are reviewed and denied |
|
|
45
|
+
| Read-only profile | Explicitly approved write to an existing file | Unapproved sibling workspace or temporary files, and the next call | Only the approved file changes |
|
|
46
|
+
| Path changes during review | Initially reviewed symbolic-link target | Link replaced with a sibling or protected path during review | Stale approval rejected; all three targets unchanged |
|
|
47
|
+
| Risk and authorization | Synthetic high-risk case with sufficient authorization | Explicit low-risk policy denial, insufficient authorization, or critical risk | Tool results delivered to the main model agree with actual writes |
|
|
48
|
+
| Technical review errors | Correctly structured approval response | Provider error, invalid JSON, injected additional permission fields, or timeout | Failure distinct from policy denial; files unchanged |
|
|
49
|
+
| Approval path settings | Ordinary workspace writes and shell output | Disabled sandbox or command-rule approval categories | Rejected without calling the reviewer |
|
|
50
|
+
| Command rules | Normal command matching no rule | Deny rule matching alongside an allow rule, or nested shell | Direct and nested execution rejected; no target file created |
|
|
51
|
+
| Review cancellation | Review begins through actual Pi direct tools or `codemode` | Late approval after cancellation during review | Cancellation signal propagated; no write executed |
|
|
52
|
+
| Seven file mutations | Workspace append, resize, delete, move, copy, mode change, and hard-link creation | Same operations outside scope | Contents, existence, mode, and original file checked separately |
|
|
53
|
+
| Network destinations | Subdomain of an allowed wildcard | Root domain, similar suffix, or explicitly denied domain | Actual receive counts on an owned server |
|
|
54
|
+
| HTTP redirects | Initial request to an allowed host | Redirect to a denied host | Only initial request arrives; denied target is not reached |
|
|
55
|
+
| Environment variables | Explicit ordinary values passed to a child interpreter | Synthetic secrets in authentication, loader, or user proxy variables | Secrets absent from child environment; ordinary values preserved |
|
|
56
|
+
| Docker process cleanup | `--init` reaps exited orphan processes | Container whose PID 1 cannot reap orphans | `/proc/<pid>` disappears within the limit; failure blocks entry into verification |
|
|
57
|
+
| Preexisting hard links | Same inode with all names inside the allowed scope | Protected-file alias, out-of-scope write alias, or sibling alias of a narrowly approved file | Blocked before execution; external content unchanged. Directory approval covering every alias is allowed |
|
|
58
|
+
| Untraversable directories | Normal file write beside an inaccessible subtree | Subtree permission change or read; unverified tree accessible with a known name | OS boundary also blocks inaccessible tree; startup rejected for incompletely verified searchable scope |
|
|
59
|
+
| HTTPS CONNECT | Owned-server request with a verified synthetic certificate | Disallowed destination or untrusted certificate | Actual HTTPS response and server receive count; authentication failure produces no HTTP effect |
|
|
60
|
+
| SOCKS5 and UDP | Allowed SOCKS5 TCP and a host UDP control request | Explicitly denied SOCKS5 destination or direct sandbox UDP | Only allowed TCP arrives; no additional direct UDP receipt |
|
|
61
|
+
| IPv6 | Proxy approval of equivalent IPv6 notation; exact destination approval during execution | Explicit IPv6 denial or direct IPv6 communication | Address and port reach review; only allowed requests reach the server |
|
|
62
|
+
| Original `.rules` | Starlark functions, string interpolation, alternative arguments, executable paths, and network rules | Incorrect examples, path violations, invalid rules, or cancellation | Pinned Codex engine results reach actual policy and native settings |
|
|
63
|
+
| Automatic context | Instructions from a trusted root to cwd; global instructions and file precedence | Untrusted project, protected-path alias, or byte-limit overflow | Source and content reach Pi and reviewer; updated after refresh |
|
|
64
|
+
| Final MCP execution | Ordinary read-only or configured allowed call; exact reviewed and approved call | Strict request skipping review using annotations or past approval; denial, registration change, or review cancellation | Actual Pi client and stdio server calls agree with file effects |
|
|
65
|
+
| Project MCP startup | Saved trust or explicit trust selection | Project with no decision, or explicit distrust | Trust decision limits server startup effects before tool invocation |
|
|
66
|
+
| Additional MCP approval | Request matching original tool, connection, and actual input | Forged call ID, another tool or connector, or automatic handling of required user input | Only fresh approval bound to the original call is allowed |
|
|
67
|
+
| Concurrent MCP calls | Approved file change among concurrent calls with different inputs | Borrowing another request's approval by reusing caller IDs | Internal connection IDs differ; denied file stays unchanged |
|
|
68
|
+
| MCP name collision | Explicit user approval for `node_repl/js` | Missing approval UI or explicit denial | Actual stdio server file effects agree with approval dialog counts |
|
|
69
|
+
| Pi control files | MCP settings directly changed by the user on the host | Model changes to MCP settings, trusted extension entry points, or relative imports | Files unchanged; external effects blocked after reload. User changes apply at next startup |
|
|
70
|
+
| Review response types | String risk level and valid approval | Invalid risk or authorization level such as arrays or `null` | External file unchanged; technical failure reaches the next model request |
|
|
71
|
+
| Literal paths | `[route]` and `*` filenames inside the allowed workspace | Additional permission roots containing pattern characters and direct SDK profiles | Blocked before approval and execution; similarly named siblings unchanged |
|
|
72
|
+
| Direct command after denial stop | Newly requested direct user shell command | Follow-up execution by stopped model, caller cancellation, or stale session | No model write; direct command succeeds; original cancellation contract preserved |
|
|
73
|
+
| Audit records | Valid approval with a quoted review reason | Recording synthetic secrets | Valid JSON, masked values, and approved file changes |
|
|
74
|
+
| Normal Pi and CLI entry points | Official MCP through default package extension; explicit CLI provider and model selection | Duplicate MCP connection or fallback execution for a nonexistent model | Actual Pi and CLI effects agree with model and review calls |
|
|
75
|
+
| Pi resources | Global skills and trusted project skills, prompts, and themes | Untrusted project resources or automatic extension execution | Resources reach model context and expanded prompts; no untrusted code effects |
|
|
76
|
+
| MCP reconnection cleanup | Approved call after reconnecting from output mode to RPC | Leftover previous server processes | Both created PIDs absent after normal shutdown |
|
|
77
|
+
|
|
78
|
+
### Codex-based harness in the earlier structure
|
|
79
|
+
|
|
80
|
+
The baseline is public source `rust-v0.160.0`, commit `a956835d020762cb2b570053af06f643a11c0ecc`. The public harness's verification contracts were adapted to Pi's stream and tool paths. The earlier versions evaluated `.rules` with the actual Rust `codex-execpolicy` dependency; the current source uses the TypeScript port and reference corpus described above. Neither record means that the entire upstream Rust test suite was run.
|
|
81
|
+
|
|
82
|
+
| Codex baseline | Adapted verification |
|
|
78
83
|
| --- | --- |
|
|
79
|
-
| [`responses.rs::mount_sse_sequence`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/common/responses.rs#L1466) |
|
|
80
|
-
| [`exec_policy.rs::execpolicy_blocks_shell_invocation`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/exec_policy.rs#L517) |
|
|
81
|
-
| [`request_permissions.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/request_permissions.rs#L834) |
|
|
82
|
-
| [`guardian_review_cancellation.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/guardian_review_cancellation.rs#L39) |
|
|
83
|
-
| [`execpolicy`](https://github.com/openai/codex/tree/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/execpolicy) |
|
|
84
|
-
| [`agents_md.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/src/agents_md.rs) |
|
|
85
|
-
| [`mcp_tool_call.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/
|
|
84
|
+
| [`responses.rs::mount_sse_sequence`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/common/responses.rs#L1466) | Replays responses in a fixed sequence and fails on excess or missing main-model or reviewer calls. |
|
|
85
|
+
| [`exec_policy.rs::execpolicy_blocks_shell_invocation`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/exec_policy.rs#L517) | Checks that policy denials reach the next main-model request as tool results. |
|
|
86
|
+
| [`request_permissions.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/request_permissions.rs#L834) | Checks that additional read-only permissions do not expand to unapproved workspace or temporary writes. |
|
|
87
|
+
| [`guardian_review_cancellation.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/guardian_review_cancellation.rs#L39) | Checks that late approval cannot execute after cancelling review in direct tools or nested code execution. |
|
|
88
|
+
| [`execpolicy`](https://github.com/openai/codex/tree/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/execpolicy) | Connects the original Starlark engine, example validation, executable paths, and network rule conversion. |
|
|
89
|
+
| [`agents_md.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/src/agents_md.rs) | Checks project root, instruction precedence, byte limits, and trust state. |
|
|
90
|
+
| [`mcp_tool_call.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/tests/suite/mcp_tool_call.rs), [`session/mcp.rs`](https://github.com/openai/codex/blob/a956835d020762cb2b570053af06f643a11c0ecc/codex-rs/core/src/session/mcp.rs) | Checks annotation precedence, strict automatic review, sensitive nested approval, and binding to the call source. |
|
|
86
91
|
|
|
87
|
-
|
|
92
|
+
The current replay harness is in [`test/harness/scenarios.mjs`](../../test/harness/scenarios.mjs), and scenarios are in [`test/conformance/protection.test.mjs`](../../test/conformance/protection.test.mjs). Earlier OS isolation checks are preserved in the [`v0.1.2` tests](https://github.com/buYoung/pi-codex-auto-review/blob/v0.1.2/test/native/sandbox.test.mjs). The harness itself checks missing and excess calls and requests already cancelled.
|
|
88
93
|
|
|
89
|
-
|
|
94
|
+
Extension verification reproduced 131 zombie processes accumulating under Docker PID 1 and `grep` failing to create threads. Harness `--init` and a preliminary orphan-reaping check addressed this while retaining the 256-PID limit and internal file, network, and seccomp restrictions.
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
Follow-up checks reproduced preexisting hard links bypassing protected-file reads and external-file writes on macOS. Comparing link counts with names in the allowed scope before execution addressed this. Pi's default trust value also allowed a new project's MCP server to start before approval tool calls; startup was restricted to saved trust or explicit selection. Reproduction and fix evidence is in the [hard-link handoff](../handoffs/auto-review/15-hard-links.json) and [platform follow-up handoff](../handoffs/auto-review/18-platform-followups.json).
|
|
92
97
|
|
|
93
|
-
|
|
98
|
+
In actual Ubuntu Docker, external AppArmor policy blocked internal `bwrap` mounts. The harness checks AppArmor availability and sets `apparmor=unconfined` only for owned verification containers. Requested values and actual profiles are recorded in run reports, while internal sandbox file, network, and seccomp checks still run. This is a verification environment setting using [Docker's per-container profile selection](https://docs.docker.com/engine/security/apparmor/). Before-and-after runs are preserved in the [AppArmor handoff](../handoffs/auto-review/20-docker-apparmor.json).
|
|
94
99
|
|
|
95
|
-
|
|
100
|
+
Additional verification running x64 programs on an ARM64 kernel found that one normal shell-output case out of 142 exceeded a three-second limit. The caller-specified timeout for that functional check was adjusted to fifteen seconds. A separate lifecycle check continues to verify an actual two-second timeout, a 3.5-second return limit, and blocking delayed file changes. Executor timeout handling was unchanged. The initial failure and focused results are in the [emulated shell timing handoff](../handoffs/auto-review/22-emulated-shell-timing.json).
|
|
96
101
|
|
|
97
|
-
macOS
|
|
102
|
+
The first final macOS aggregation exceeded the package check's twenty-second observation window. A diagnostic copy with a longer window completed normally in 12.6 seconds. Reaggregation retaining the original check and twenty-second limit also passed. The specific cause of the initial delay was not determined. The [package timing handoff](../handoffs/auto-review/24-macos-package-timing.json) preserves both the initial failure and subsequent success.
|
|
98
103
|
|
|
99
|
-
|
|
104
|
+
Normal MCP approval and strict review are distinct. Codex's normal path follows annotations and approval modes even with an automatic reviewer; strict review does not allow those skip conditions. Nested requests cannot lower the original call's strict-review requirement. Corrected behavior and regression checks are recorded in the [MCP routing handoff](../handoffs/auto-review/19-mcp-routing.json).
|
|
100
105
|
|
|
101
|
-
|
|
106
|
+
Current E2E checks are in [`test/e2e/guard.test.mjs`](../../test/e2e/guard.test.mjs). Before fixes, actual Pi and OS paths reproduced array risk levels changing external files, `[]` in restricted paths allowing sibling writes, and `node_repl/js` producing MCP effects without approval. Audit JSON failures and direct command failures after a denial stop were also reproduced this way. The default package check was expanded to run a public Pi session and actual MCP server, so its subprocess observation limit changed from twenty to sixty seconds. Actual executor cancellation and timeout checks remain separate.
|
|
102
107
|
|
|
103
|
-
CLI
|
|
108
|
+
The CLI observer instruments the actual `ModelRuntime` referenced by Pi 0.99.1's extension compatibility registry. Wrapping only that registry misses main-agent calls. A local HTTP provider control compares two main execution calls and one review call actually received with observation records. Passing requires the review output limit `777` and main execution limit of 4096 tokens to reach HTTP requests and the final file to change. This instrumentation is verification code for the pinned version; it does not replace product responses.
|
|
104
109
|
|
|
105
|
-
|
|
110
|
+
Each test process uses a `TMPDIR` directory created for that run and removes it on exit. This followed an observation that shared host temporary paths exceeded the 100,000-entry directory inspection limit. The executor's inspection limit and blocking policy for incomplete inspection remain intact. Separate controls check default temporary-root access and explicit exclusion.
|
|
106
111
|
|
|
107
|
-
|
|
112
|
+
In the first ARM64 Docker run, one normal `grep` control out of 154 failed. Further checks and actual mount observation showed that a nonexistent `.git` was bound to `/dev/null` and denied reads because of `nodev`. Passing a `.git/HEAD` child block as well made the runtime create an empty read-only directory. The original parent block remained. An initial change expanding read declarations was reverted after a separate control showed it was unnecessary. SDK callers' read-only path choices were preserved. Additional controls check normal searches, ordinary directory creation, and blocked Pi settings creation together. Allowed and absolutely blocked roots that overlap directly or through aliases are normalized to actual paths and rejected before execution.
|
|
108
113
|
|
|
109
|
-
|
|
114
|
+
Additional approval binding checks reproduced a denied file changing when two MCP requests overlapped with the same caller ID. Additional approvals now bind to a unique ID generated internally for each MCP transmission. Concurrent calls to tools registered in actual Pi verify that both review inputs are preserved separately and only the approved file changes.
|
|
110
115
|
|
|
111
|
-
###
|
|
116
|
+
### Scope of the earlier OS isolation verification
|
|
112
117
|
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
- Linux
|
|
117
|
-
-
|
|
118
|
-
- Linux x64
|
|
119
|
-
- Windows
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
- HTTPS CONNECT
|
|
123
|
-
-
|
|
118
|
+
- Scenarios replaying the main model and reviewer use actual Pi and an OS sandbox. They do not establish live GLM5.3 judgment accuracy. Four live SDK cases and one CLI case are executed and aggregated separately. Integrated passing results also require actual CLI review calls, file changes, and no credential recording.
|
|
119
|
+
- Default temporary-directory writes and ordinary external-file reads are allowed by the default profile. Operations are not assumed always blocked solely because they are outside the workspace.
|
|
120
|
+
- Shell execution is not transactional. If a first allowed write succeeds and a second write is denied, the first change remains. Tests explicitly check these partial effects.
|
|
121
|
+
- Creating new files on Linux may require approval of the parent directory scope. Narrow approval of an existing file and creation of a new file are distinct scopes.
|
|
122
|
+
- Preexisting hard links and alternative names for narrowly approved files are checked. Concurrent changes to link structure by host programs outside isolation during execution are not covered. Inspection failures and limit overflows block execution.
|
|
123
|
+
- Linux x64 host execution and x64 execution on an ARM64 kernel are recorded separately. Final aggregation requires actual Linux x64 host results from the same source.
|
|
124
|
+
- Windows verification separately checks the original rule engine, approval policy, and pre-execution rejection of unsupported native execution on the actual OS. It does not establish successful Windows native isolation.
|
|
125
|
+
- External MCP executors are trusted integration layers. Cancellation of requests already sent to external servers, and every provider's account identification or side effects, are not guaranteed. Empty approval forms are handled; ordinary input forms and URL elicitation are rejected. Computer Use classifications and approval exceptions absent from Pi were removed.
|
|
126
|
+
- Native permission roots containing pattern characters are blocked because the runtime cannot represent them literally. This is distinct from support for special-character filenames in ordinary workspaces. Trusted extension directories are protected as control code, but all dependencies that arbitrary trusted extensions execute or import elsewhere are not automatically analyzed.
|
|
127
|
+
- HTTPS CONNECT, SOCKS5 TCP, IPv6, and direct UDP blocking are checked. This does not claim support or verification of SOCKS5 UDP or every network protocol.
|
|
128
|
+
- Identical decisions to the proprietary Codex model are not guaranteed. Public policies and flows are distinct from observed results of the selected GLM5.3 model.
|
|
124
129
|
|
|
125
|
-
##
|
|
130
|
+
## Running verification
|
|
126
131
|
|
|
127
|
-
|
|
132
|
+
Run from the repository root. None of these commands uses actual credentials.
|
|
128
133
|
|
|
129
134
|
```sh
|
|
130
135
|
npm run build
|
|
@@ -133,7 +138,7 @@ npm run test:execution
|
|
|
133
138
|
npm run verify:docker -- --mode offline --platform linux/amd64
|
|
134
139
|
```
|
|
135
140
|
|
|
136
|
-
|
|
141
|
+
Run live model verification in a shell with `OLLAMA_API_KEY` exported. If it is saved in `.zshrc`, load that file in the shell first. Do not put the key value in command arguments. Use the image identifier from the preceding offline run's output.
|
|
137
142
|
|
|
138
143
|
```sh
|
|
139
144
|
export OLLAMA_API_KEY
|
|
@@ -141,13 +146,13 @@ npm run verify:docker -- --mode conformance --platform linux/amd64 --model glm-5
|
|
|
141
146
|
npm run verify:guard
|
|
142
147
|
```
|
|
143
148
|
|
|
144
|
-
`verify:platform
|
|
149
|
+
`verify:platform` records complete results for the operating system where it runs. Windows `verify:windows` records rule engine, file execution, and cancellation results. No Ollama key is sent to GitHub Actions.
|
|
145
150
|
|
|
146
|
-
Docker
|
|
151
|
+
Depending on the Docker engine, image IDs may differ between export and loading. In the recorded run, the local manifest referenced the CI configuration hash, and all nineteen layers matched. In this case, rerun offline verification with the ID returned by `docker image load`, then use the same ID for live verification.
|
|
147
152
|
|
|
148
153
|
```sh
|
|
149
154
|
npm run verify:docker -- --mode offline --platform linux/amd64 --image <loadedImageID>
|
|
150
155
|
npm run verify:docker -- --mode conformance --platform linux/amd64 --model glm-5.3 --image <loadedImageID>
|
|
151
156
|
```
|
|
152
157
|
|
|
153
|
-
`verify:guard
|
|
158
|
+
`verify:guard` records results for the same source on the current operating system. A local pass does not replace other platform, image, or live model results. Execution records are kept separately under `.reports/pi-guard/runs/`.
|