Skip to content

Add opt-in transparent TCP routing for Linux sandboxes - #61372

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/96bd7726e5369efceb65320face56aa85ae3deb8
Nov 13, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/96bd7726e5369efceb65320face56aa85ae3deb8

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Add opt-in transparent TCP routing for Linux sandboxes

Why

Native TCP clients need to reach managed network destinations without implementing proxy support themselves.

What changed

  • Add --transparent-tcp to the Linux sandbox command, using a bundled TCP stack, private TUN interface, and DNS stub to route native IPv4 and IPv6 connections through the attributed managed SOCKS proxy.
  • Preserve original hostnames for proxy policy checks and cancel pending approval connections when their native sockets close.
  • Expose --linux-sandbox-transparent-tcp and --tcp-upstream-proxy on codex exec-server for transparent routing and a mandatory HTTP CONNECT next hop without direct fallback.
  • Require private network and PID namespaces, private procfs, system bwrap, and access to /dev/net/tun; reject incompatible launcher options and untrusted proxy ports.

Testing

Add integration coverage for native hostname and IPv6 connections, SOCKS attribution, pending connection cancellation, policy denials, and filesystem and host-loopback isolation. Extend launcher and executor tests for option validation and managed-policy propagation.

## Why

Native TCP clients need to reach managed network destinations without implementing proxy support themselves.

## What changed

- Add `--transparent-tcp` to the Linux sandbox command, using a bundled TCP stack, private TUN interface, and DNS stub to route native IPv4 and IPv6 connections through the attributed managed SOCKS proxy.
- Preserve original hostnames for proxy policy checks and cancel pending approval connections when their native sockets close.
- Expose `--linux-sandbox-transparent-tcp` and `--tcp-upstream-proxy` on `codex exec-server` for transparent routing and a mandatory HTTP CONNECT next hop without direct fallback.
- Require private network and PID namespaces, private procfs, system `bwrap`, and access to `/dev/net/tun`; reject incompatible launcher options and untrusted proxy ports.

## Testing

Add integration coverage for native hostname and IPv6 connections, SOCKS attribution, pending connection cancellation, policy denials, and filesystem and host-loopback isolation. Extend launcher and executor tests for option validation and managed-policy propagation.

GitOrigin-RevId: 96bd7726e5369efceb65320face56aa85ae3deb8
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/96bd7726e5369efceb65320face56aa85ae3deb8 branch from 54c1189 to 7194b21 Compare November 13, 2026 20:25
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-13T20:25:04.033539Z 54c1189 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.

@copyberry
copyberry Bot merged commit 7194b21 into main Nov 13, 2026
12 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/96bd7726e5369efceb65320face56aa85ae3deb8 branch November 13, 2026 20:25
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 7194b217 Deployed Nov 13, 2026 by konard via Identify potential duplicates (open issues fallback) #63365
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants