← Model losses

Head-to-head comparison

openai / gpt-6-luna / low / low effort preferred over xai / grok-4.7-efficient / 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.

openai / gpt-6-luna / low / low effort answer

## Actionable findings

**Medium — Credential-shaped strings in free text are not redacted.**  
The native and Python filters redact selected structured field names, but leave string values untouched (`security.packet.md:8–15`, `86–100`). The Python capture stores task input, native receipt, transport failure, and—when within limit—the sanitized raw envelope (`:184–198`, `:200–211`). A credential included in a question, output, error, or another unrecognized field can therefore be retained in the private capture. The code describes free text as private evidence, so this is a confidentiality risk if callers can supply secrets there. **Smallest remediation:** warn callers not to include credentials and/or add a narrowly scoped detector/redaction policy for credential-shaped free-text values before persistence.

**Medium — Python capture directory has a symlink/TOCTOU substitution window.**  
`_store` checks `directory.is_symlink()` before resolving, then performs later path-based operations (`:107–117`). An attacker able to modify the directory’s parent between that check and use could substitute the resolved path or a component; the final `O_NOFOLLOW` checks protect only the final opened component, not the full path (`:123–147`). **Trigger:** concurrent filesystem access by an actor with write permission to a path component. **Smallest remediation:** anchor operations to a trusted directory file descriptor and use descriptor-relative, no-follow operations; ensure parent components are trusted.

**Low — Oversized raw envelopes lose their content digest.**  
For raw envelopes over 2 MB, the capture records a digest of the entire serialized envelope but sets `rawEnvelope` to `None` and labels coverage `digest-only-over-limit` (`:200–210`). This avoids storing an oversized payload, but does not bound serialization work or memory before the size check, and the digest alone cannot recover or inspect the omitted evidence. **Smallest remediation:** enforce a bounded serialization/input size before materializing the complete canonical JSON, and explicitly treat over-limit envelopes as incomplete evidence requiring reconciliation. The existing response path does mark response captures for reconciliation (`:212–217`).

## Not demonstrated defects / acceptance gaps

- **Credential-field coverage is not complete by proof.** The explicit key list omits plausible aliases such as `secret`, `bearer`, and provider-specific names (`:8–14`, `:86–100`). Whether those occur in these receipts is not shown; do not treat their presence as established.
- **Native capture’s size and failure behavior are unclear.** It bounds serialized terminal evidence at 8 MB and attempts identity-only failure retention, but storage permissions, atomicity, and enforcement are delegated to the native storage authority (`:24–43`). No defect is established from this packet.
- **Owner-process integration is unverified.** The packet explicitly says the already-running original Codex MCP process has stale environment/schema and automatic Python capture there is unverified (`:235`, `:484`). This is a capture-completeness gap, not evidence of credential leakage.
- **Request binding and reconnect behavior have positive evidence.** Requests are bound by `inputHash`; reuse with a different payload is rejected (`:308–310`). Uncertain submissions are not automatically retried; inspect/reconciliation uses durable receipts, ownership/session checks, and exact run matching (`:275–304`, `:305–306`). Reconnect subscribes before reconciliation and provides explicit advance recovery without relaunch (`:387–429`). No replay defect is demonstrated.
- **Immutable naming and failure retention are evidenced, with limits.** Python snapshots use content-hash filenames, exclusive hard-link creation, restrictive file modes, and readback verification (`:121–151`); native snapshots include the digest in the key and verify readback (`:27–35`). Python capture failures retain identity-only metadata when fallback storage succeeds (`:218–232`); native failure evidence is best-effort (`:36–43`). Fallback availability and native storage guarantees are not independently demonstrated.
- **Transport surfaces are limited but include private data.** The bridge sends authenticated loopback RPC and captures pre-request input, response envelope, and decoded output (`:443–467`). The packet asserts no auth/provider changes (`:235`), but does not show the transport implementation or prove the security properties of the authenticated loopback client.

**Next useful action:** validate the free-text credential policy and harden path operations; separately verify capture behavior in a fresh owner process and establish the native storage authority’s permission/atomicity guarantees.

xai / grok-4.7-efficient / medium / medium effort answer

The capture boundary fails closed on replay, but credential exclusion is bypassable on the normal write path and Python failure handling drops already-computed integrity anchors. Four defects are actionable; stale owner configuration is not a demonstrated leak.

## Actionable findings

**1. High — structured credential exclusion fails open.** Both denylists omit common names (`secret`, `privatekey`, `jwt`, `bearer`, `sessiontoken`, `idtoken`). A normalized key matches only the fixed set; `token` is not in that set and is withheld only when `key.lower() == 'token'` and the value is a string. Object or array `token` values are recursed, so nested `jwt`, `value`, or `secret` fields are stored. Prefixed keys such as `x-api-key` normalize to `xapikey` and miss `apikey`. String and non-dict envelopes are stored unchanged.

Evidence: `native/private-capture.js` lines 3–9; `bridge/[REDACTED: private constant].py` lines 18–32 and 132–140. `terminalEvidence` and `capture` then persist the walked object (`private-capture.js` lines 12–16 and 22–29; `[REDACTED: private constant].py` lines 116–130 and 144).

Trigger: a terminal receipt, direct payload, or raw RPC envelope contains `token: {jwt: "..."}`, `secret`, `[REDACTED: private constant]`, or `x-api-key`. The success path writes those values into the private snapshot. Durable storage is worse: redaction never runs on the primary receipt.

Smallest remediation: one shared normalized denylist; withhold the whole value on match regardless of type; also match normalized suffixes `token`, `secret`, `password`, `apikey`, and `credential`. Apply that helper before any durable or snapshot write.

**2. High — enabling private capture stores and returns unredacted input.** On `options.privateCapture === true`, the full client `input` is copied to `privateTaskContext` and committed with `storage.set` before the snapshot helper runs. `privateEvidence` is applied only inside `terminalEvidence` to a separate object. `inspect`, `submit`, `advance`, and `cancel` return that durable receipt. The bridge then spreads the original `output`, not the redacted copy.

Evidence: native direct RPC lines 302, 240–242, 273–275, and 340–346; bridge helper line 223.

Trigger: private capture is on and `input` or engine `admission` or `result` contains a credential field, including one the denylist would have caught. It remains in scoped request storage and in the authenticated RPC response. Turning the flag on increases retention relative to the question-only receipt.

Smallest remediation: redact `input` before assigning `privateTaskContext`, and do not return that field on RPC. Keep the unredacted task context only in the private snapshot store after finding 1 is fixed.

**3. Medium — Python capture path checks do not pin the directory they write.** `is_symlink()` covers only the leaf. `resolve()` follows parent symlinks. The repo check and `stat()` mode check are not tied to a directory fd. `stat()` follows symlinks. `O_NOFOLLOW` is used only after `NamedTemporaryFile` and `os.link`. Relative `OPENCODE2_[REDACTED: private constant]` or `OPENCODE2_CAPTURE_FAILURE_DIR` is resolved against the process cwd. The temp file is created with the process umask and chmodded to `0o600` only afterward.

Evidence: `bridge/[REDACTED: private constant].py` lines 39–49 and 53–68; failure directory selection at lines 157–159.

Trigger: a parent component of the capture or failure directory is a symlink, or the leaf is replaced after the symlink check, pointing at a traversable directory or a repo. Writes follow that path. A local observer can open the temp name before `fchmod` if the substituted directory is traversable and umask leaves group or other read. A same-user redirect into a repo defeats the `.git` check via that race and can later be committed.

Smallest remediation: reject non-absolute paths; walk with `O_NOFOLLOW`; `open` the final directory `O_DIRECTORY|O_NOFOLLOW`; require mode `0o700`, matching uid, and a regular non-repo directory; create the temp file `O_EXCL|O_NOFOLLOW` with mode `0o600` on that dirfd before writing.

**4. Medium — Python failure retention and response binding drop or mis-file evidence.** The `except` block builds an identity-only failure record and discards `record`, including `rawEnvelopeEvidence.sha256` already computed in the `try`. The failure file digest is not returned. Separately, `runID` and `requestID` prefer the response over the submitted payload when both exist. Python filenames are content digests only, so a mis-bound snapshot is not request-scoped on disk. Native failure keys do retain `snapshotDigest` (`private-capture.js` lines 34–37); Python does not.

Evidence: `bridge/[REDACTED: private constant].py` lines 118–119, 132–144, and 150–164; bridge call at helper line 222.

Trigger: `_store` raises after an oversized or secret-bearing envelope was hashed (combined record over 8,000,000 bytes, readback mismatch, or unsafe directory). Reconciliation is left with no digest. Or the RPC `output` carries a different `requestID` or `runID` than the payload; the lifecycle snapshot is labeled with the response identity and can be reconciled to the wrong battle.

Smallest remediation: on failure, persist `requestID` from the caller, `errorClass`, raw-envelope sha256, and serialized length, and return those digests. If both sides have an ID, require equality and otherwise fail closed. Bind the record to the caller ID.

## Acceptance gaps (not demonstrated defects)

- The stale Codex MCP process with old env or schema is an unverified capture gap. Both gates fail silent: the native code returns when `enabled` is not strictly `true`, and Python returns `disabled` when `OPENCODE2_[REDACTED: private constant]` is unset (`private-capture.js` line 21; `[REDACTED: private constant].py` lines 113–115; packet lines 235 and 484). That is missing evidence, not a shown credential leak.
- Free text is intentionally retained, including `question`, `error` (native RPC line 334, sliced to 2000 characters), and `text`. Credential-shaped strings in those fields are a residual policy risk.
- Native snapshots cover only `completed` and `terminal-incomplete`. `admitting` and `admission-uncertain` are not snapshotted, and reconcile or advance will not move them (native RPC lines 354–355 and 408–410). Recovery depends on `inspectUnsafe` plus engine helpers not in this packet.
- The admission-diagnostic RPC is not captured (bridge helper lines 226–236). `publicationAllowed: false` is stored but not enforced here.
- The native storage permissions, `validID`, `KEY`, `inputHash`, and `OpenCodeClient.request` shape are outside the packet. The integration claim of directory `0700` and file `0600` is not visible in the JS capture path.
- `evidence_index` stops after 4096 path characters or 64 segments (`[REDACTED: private constant].py` lines 89–90). Full `input` and `nativeReceipt` copies remain. Digests are not comparable across native `JSON.stringify` and Python canonical JSON.
- Non-dict `output` is silently replaced with `{}` (`[REDACTED: private constant].py` line 117). The shown bridge success path avoids that with `isinstance(..., dict)`.

## Alternatives and discarded hypotheses

- I did not treat a pre-created leaf symlink in `/tmp` as a bypass. `is_symlink()` rejects that leaf. The gap is parent symlinks and the check-to-write race.
- I did not treat `events.emit("changed", ...)` as a credential leak. The payload is only sequence, request ID, and state (native RPC line 244).
- I did not treat JSON key-order readback mismatch as a defect. The packet states native readback was verified, and storage round-trip semantics are not in the packet.
- I did not treat returning the RPC `output` to the direct caller as itself a leak. The caller needs the result. The defect is the unredacted durable copy and the weak snapshot denylist.
- `coverage: digest-only-over-limit` omits a sanitized label, but `structuredCredentialsWithheld` remains set (`[REDACTED: private constant].py` lines 139–141). That is not an independent defect.

## Missing evidence

`validID`, storage key prefix `KEY`, hash inputs, `validateInput`, engine launch, status, and collect shapes, and the storage implementation are not in the packet. I cannot confirm request-ID key traversal, whether reconcile’s scan is cross-workspace, or that live replies actually contain the weak field names. Consequence: findings 1 and 2 are proven write-path defects; exploitability in production traffic depends on those unseen object shapes. The symlink finding does not depend on them.

## Next useful action

Patch findings 1–4 in the snapshot helpers and the durable `privateTaskContext` assignment, then add tests for object-valued `token`, suffix keys, response ID mismatch, failure-record digest retention, and a parent-symlink capture directory. Do not inspect live credentials or treat a stale owner process as a leak.

Primary judge's stated reason

The forced, weak preference is A because its central filesystem trigger is more carefully bounded and avoids B's unsupported temporary-file disclosure scenario. B's additional durable-retention analysis is substantial counterevidence. This is not an established material quality difference, and an independent review could reasonably favor B's broader tracing.

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_580cb4d12b5e71b54d41a78e4263276852b33c9d0e0f35a5656feb364469c52f. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.