Skip to content

feat(delivery): Frame untrusted peer messages at native boundaries - #285

Merged
abruption merged 3 commits into
mainfrom
abruption/v110-framing-232-20261009
Oct 9, 2026
Merged

abruption merged 3 commits into
mainfrom
abruption/v110-framing-232-20261009

Conversation

@abruption

@abruption abruption commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refs #232 (v1.1.0).

  • Frame peer text at the destination's native transport boundary, including local, streamed SSH, MCP and paired-device delivery. Sender metadata suppression and internal base64 input cannot disable the receiving frame.
  • Quote every body line, escape control characters/alternate line separators, and distinguish unverified From/Reply-To/session claims from receiver-authenticated TLS device-key fingerprints. A body marker never bypasses framing.
  • Keep Claude Code's native permission warning rather than duplicating it. The additional compact frame identifies unverified metadata and quotes the body.
  • Carry paired TLS context only through private native-worker input and the WSL bridge's streamed source; expose no fingerprint/asserted-trust CLI option or environment override.
  • Check the fully framed Codex/native text and paired 32 KiB budget before native submission, and before paired journal admission. Preserve native JSON submission/consumption fields and actual framed chars across SSH.
  • Address the automatic review's Windows-budget finding: share the Codex argv builder, check both the raw Python command and the fully framed Codex command (quoting, Unicode and terminating NUL included), and refuse before native execution. Ordinary Windows queue/dry-run has the same preflight guard.
  • Document the trust, Reply-To and byte-budget boundaries in English, Korean, Japanese and Simplified Chinese.

Type

  • feat
  • fix
  • docs
  • chore / refactor / test / perf (regressions and generated standalone)

Checklist

  • Synthetic local/streamed SSH discovery and dry-run fixtures
  • Forged header/delimiter/control-character and exact framed-byte boundary fixtures
  • Paired loopback TLS/native-inbox fixtures, rotated key vs stable principal, no journal/worker effect on overflow
  • Streamed native bridge context fixture (run on macOS, not real Windows)
  • Conventional Commit and regenerated standalone
  • Four-language CLI, receiver and MCP docs; i18n hashes
  • No credentials, user/session identifiers, authority bypass, live model send or operating-service changes
  • Separately released companion skill wording and subsequent exact snapshot sync (not silently edited here)

Verified against

macOS arm64; dependency-free core/docs checks on Python 3.14.8 and an isolated worktree Python 3.13.7 environment with test-only packaging 26.3, cryptography 50.0.2, websockets 17.2 and MCP 1.30.0. These dependencies were installed only in this worktree, not the user's/shared runtime.

Local checks include standalone generator, docs/i18n/link/command tests, core/adapter/queue fixtures, receiver byte budgets and real loopback socket/TLS fixtures. No actual Claude/Codex/Antigravity model session or remote machine received a message. Windows bridge context is synthetic; Windows-native API/platform acceptance remains CI/manual review, not a claim from macOS tests.

  • .venv/bin/python -X dev -W error::ResourceWarning -m unittest discover -s tests -t . -q: 802 tests, 12 expected skips, zero failures/errors; final strict run completed without ResourceWarning or asyncio AssertionError.
  • Core-only Python 3.14.8: 352 tests, two expected skips; adapter suite: 35 tests; docs suite: 32 tests.
  • python3 tools/generate_session_peer.py --check and git diff --check: pass.
  • Review correction: 47 focused bridge/framing/queue tests passed; the Windows guard's additional focused test passed (nine framing tests total). A subsequent strict full run passed 803 tests with 12 skips; it emitted the previously observed asynchronous server-accept/teardown diagnostic despite zero unittest failures. This is a fixture lifecycle limitation, not a claim of warning-free platform acceptance.
  • Earlier runs found raw-text fixture expectations and a noncanonical synthetic fingerprint; these were corrected. One earlier full run emitted the historical asyncio server-accept/teardown AssertionError/ResourceWarning; no teardown code was changed and the final strict run did not reproduce it. The first shared environment lacked test-only packaging; validation then moved to the isolated environment above.

Notes

Framing changes the presentation and delivered character count; it does not make an agent immune to prompt injection, authenticate a local/SSH sender session, grant permissions, authenticate a person via a device key, confirm consumption, or authorize a third-party reply. Existing Reply-To v1 parsing and ordinary native JSON field absence/ACK semantics remain intact. Direct native CLI/API calls outside session-peer are not covered by this framing.

The companion skill is managed and released independently. Its exact compatibility snapshot remains unchanged; #232 stays open for that documented acceptance item and final review. No merge, tag, release, package publication, operating-service change or frozen handoff-contract edit is included.

@abruption abruption added this to the v1.1.0 milestone Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T00:10:55.939772Z 54c3f5b PR opened
🔒 Security Review ✅ Completed 2026-10-09T00:11:07.016561Z 54c3f5b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54c3f5bfda

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if peer_fingerprint is not None:
# Receiver-controlled code travels on private stdin; never add an
# argv/env/body switch that lets a sender assert authenticated identity.
core.peer_delivery_message('', 'codex', peer_fingerprint)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Budget the framed Windows Codex command line

When a WSL paired-device message contains many escaped controls or line breaks, this call validates that the final frame fits 32 KiB but does not check the Windows command line that the streamed core subsequently uses to launch codex.exe; the earlier command_units calculation covers only the much shorter unframed Python argv. For example, 5,361 \x01 characters produce an accepted 32,767-character frame but an inner Codex command of about 32,861 UTF-16 units, so CreateProcessW fails before Codex starts and the bridge incorrectly reports native_outcome_unknown. Compute the limit from the final framed Codex argv so this is refused deterministically before launching the native worker.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the latest head: the shared Codex argv builder now budgets the fully framed inner command as well as the raw Python bridge command before native execution. Both send and resolve cover expanded controls/newlines, quoting and Unicode path boundaries, with known refusal and no launch on overflow. Ordinary Windows queue/dry-run uses the same guard. Focused fixtures passed; the strict full suite passed with the separately noted existing asynchronous teardown diagnostic. These are synthetic macOS checks, not live Windows delivery evidence.

@abruption
abruption merged commit 718f6d2 into main Oct 9, 2026
28 checks passed
@abruption
abruption deleted the abruption/v110-framing-232-20261009 branch October 9, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant