Repository navigation
Description
Out of scope
No change to production authentication or managed-policy precedence. No real credentials, endpoint names, host identifiers, or deployment configuration belong in this issue. Do not rerun the unsealed counterexample against a real provider.
Context
Found while qualifying #4274 in PR #4312 at accf202cf39c871f9ad4697d1df3eb2df761f546.
voyageHome in packages/ui-server/tests/safety-result-retention.test.ts:58-190 launches the installed Claude SDK runtime with a temporary HOME/config directory, settingSources: [], a fake API key and a scripted loopback ANTHROPIC_BASE_URL. The native runtime nevertheless returned generated assistant text while that scripted origin recorded zero requests. This invalidates the native test premises and their qualification receipts.
A machine-level managed settings file can override the test's API endpoint and configure an API-key helper. The observed helper resolved its credential storage through the OS account identity rather than HOME; real credential material was present outside the fixture. No secret values are included here. The configured managed endpoint was non-loopback. The stream/routing evidence establishes the harness escape; historical socket/DNS attribution and the upstream request count were not retained, so no specific packet destination or count is claimed.
The preload guard in scripts/test-network-guard.ts:29-165 instruments Bun/JavaScript transports and Bun subprocesses, but the SDK spawns the native runtime through a separate child-process path. Its native traffic and helper access were not intercepted or recorded. scripts/test.ts:240-248 and scripts/test-home.ts:66-81 isolate invoking HOME storage, which does not hide machine-managed settings or an OS-account helper's storage.
Before any correction, the whole retention file produced 0 pass / 9 fail; the full eight-file focused set produced 228 pass / 9 fail. Two failures were a separate fixture ReferenceError; seven native cases failed their runtime premises. These are failed receipts, not passing offline proof.
Scope
Make the installed-native test path genuinely offline and credential-isolated, including managed settings, helper processes and native subprocess networking. The boundary must fail before launching an unqualified native process when isolation is unavailable. Preserve the existing product guards and the provider-history assertions.
Design (maintainer rulings, 2026-11-23)
These supersede the per-stage inspection design. Sources: ruling 1 (its product-time acknowledgement rule still applies), redesign and fallback, option F2.
- The test runner runs offline, in a network namespace that has only loopback. Host Claude Code managed settings are hidden, and credential environment is stripped. The stub mask over known native install paths stays, and so does the non-loopback network preload. Per-stage inspection is dropped.
- Default: a root-created offline network and mount namespace that keeps the real user and group IDs.
- Fallback when that is unavailable: a qualified rootless subset, built from user, network and mount namespaces with loopback only, plus the runtime masks, hidden managed settings, IPC restrictions and a scrubbed environment. Ordinary tests and compatible native tests run in it. The separate-UID, root-bwrap and setpriv suites are refused before execution, with a fixed reason recorded.
- When neither namespace can be created, the whole run stops before any test module loads, with a clear setup error. A "partial" mode that refuses only the native files and runs the rest without a sandbox is rejected.
- The product's 10 s acknowledgement promise is unchanged.
Acceptance criteria
- A keyless fixture supplies hostile managed settings and a helper that would read a sentinel credential outside HOME. Neither the helper nor the native runtime can read that credential or reach an unintended destination.
- Native subprocess access is restricted to the exact scripted loopback service; this is enforced independently of the SDK's endpoint/configuration choices.
- Missing isolation refuses the test before native launch, with an explicit failed receipt; it is never a skip or a passing fallback.
- The guard records denied native attempts without logging credential values, and a restored mutation proves the managed-config escape is detected.
- Proof shows that no test needs non-loopback network, and that hosted CI runners and a local host can create the default namespace. It also exercises the rootless subset, with its refused suites and their recorded reason, and the stop-before-load setup error.
- The native backend, provider-history and baseline retention suites already available on main pass in the qualified hosted environment; each receipt names its exact head and complete test inventory. The baseline retention fixture must use the generic boundary with its synthetic search-wrapper PATH,
USE_BUILTIN_RIPGREP, selective mounts and positive invocation witnesses. PR CONTRACT: retain ambiguous tool delivery and incomplete search evidence #4312 changes that existing suite: its changed retention implementation and complete changed-head qualification remain part of ui-server: retain unknown delivery for concurrent reused tool IDs #4274 / PR CONTRACT: retain ambiguous tool delivery and incomplete search evidence #4312 after the generic boundary lands; do not import those implementation changes here.
Verification
No real provider key, remote model, external network or paid inference. Use controlled loopback fixtures and an enforced native network/credential boundary. Retain the incident's failed receipts separately from later proof. PR #4312's native qualification remains unfinished until this boundary is established.
Contract impact
Test-harness enforcement only; no production CLI, MCP, frontmatter or provider-history contract changes. Managed settings remain authoritative in production. Remediation proceeds after maintainer direction; the unsafe native probes have stopped.
2026-11-20 scope correction: the baseline retention file is already present at main base 099683923ff8764686c9b92fc2dfb021f1d01f67 (introduced by PR #3827). #4313 qualifies the generic boundary and existing main suites, including that baseline fixture. #4274 / PR #4312 retain their changed retention implementation and complete changed-head qualification. The earlier statement that the suite was absent from main was incorrect.
2026-11-23 triage at main 356fa7d76: folded today's three maintainer rulings into a Design section and added the namespace proof criterion. The scope and other criteria are unchanged.
Activity
schlessera commentedon Nov 20, 2026
Claiming #4313 for the test-only OS isolation boundary on branch
fix/native-claude-isolation(claim tokennative-boundary-4313). Unqualified direct native launches now refuse before process creation with an explicit failed receipt. Local verification remains limited to refusal and non-native checks; positive native proof will run only in hosted CI. The retention suite in #4312 remains separate.schlessera commentedon Nov 20, 2026
2026-11-20 acceptance clarification: the retention suite is present only in PR #4312 and does not exist on main. Its instrumented
rgintegration and complete hosted retention qualification have therefore moved explicitly to #4274 / PR #4312. This issue retains the generic OS boundary, hostile managed-settings/helper proof, and passing hosted native backend/provider-history receipts for the final head with the complete inventory. The body reflects that split; the re-review finding about retention qualification is filed to #4274.schlessera commentedon Nov 20, 2026
2026-11-20 source correction: the baseline
packages/ui-server/tests/safety-result-retention.test.tsalready exists at main base099683923ff8764686c9b92fc2dfb021f1d01f67(introduced by PR #3827). The earlier absent-from-main rationale was incorrect. #4313 / PR #4314 must support and qualify that existing baseline through the generic boundary, including its synthetic search-wrapper inputs. #4274 / PR #4312 retain their changed retention implementation and complete changed-head qualification after the boundary lands. No PR #4312 implementation changes were imported into PR #4314. Historical failed receipts remain failed.schlessera commentedon Nov 22, 2026
Decision (maintainer, 2026-11-22): keep fixing PR #4314 until a complete heavy run is green.
Why the question came up. At fix-check round 20, heavy run 44956104575 at
08c9be524showed:worker-rtk.ts:81. In identity, the fresh, warm and control phases pass, and strict fails admission.DISABLE_PROMPT_CACHINGis stripped.Options considered:
Conditions on the chosen path:
schlessera commentedon Nov 22, 2026
Design note (orchestrator, 2026-11-22), for PR #4314.
Under fail-closed classification, launches the guard couldn't classify, such as keyless test shells with loops or a positional
exec "$1", were refused at admission. That broke ordinary unit tests in each of the last four hosted rounds.What I changed, following the "restrict before refusing" rule:
Residual gap. A hash-equal copy of a runtime at a path the script computes itself would not be masked.
The independent design review recommended this as the primary control (option O1), over a deny-all execution sandbox. The sandbox would have added a new compatibility surface and a new class of trace flake.
schlessera commentedon Nov 22, 2026
Correction to the 2026-11-22 design note (PR #4314): the residual gap under O1 is wider than "a hash-equal copy at a computed path."
Inside an existing bwrap, the tripwire masks only cover the runtimes' host realpaths. If that sandbox binds the runtime directory to another destination, the runtime is visible unmasked there. Reaching it still requires the script to compute that remapped path itself: a literal native path classifies as native and goes through admission.
The durable fix is to mask each runtime at every destination an existing bind maps it to. That is tracked in #4410 with the deny-all backstop.
Known O1 limits, also recorded in #4410:
schlessera commentedon Nov 22, 2026
Fable fix check 23 clarifies the existing O1 residual: besides rebinding a runtime directory at another destination, a launch can obtain native bytes through an inherited or unlinked descriptor and copy them to a computed executable path. Installed/canonical/alias path masks do not cover every such byte source. Exec auditing remains diagnostic and is not a synchronous execution barrier for that case. The durable follow-up is filed on #4410; this is a widened residual statement, not a completed fix or additional authority.
schlessera commentedon Nov 22, 2026
Decision (maintainer, 2026-11-22, second ruling): keep the guard global, wrapping every suite, and fix the remaining regression groups one by one.
The alternative put to the maintainer was to make the guard opt-in, limited to the statically inventoried native-capable files. It was declined.
Status at heavy run 45014338287 (PR #4314 head
906745512):schlessera commentedon Nov 23, 2026
Maintainer ruling (PR #4314, strict native acknowledgement overrun: 10.5 s raw against the 10 s promise, of which the test guard accounts for 6.6 s):
schlessera commentedon Nov 23, 2026
Maintainer ruling (PR #4314, 2026-11-23). The per-stage inspection guard did not converge: each heavy run surfaced new stage roles and conflicts, the guard took about 65% of native acknowledgement time, and its audit sandbox conflicts with the product's disabled nested user namespaces.
The guard is redesigned around the routes a real provider call needs, instead of around every stage layout:
Proof must show that no test needs non-loopback network, and that CI runners and local hosts can create the namespace. Where the namespace cannot be created, only native-launching tests refuse; everything else still runs.
schlessera commentedon Nov 23, 2026
Maintainer ruling on the offline-runner fallback (design v2, option F2), 2026-11-23: