Problem
Both author backends run inside apptainer exec --containall --cleanenv with full host network (no --net), bash/command execution enabled, and their provider API key in-env. This is required for the author to reach the model API and to build/test — but it means a subverted author (e.g. prompt-injection from the target tree) could exfiltrate its API key or workspace contents to an arbitrary host.
This is the pre-existing posture of the author role (the reviewer is already read-only + sanitized). Surfaced by terra's second opinion on #121 (codex --sandbox danger-full-access), which brought codex to parity with the Claude author rather than introducing the gap.
Goal
Restrict author network egress to only what the author legitimately needs (the model API host, the git remote for the target/PR), denying arbitrary hosts — covering both the Claude and codex authors uniformly (a shared apptainer-invocation layer, not a per-backend bandaid).
Options to evaluate
- Egress allowlist proxy: run the author with
--net in a fresh netns whose only route is an HTTP(S) proxy that allows the API host + git remote and denies the rest; inject HTTPS_PROXY. Handles TLS via CONNECT allowlist.
- netns + nftables/iptables egress rules: allow the API/CIDR set, drop the rest. Simpler than a proxy but IP-based (API hosts rotate IPs) — likely brittle.
- Confirm the reviewer path stays unaffected (already read-only/tokenless where possible).
Non-goals
- Not a codex-only fix.
workspace-write's command-level net isolation is non-functional here (needs bwrap, absent) and would leave the Claude author unhardened anyway.
Context
- Author harnesses:
ClaudeCodeHarness, CodexHarness in src/autoresearch/harness.py — neither passes --net.
- Both wrap in
apptainer exec --containall --cleanenv with --home + workspace binds and APPTAINERENV_* for the key.
- Related: instruction-smuggling hardening (
--bare/sanitize on the reviewer), the pull_request_target fork-PR exfil concern.
Problem
Both author backends run inside
apptainer exec --containall --cleanenvwith full host network (no--net), bash/command execution enabled, and their provider API key in-env. This is required for the author to reach the model API and to build/test — but it means a subverted author (e.g. prompt-injection from the target tree) could exfiltrate its API key or workspace contents to an arbitrary host.This is the pre-existing posture of the author role (the reviewer is already read-only + sanitized). Surfaced by terra's second opinion on #121 (codex
--sandbox danger-full-access), which brought codex to parity with the Claude author rather than introducing the gap.Goal
Restrict author network egress to only what the author legitimately needs (the model API host, the git remote for the target/PR), denying arbitrary hosts — covering both the Claude and codex authors uniformly (a shared apptainer-invocation layer, not a per-backend bandaid).
Options to evaluate
--netin a fresh netns whose only route is an HTTP(S) proxy that allows the API host + git remote and denies the rest; injectHTTPS_PROXY. Handles TLS via CONNECT allowlist.Non-goals
workspace-write's command-level net isolation is non-functional here (needs bwrap, absent) and would leave the Claude author unhardened anyway.Context
ClaudeCodeHarness,CodexHarnessinsrc/autoresearch/harness.py— neither passes--net.apptainer exec --containall --cleanenvwith--home+ workspace binds andAPPTAINERENV_*for the key.--bare/sanitize on the reviewer), thepull_request_targetfork-PR exfil concern.