nvidia / moonshotai/kimi-k3 / low / low effort preferred over claude-code-cli / claude-sonnet-5-5 / medium / medium effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Review the supplied native and Python private-capture implementations and owner/direct invocation contracts for confidentiality and evidence integrity. Trace the concrete input/output surfaces, credential-field exclusions, file permissions, immutable naming, failure retention, request binding, and reconnect/reconciliation behavior. Examine plausible credential leakage, path or symlink substitution, oversized/truncated envelopes and stale owner-process capture configuration against the actual code. Report only actionable findings with severity, exact packet file/line evidence, realistic trigger and smallest remediation. Separately list acceptance gaps that are not demonstrated defects. Do not inspect credentials/profiles, invoke tools, change files, run tests, or publish private contents.
nvidia / moonshotai/kimi-k3 / low / low effort answer
## Evidence Packet — Direct review of security.packet.md (sha256:ef3d51…)
### Task-relevant findings (actionable)
**F1 — Medium: Credential-key exclusion is evadable by unlisted key names (both implementations, same defect class).**
- Evidence: `native/private-capture.js` packet lines 3–14 (set `secretKeys` + exact-match `token` condition); `bridge/[REDACTED: private constant].py` packet lines 18–29 (identical logic).
- Concrete issue: keys are normalized (`[^a-z0-9]` stripped / `isalnum`) and matched against a fixed set. Common credential carriers not in the set pass through verbatim into the immutable 0600 capture: e.g. `authToken` → `authtoken`, `bearer`, `jwt`, `secret`, `sessionKey`, `privateKey`, `passphrase`, `sshKey`, `signingKey`, `awsSecretAccessKey`. The special-case only fires when the key is exactly `token` and the value is a string (JS line 8; Python line 28), so `auth_token: "ghp_…"` is stored in cleartext in `input`/`nativeReceipt`/`rawEnvelope` evidence (Python lines 124–140).
- Realistic trigger: any native receipt, transport envelope header map, or engine output that surfaces a token under a non-enumerated key name (both `capture()` call sites in `_direct_rpc`, packet lines 207–222, pass the full payload and raw envelope).
- Smallest remediation: extend the normalized set and add a suffix heuristic (`endsWith('token')`, `endsWith('secret')`, `endsWith('key')` for string values), keeping the two implementations in parity; add a regression case per new key.
**F2 — Medium: `_store` never verifies ownership (st_uid) of the capture directory or the committed file.**
- Evidence: `bridge/[REDACTED: private constant].py` packet lines 40–49 (symlink check on the directory itself, resolve, repo check, mode check — no `st_uid` comparison), lines 55–67 (link + unlink), lines 68–77 (O_NOFOLLOW re-open and readback, no fstat owner check).
- Concrete issue: mode `0o700` checks permissions but not owner. If `OPENCODE2_[REDACTED: private constant]` (line 113) or `OPENCODE2_CAPTURE_FAILURE_DIR` (line 157) resolves — via misconfiguration, a symlinked ancestor (only the leaf is checked for symlink at line 41), or a shared host — to a directory owned/controlled by another principal, that principal controls the namespace: it can pre-place `digest.json`, or unlink/replace the destination after the readback closes (line 77) and before any later consumer re-opens by the returned digest. Content is still 0600 owned by the writer, so this is primarily an integrity/substitution and namespace-confusion issue rather than direct disclosure.
- Smallest remediation: after `directory.stat()` (line 48), require `st_uid == os.getuid()`; after `os.fstat(fd)` (line 70), require the file's `st_uid == os.getuid()`. Fail closed.
**F3 — Low: native `captureTerminalSnapshot` can reject after the durable receipt commit and can abort the whole reconcile page.**
- Evidence: JS packet lines 20–26 — `terminalEvidence`/`privateEvidence` and `JSON.stringify` run *before* the `try` at line 26; `privateEvidence` recurses without a depth bound (lines 6–15). Call sites: bridge line 242 (`transition` awaits capture after `storage.set` committed the receipt/version bump, line 241) and line 408 (`reconcile` awaits `captureTerminalSnapshot` with no `.catch`, unlike the adjacent line 412).
- Realistic trigger: a pathological receipt object (very deep nesting, cyclic via any non-plain value) — thrown error rejects `transition` (submit/inspect/advance then surface an RPC error after the durable state was already committed; the caller sees failure although, e.g., state advanced) or terminates `reconcile()` mid-page, silently skipping `captureTerminalSnapshot`/`advance` for every later receipt in that scan page until the next event.
- Smallest remediation: wrap the capture body (including `terminalEvidence`) in the existing try, and add `.catch(() => {})` at line 408 to match line 412.
**F4 — Low: native readback verification depends on durable storage preserving JSON member order.**
- Evidence: JS packet lines 30, 46–52 — verification is `JSON.stringify(await storage.get(key)) === serialized` against a string built from a fresh object. Any normalization that reorders keys (documented at bridge lines 236–240 that storage normalizes values) yields `missing-or-mismatched` and `reconciliationRequired: true`. This is fail-closed (no confidentiality or integrity loss), but produces false reconciliation alarms and makes `captured-readback-verified` unreliable across storage implementations.
- Smallest remediation: canonicalize (stable stringify) on write and compare digests of canonical form on read.
### Alternatives / discarded hypotheses (likely false positives)
- **Symlink substitution at destination:** adequately handled — `os.link` + `FileExistsError` pass (lines 63–65) plus `O_NOFOLLOW` re-open and exact readback (lines 68–75) fail closed. Not a defect.
- **Oversized envelopes truncated mid-write:** not present — bytes are fully serialized, size-checked before write (Python lines 50–52, 135–140; JS line 27), and failures produce identity-only failure records. Digest-only-over-limit coverage retains the hash (line 139).
- **Free-text credentials in questions/taskContext:** intentionally captured (`[REDACTED: private constant]` docstring, Python line 24; `privateTaskContext: input`, bridge line 302). Design choice, not enumerated-key bypass — treated as acceptance gap, not defect.
- **Credential values in Python failure path:** correctly limited to `errorClass` only (line 154); no leakage there. `projectDirectory` in records is by design.
- **Reconnect/observation gap:** subscription is started before cold reconcile (bridge lines 416–435, comment lines 421–423), and explicit `advance` is a safe idempotent recovery (lines 354–361). No defect.
- **Request-ID rebinding:** `existing.inputHash !== hash` throws (bridge lines 292–295); follow-ups require completed prior runs (line 299). Sound within shown code.
### Missing evidence / dependencies (uncertainties)
- `validID`, `ownedRoot`, `validateInput`, and `KEY` are referenced (bridge lines 248, 276, 297, 300) but not in the packet — ID validation strength and root-ownership derivation cannot be verified.
- The native `storage.get/set/scan` authority semantics (atomicity, key-order preservation, access control on `direct-private/v1/*` keys) are unknown; F4 severity depends on them.
- `ctx.rpc.register`/`directRpcDefinition` authorization scope is not shown — who may invoke submit/inspect is unverifiable.
- Whether `options.privateCapture` env/config can be toggled at runtime between capture and readback (stale owner-process configuration) cannot be determined from the packet.
### Acceptance gaps (not demonstrated defects)
- Automatic capture in the already-running original Codex MCP owner process is explicitly unverified (packet lines 235, 484); original team_moa/direct Codex flows do not use the Python helper.
- No demonstrated test that the extended key-exclusion set (F1) is exercised end-to-end.
- Directory-ownership attack (F2) and reconcile-abort path (F3) are unexercised; no negative tests shown.
- Digest-only oversized raw-envelope path (Python line 139) is implemented but untested per packet.
- No retention/deletion/rotation policy for `direct-private/v1/terminal/*`, failure records, or `*.json` digest files is shown.
- Stale environment in long-lived owner processes after `OPENCODE2_[REDACTED: private constant]` changes is acknowledged but not covered.
### Next useful action
Patch the shared credential-key normalization (both files, keep parity), add `st_uid` checks in `_store`, and add negative tests: unlisted-token-key receipt, foreign-owned capture directory, and oversized envelope.
No conflicting observations within the packet; review was direct (single-lane evidence analysis), no tools invoked, no files changed.claude-code-cli / claude-sonnet-5-5 / medium / medium effort answer
# Evidence packet: private-capture confidentiality and integrity review
Direct analysis of `security.packet.md` only. No team lanes, tools or file writes. Line numbers are packet lines. `validateInput`, `OpenCodeClient`, the storage backend and the Mission Control MCP schema are not in the packet and are treated as uncertain.
## 1. Actionable findings
**F1 – Medium: credential exclusion is an exact-match key denylist.**
- Evidence: native 3-4, 8-9; Python 18-20, 26-29. Keys are normalized, then matched exactly against a fixed set.
- The match misses `x-api-key` (→ `xapikey`), `authToken`, `idToken`, `sessionToken`, `secret`, `privateKey`, `accessKey`, `bearer`, and env-style names such as `OPENAI_API_KEY`.
- `token` is withheld only when its value is a string. Free-text values are never scanned, which the code acknowledges at Python 24.
- Trigger: a receipt, input or tool result carries `{"env":{"OPENAI_API_KEY":"…"}}` or `{"authToken":"…"}`. It is written to disk, and Python labels the envelope `exact`/`structured-credentials-withheld` (139-141), which gives false assurance.
- Fix: match on a normalized substring or regex (`secret|token|password|passwd|apikey|authorization|cookie|credential|privatekey|bearer|accesskey`). Explicitly allow counters such as `tokens`, `inputTokens` and `maxTokens`. Share one list between native and Python and test them with the same fixtures.
**F2 – Medium: native receipt stores raw input as `privateTaskContext`, unsanitized.**
- Evidence: native RPC 302 stores `privateTaskContext: input`, and `transition` persists it (240-241). `inspect` returns the receipt (346). Only the terminal snapshot (native 15) and Python (116) apply `privateEvidence`.
- Trigger: `privateCapture` is on and the submit input carries credential-like fields. They sit in the general request-key storage outside the 0700/0600 capture domain, and the sanitizer guards only the later snapshot copy.
- Whether `validateInput` rejects such fields is outside the packet.
- Fix: store `privateEvidence(input)` or only `inputHash`. The raw input is not needed for reconciliation.
**F3 – Medium: post-admission capture can throw and mask the native result.**
- Evidence: Python 116-119 (`[REDACTED: private constant]`, `.get` on payload/output) and the `record` build with `evidence_index` (120-130) sit outside the `try` that starts at 131.
- Trigger: the final `capture_[REDACTED: private constant](method, payload, output)` at 222 runs after the native call has succeeded. Deeply nested output hits `RecursionError` in the unbounded `[REDACTED: private constant]` recursion (the depth guard exists only in `evidence_index`). A non-dict payload raises `AttributeError` at 118. The exception propagates out of `_direct_rpc`, so the caller loses `runID` and state for an already-admitted submit and may replay it.
- The response-envelope capture at 215 may preserve the data, but the caller cannot see it.
- Fix: move lines 116-130 inside the `try`. Add a depth bound to `[REDACTED: private constant]`. Wrap the 222 and 218 calls so a capture failure returns `capture-failed` status and never replaces the native output.
**F4 – Low/Medium: no request/run binding check.**
- Evidence: Python 118-119 prefers `output.requestID` over `payload.requestID`. `_direct_rpc` (216-223) never compares the two. `nativeBattleID` can also come from caller-supplied `payload.runID`.
- Trigger: a stale, misrouted or replayed reply is filed under the reply's ID and returned as the answer to this request.
- Fix: if both IDs are present and differ, record both with `bindingMismatch: true`, set `reconciliationRequired`, and raise `BridgeError`.
**F5 – Low: retries are indistinguishable.**
- Evidence: Python records contain no time, attempt or sequence (120-130), and the filename is the content digest (53-54, 54).
- Trigger: two identical `submit-before` or `-response` captures from a replayed or uncertain submit collapse into one file. The retry count cannot be proven, which matters for the no-replay fence.
- The docstring says "each native battle ID groups snapshots", but the layout is flat digest names with no requestID or run prefix, so lookup requires scanning contents.
- Fix: add an attempt nonce and monotonic time to the record (the digest changes accordingly), or write a per-request sidecar index.
**F6 – Low: oversize and truncation behavior loses evidence.**
- Evidence: Python 51-52 raises when the record exceeds 8 MB, and the failure record is identity-only (152-155). The raw envelope is digest-only above 2 MB (139-140). The digest covers the sanitized form (135-137).
- The "exact" coverage label means exact parsed JSON, not wire bytes. A truncated or non-JSON body raises in `client.request` (209-212), leaving only the exception class name.
- Trigger: a large `needs-collection` or terminal output. The Python side keeps nothing. Native holds the receipt, but the F6 gap is that the bridge capture is then silently weaker.
- Native 27 behaves the same way: identity-only failure above 8 MB.
- Fix: spill oversized content to a separate digest-named file, or record the wire byte length and HTTP status at the client layer. Rename the label to `parsed-json-exact`.
**F7 – Low: directory and file hardening gaps.**
- Evidence: Python 41-49, 55-68, 157-159.
- Only the final path component is checked for symlinks. There is no `st_uid == geteuid()` check, and `mkdir(parents=True)` creates intermediate directories with umask defaults.
- A relative `OPENCODE2_[REDACTED: private constant]` resolves against the bridge's cwd.
- `os.link` fails on filesystems without hardlinks (exFAT/SMB under `/Volumes`), so every capture there becomes a failure. A pre-existing 0755 fallback directory makes the failure log fail with `logged=False`.
- Files are 0600, not read-only, so immutability is by naming and write-time readback only.
- Same-user path substitution is mostly mitigated: `O_NOFOLLOW` at 68 and 78, and a planted destination symlink makes `os.link` raise `FileExistsError`, which falls through to the NOFOLLOW open. The residual risk is a same-user adversary.
- Fix: require an absolute path, check the owner, and fall back to `O_CREAT|O_EXCL` when `link` is unsupported. Optionally set 0400 after the write.
**F8 – Low: reconnect/reconciliation load and ordering.**
- Evidence: native 406-408, 431-433, 242-243.
- Every `server.connected` and every execution event rescans all requests. For each terminal one it re-serializes, hashes and reads back up to 8 MB, outside `exclusively`.
- In `transition`, snapshot capture is awaited before waiters are woken and the event is emitted, so slow storage delays completion signals.
- Fix: skip requests already verified (an in-memory digest set), and run capture after `wake()`/`emit`.
## 2. Acceptance gaps (not demonstrated defects)
- **Stale owner process.**
- Python reads the env on each call (113), so a stale owner MCP process silently returns `{'state':'disabled'}` inside `privateCapture`, with no hard failure.
- The native `options.privateCapture` flag is independent of the Python env, so the two sides can disagree.
- Original `team_moa` and direct Codex writer flows do not call the helper. No automatic capture completeness is claimed or shown.
- **Native admission states have no private snapshot.** Only `completed` and `terminal-incomplete` are captured (native 21). `admission-uncertain` and `admission-rejected`, the most reconciliation-critical states, are covered only by the mutable receipt plus Python's `-response` captures.
- **Native failure records are write-only.** `direct-private/v1/failure/*` records are never cleared or surfaced by `readTerminalCapture` (43-57). A later success leaves the stale `reconciliationRequired` record in place.
- **No tamper evidence beyond the same trust domain.** The native snapshot and the receipt share one storage. The digest is anchored externally only if the Python capture of an `inspect` response includes `privateTerminalCapture`.
- **`reconciliationRequired` is false for non-terminal `running` and `needs-collection`** on the final method capture (Python 146-148). This is only a labeling gap.
- **Unverified items.** `validateInput` field filtering, the `client.request` size and timeout behavior, and the storage `set` overwrite semantics are outside the packet.
## 3. Discarded hypotheses and likely false positives
- A symlinked final directory or destination is handled by the `is_symlink` check and `O_NOFOLLOW`.
- A leftover temp file is cleaned by the `finally` at 66-67. After a crash it is a 0600 file only.
- The native get-then-set race is benign because the key is content-addressed. A differing existing value triggers a readback failure and is not overwritten.
- Exception messages are intentionally not logged (151).
- `headers` is withheld at all nesting depths in both implementations.
- Returning the unsanitized native `output` to the caller is consistent with existing behavior and is not a new leak.
## 4. Next action
Fix F1-F3 first. They are small and local: a shared sanitizer test with credential-name fixtures, `try` scope and depth bounding in `capture()`, and sanitizing `privateTaskContext`. Then add the F4 binding check and the F5 attempt nonce. Verify the stale-owner and oversized-envelope gaps with targeted tests on the owner MCP restart path.
MATERIAL_EVIDENCE_CONFLICT: none. The only tension is the docstring claim at Python 110, "each native battle ID groups immutable snapshots", against the flat digest-only layout at Python 54, which is covered in F5.Primary judge's stated reason
Forced, weak preference for B because its treatment of oversized capture is less likely to prompt unnecessary remediation based on unobserved transport behavior. This is not an established material quality gap; A offers valuable additional Python failure-path analysis, and an independent review could reasonably prefer it.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 363476d6-e8c0-4ffc-9edf-97ef2eef4154. Pair: brp1_bbdd4d5dd735d461cba1e06ef817d634c2402a7971d690cfe8daa12af34c19fe. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.