Repository navigation
[2743 by Claude Opus 5.5] Restricted network egress for agent containers via a per-run host proxy - #2847
Conversation
…check pass, the unit, UI and e2e tests pass, and I ran the existing test files most likely to be affected. But Docker isn't available here, so it has never been run against a real agent container. The Docker integration test (`test/egressProxyContainerSmoke.test.ts`) skips without Docker and an agent image, and the full repository suite wasn't run.
How it works
- When a run is restricted, the worker starts an allowlist proxy for each agent container. It listens on a Unix socket in its own directory (default `/tmp/propr-egress/<id>/`). Each container has its own socket, so there are no ports to collide.
- The container gets `--network none`, the socket directory mounted read-only, and `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY` plus git's `http.proxy` set. There is no `--privileged` and no `NET_ADMIN`.
- A small bridge inside the container makes the socket reachable at `127.0.0.1:3128` before setup hooks and the agent start. I ran it outside Docker against a live proxy: an allowed request went through, and a denied CONNECT got 403 and was recorded.
- DNS is resolved by the proxy on the worker. Wildcards like `*.example.com` match subdomains only, entries can carry a port (otherwise only 80/443), and IP addresses are denied unless listed exactly.
- Every Docker run goes through one place, so all agents are covered there. A proxy closes when its container exits, and running jobs drain before proxies shut down at worker stop. The worker also removes socket directories left by crashed workers at startup and every 10 minutes.
Policy
- `.propr/workflow.yml` accepts `network: { mode, allow }`, validated in code and in the editor JSON schema.
- Instance settings `agent_network_mode`, `agent_network_mode_enforced` and `agent_network_allow` default from the `AGENT_NETWORK_*` env vars. They're available in the API, a new Settings → Automation → Agent network section, the CLI and MCP.
- A repository can tighten to restricted, or relax a non-enforced restricted default to open. When the instance enforces restricted, `mode: open` is ignored and the timeline says so; the repository's `allow` hosts still apply.
- If the stored policy can't be read, the run fails rather than running open.
Agent compatibility. Claude Code, Codex, OpenCode and Vibe are marked as supported based on their documented or library proxy behaviour, not live runs. Antigravity's sign-in and API traffic couldn't be confirmed, so it falls back to open networking with a timeline warning. When restricted mode is enforced, Antigravity runs are refused instead. That goes beyond the issue's plain "fall back", because an enforced policy shouldn't be silently bypassed.
Observability. Each run ends with one timeline event showing the mode, any fallback or refusal, and every denied host with its count. After 100 distinct hosts, the rest are still counted rather than dropped. The task detail shows this event.
Limitations to know about
- Restricted mode only applies to issue and PR-comment jobs. Goals, plan generation and indexing still run with open networking.
- The proxy checks hostnames only and doesn't inspect TLS. SSH remotes and other non-HTTP traffic have no route out.
- It needs a Linux Docker host that can see the socket directory at the same path. I added the `/tmp/propr-egress` mount to both Compose files and the launcher.
Other changes
- `scripts/init-firewall.sh` and all the "Skipping firewall setup" lines are removed. The `iptables` package is still installed in the agent image; removing it would also mean editing the licence notices.
- Docs are updated (execution safety, security overview, workflow file, agent runtime, config reference, generated settings locations), plus a CHANGELOG entry.
- I updated `@propr/core` mocks or expected settings responses in five existing test files so they match the new exports and settings fields.
Previews of the timeline event (desktop and mobile) and the new settings section were captured.
|
/ultrafix goal=8 max=5 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 5) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements restricted egress through isolated container networking and worker-side proxies, with settings and timeline reporting. It needs changes before merge: proxy cleanup is incomplete, the production Compose configuration omits the advertised policy variables, and sweeping can remove active proxies. ✅ Enforced policy resolution — An enforced restricted instance overrides a repository’s request for open networking and refuses unsupported agents. ✅ Container isolation — Supported restricted runs replace bridge networking with This was a static review; no commands were run. Current-head checks report 11 neutral/skipped results and no passed, failed, or pending checks. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Close plain HTTP upstream connections
F2: 🔴 Pass policy variables into production services
F3: 🔴 Preserve active proxies during sweeping
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise actual agent connectivityThe Docker smoke test checks curl and is skipped without explicit image configuration. A follow-up compatibility test for each supported agent’s provider traffic would strengthen the support claims, particularly across HTTP and WebSocket transports. This is optional additional validation; the supplied code does not establish an agent-specific connectivity defect. S2: 🟢 Align schema hostname validationThe editor schema accepts values such as ScoreThe isolation approach and integration are substantial, but lifecycle defects and a deployment configuration gap remain. The skipped checks provide no execution evidence to offset those findings. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 35c3218
Summary of ChangesI fixed all three findings. Each regression test fails on the old code and passes with the fix. The two core test files pass (15/15), the new Compose contract test passes, and the core typecheck passes. I didn't run the full repository suite, and as before there was no real agent container to run against. F1 – plain HTTP upstream connections (
F2 – production Compose (
F3 – sweeping active proxies (
Separate finding, not fixed: running ESLint from This isn't a visual change, so there's no preview. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used; this task didn't need them. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…he old code and passes with the fix. The two core test files pass (15/15), the new Compose contract test passes, and the core typecheck passes. I didn't run the full repository suite, and as before there was no real agent container to run against. I fixed all three findings. Each regression test fails on the old code and passes with the fix. The two core test files pass (15/15), the new Compose contract test passes, and the core typecheck passes. I didn't run the full repository suite, and as before there was no real agent container to run against. **F1 – plain HTTP upstream connections** (`packages/core/src/network/egressProxy.ts`) - The upstream socket for a plain HTTP request is now tracked the same way as CONNECT upstreams, so `close()` destroys it. - If the container's client disconnects before the response finishes, the proxy now cancels the upstream request. - New test in `packages/core/test/egressProxy.test.ts`: an upstream server sends one chunk and never finishes. The test checks that the upstream connection closes both when the client disconnects and when the proxy is closed mid-response. The client-disconnect case is the one that fails on the old code. The proxy-close case already passed before the fix, because closing the client's socket now also cancels the upstream. **F2 – production Compose** (`docker-compose.prod.yml`) - Both `worker` and `api` now forward `AGENT_NETWORK_MODE` (default `open`), `AGENT_NETWORK_MODE_ENFORCED` (default `false`) and `AGENT_NETWORK_ALLOW` (default empty). These defaults match the configuration reference. - New test `test/agentNetworkDeploymentContract.test.mjs` checks each service's block separately, following the pattern of the existing Web Push contract test. **F3 – sweeping active proxies** (`packages/core/src/network/egressExecution.ts`) - The sweep now skips any directory this process still owns before it applies the age check. - Each sweep first resets the timestamp on this process's own directories. Workers on other hosts only have the age check to go on, so a live worker's directories now stay fresh however long its run lasts. Directories from dead or crashed workers still expire after 48 hours, as before. - Timing: a directory is marked as owned before it is created, and it stays marked until it has been removed. So a sweep running at the same time can't catch one half-made or half-released. - New test in `packages/core/test/networkEgressExecution.test.ts`: an active run's directory is backdated past 48 hours and then swept. The test checks that the socket is still there, that the timestamp was refreshed, and that releasing the run still removes the directory. **Separate finding, not fixed:** running ESLint from `packages/core` reports `no-useless-escape` at `egressProxy.ts:73` (the regex in `parseAuthority`). That line hasn't changed in this run, and the root `lint` script only covers `src/`, so it never sees this file. This isn't a visual change, so there's no preview. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used; this task didn't need them. PR: #2847 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements restricted egress through isolated container networking and a worker-side proxy, with settings and timeline reporting. It needs a localized correctness fix before merge. ✅ Network isolation — Supported restricted runs replace bridge networking with ✅ Policy precedence — Enforced instance restrictions override repository requests for open networking, and unsupported agents are refused under enforcement. ✅ Lifecycle integration — Proxy release runs in the Docker execution’s No current-head check runs were reported. This review used static analysis only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F4: 🔴 Derive upstream Host from the target URL
SuggestionsThese are optional follow-ups and are not sent to S3: 🟢 Verify provider traffic through the proxyThe optional container smoke test exercises curl, while four agent CLIs are declared supported. Add compatibility coverage that exercises their actual provider transports, particularly streaming connections. This would strengthen the support claims; it is optional because the supplied code does not establish a specific provider failure. ScoreThe isolation approach, policy handling, and tests are substantial, but plain-HTTP authority forwarding needs correction. Runtime validation remains unconfirmed because no current-head checks were reported and this review was static. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit e52ace7
Summary of ChangesI fixed F4: the proxy now sends the target URL's host and port as the Host header for plain-HTTP requests, instead of passing on whatever Host the client sent. The fix ( Regression test (
Verification:
Same-defect check: among the files this PR changes, this is the only place that forwards HTTP headers. CONNECT tunnels copy raw bytes and never rewrite headers, so they don't have this problem. I found nothing else outside F4's scope to report. There are no visual changes, so I made no previews. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used. This task didn't need them. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ort as the Host header for plain-HTTP requests, instead of passing on whatever Host the client sent. I fixed F4: the proxy now sends the target URL's host and port as the Host header for plain-HTTP requests, instead of passing on whatever Host the client sent. **The fix** (`packages/core/src/network/egressProxy.ts:124`): after the hop-by-hop headers are removed, the outgoing headers set `host = url.host`, where `url` is the address that was checked against the allowlist. `url.host` keeps a non-default port (`vhost.example.com:8080`) and drops the default port 80. So the proxy now connects to, and names, the same allowlisted site. **Regression test** (`packages/core/test/egressProxy.test.ts`): the new test uses an upstream that routes by Host. It returns 421 for any Host other than the expected one. The client sends a wrong Host (`proxy.invalid`, `other.example.org`), and the test checks the request still reaches the right site in two cases: - with a non-default port, where Host must be `vhost.example.com:<port>`. - with the default port, where Host must be `vhost.example.com`. **Verification:** - The new test fails on the old code: with the fix commented out, it is the only failure (8 passed, 1 failed). - With the fix, all 9 tests in the proxy test file pass. - The core typecheck passes. **Same-defect check:** among the files this PR changes, this is the only place that forwards HTTP headers. CONNECT tunnels copy raw bytes and never rewrite headers, so they don't have this problem. I found nothing else outside F4's scope to report. There are no visual changes, so I made no previews. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used. This task didn't need them. PR: #2847 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements restricted egress using isolated container networking and a worker-side Unix-socket proxy, with configuration, lifecycle management, and timeline reporting. Based on the supplied code, it is merge-ready within the documented scope; no verified merge blocker was found. No current-head checks were reported, and this review was static only. ✅ Network isolation — Supported restricted containers receive ✅ Explicit enforcement — Enforced restricted mode overrides repository requests for open networking and refuses unsupported agents, recording the refusal. ✅ Lifecycle and observability — The executor releases proxies in Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S4: 🟢 Exercise actual agent connectivityThe container smoke test runs S5: 🟢 Align schema hostname validationThe pattern in ScoreThe implementation has coherent isolation, enforcement, cleanup, and reporting paths, with substantial targeted test coverage in the diff. Actual test execution and provider compatibility remain unverified in this static review; no current-head check failure or actionable defect is established. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
Local verification on head Two
Run |
|
✅ Applied the requested follow-up changes in commit f1bf018 Summary of ChangesI fixed both
The core typecheck ( Merge from There's nothing visual to preview, so I didn't create one. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
… behaviour. `cd packages/core && npx eslint . --max-warnings 0` now passes with no errors or warnings. I couldn't merge `main` into the branch, so it still conflicts. I fixed both `packages/core` lint findings without changing behaviour. `cd packages/core && npx eslint . --max-warnings 0` now passes with no errors or warnings. I couldn't merge `main` into the branch, so it still conflicts. 1. **`max-lines` in `dockerExecutor.ts`:** I moved the network-egress wiring into a new helper module, `packages/core/src/claude/docker/dockerNetworkPolicy.ts`, next to `dockerCostCap.ts` and `dockerExecutionWatchdog.ts`. Its one function, `startWithNetworkPolicy`, takes a callback that starts the container. That way it doesn't import `dockerExecutor.ts` back. The executor's two call sites now use it. The logic is the same as before: it starts the per-run proxy when the run needs one, checks for an abort, swaps in the rewritten `docker run` arguments, and shuts the proxy down in a `finally` block. The limit is unchanged. 2. **`no-useless-escape` in `egressProxy.ts:73`:** I removed the `\[` escape from the character class: `/^([^:[\]]+):(\d+)$/`. It matches exactly the same input. The core typecheck (`tsc --noEmit`) also passes. The five tests that cover this code passed (40/40): `egressProxy`, `networkEgressExecution`, `dockerExecutorLiveOutput`, `dockerExecutorWatchdog` and `networkEgressTimeline`. I didn't run the full suite. **Merge from `main`:** git in this workspace is read-only (fetching failed with `Read-only file system`). Please run `/merge` on the PR. The files changed on `main` don't include `dockerExecutor.ts` or `egressProxy.ts`, so this fix shouldn't add to the conflict. There's nothing visual to preview, so I didn't create one. PR: #2847 Comment by: @integry (ID: 6026336169) Model: Claude Opus 5.5
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved the merge conflict. What the conflict was about: both branches had changed the same one-line
How I resolved it: I kept the PR's version of the line, including the three new settings, and added Why: the two changes touched different fields and don't conflict in meaning. Taking either side whole would have lost something real: the network-mode settings from the PR, or the description from Checks:
The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. This task didn't need them. 🤖 Resolution Details
System-triggered merge conflict resolution |
…ed-network-egress-20261006-2103-yel Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - packages/api/mcp/toolsManagement.ts PR: #2847 Model: Claude Opus 5.5
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryAll four conflicts are resolved and no conflict markers remain anywhere in the repo. While checking, I also found and fixed a fifth problem that git merged without flagging. Typecheck passes for the root, The conflicts all came from the same cause: this PR adds restricted network egress, and
I couldn't run The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used. This task didn't need them. 🤖 Resolution Details
System-triggered merge conflict resolution |
…ed-network-egress-20261006-2103-yel Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - CHANGELOG.md - packages/api/mcp/toolsManagement.ts - propr-ui/src/components/TaskDetails/TaskStatusTable.test.tsx - propr-ui/src/pages/SettingsPage/parseLoadedData.ts PR: #2847 Model: Claude Opus 5.5
|
CI failed: CodeQL Please investigate and fix this CI failure.
Failure evidence
|
|
/review fable astra |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — fableOverall EvaluationThis PR implements issue #2743: a per-run, per-container HTTP/CONNECT allowlist proxy on the worker, reached from a All current-head checks pass, including the new "Restricted network container smoke" job that runs real agent CLIs (Claude, Codex WebSocket/SSE, OpenCode, Vibe) behind the proxy. I traced the executor, native-goal spawn, review, goal and indexing entry points, proxy lifecycle on success/abort/timeout/spawn failure, and the sweeper's ownership rules, and found no demonstrable regression. The PR is merge-ready within scope; the items below are follow-ups. ✅ Private-address boundary is correct and tested — ✅ Proxy lifetime is bound to the container on every path — ✅ Fail-closed where it matters — Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S23: 🟢 Non-enforced restricted mode leaves unscoped agent launches open
S24: 🟢 Verify indexing summarization containers carry the wrapper
S25: 🟢
|
🔍 AI Code Review — astraOverall EvaluationThe PR implements restricted egress through isolated container networking and worker-side proxies, with substantial configuration, reporting, and test coverage. It needs a localized connectivity correction before merge. ✅ Network isolation — Restricted containers use ✅ Address checks — Direct connections use vetted DNS results, and repository allowlist entries cannot independently authorize private addresses. ✅ Integration coverage — Tests cover policy precedence, cleanup, cancellation, native sessions, and real container/provider transports. The supplied current-head checks report no failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F7: 🔴 Try alternate vetted DNS addresses
SuggestionsThese are optional follow-ups and are not sent to S30: 🟢 Log indexing upstream failuresIn S31: 🟢 Allow an explicit empty overrideThe settings UI converts an empty allowlist draft to ScoreThe implementation and passing checks provide strong coverage, but selecting only the first DNS address introduces an availability regression for restricted runs. The required correction is localized. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/fix all |
|
✅ Applied the requested follow-up changes in commit 0993912
Summary of ChangesI've applied F7 and S23–S31. The new F7 tests fail on the old proxy code and pass on the new. About 200 affected tests pass, but the 7 Docker tests skip here (the provider-egress and container-smoke suites), so none of this has run against a real agent container. Lint and typecheck are clean for core, root and UI, except one complexity warning in core's F7 – trying alternate DNS addresses
Suggestions
I updated Visual previewAllowed hosts: environment defaultSettings → Automation → Agent network with no stored list: the new Allowed hosts list control shows the environment default (2 hosts), whose hosts appear as the textarea placeholder. Original unavailable: managed storage is unavailable or the upload has expired. Explicit empty custom listA stored empty list ([]) is shown as a Custom list, distinct from the environment default. Original unavailable: managed storage is unavailable or the upload has expired. Invalid allowlist entry kept unsavedAn entry the API would reject ("*") stays in the draft with a red "Not saved" reason instead of being committed. Original unavailable: managed storage is unavailable or the upload has expired. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ld proxy code and pass on the new. About 200 affected tests pass, but the 7 Docker tests skip here (the provider-egress and container-smoke suites), so none of this has run against a real agent container. Lint and typecheck are clean for core, root and UI, except one complexity warning in core's `dockerResultProcessor.ts` that was already there. I've applied F7 and S23–S31. The new F7 tests fail on the old proxy code and pass on the new. About 200 affected tests pass, but the 7 Docker tests skip here (the provider-egress and container-smoke suites), so none of this has run against a real agent container. Lint and typecheck are clean for core, root and UI, except one complexity warning in core's `dockerResultProcessor.ts` that was already there. **F7 – trying alternate DNS addresses** - For a direct connection, the proxy now keeps every address it vetted, not just the first. A new `egressConnect.ts` tries them in turn for both HTTP and CONNECT. It alternates IPv6 and IPv4, starts the next attempt after 250 ms if the current one hasn't connected (or at once if it fails), and keeps the existing 30 s overall deadline. - It dials only the vetted addresses, with no second DNS lookup, and the private-address rejection is unchanged. It also won't dial another address once the proxy is shutting down. - New tests: an IPv6 address that is refused, or never answers, followed by a working IPv4 address now succeeds for both CONNECT and HTTP. Every address failing still gives a 502, and addresses that never answer still give a 504 at the deadline. - I checked for the same first-address shortcut elsewhere and found none; this is the only DNS lookup in the network code. **Suggestions** - **S23:** the PR-comment path that skips the repository workflow now runs under `runWithNetworkPolicy`, using the repository's network settings and recording a timeline event. Nothing in production takes that path today (the only caller always uses the workflow), so this is hardening. Its test file had no settings database, so the test now stubs the policy and checks that the run is wrapped. - **S24:** confirmed with no code change. All five agents build their summarization containers through the ProPR wrapper. A new test shows Claude, Codex and OpenCode summarization containers each count as one restricted container, and an enforcing instance doesn't refuse them. - **S25:** a run that fails with a non-object value (a string, number, `null` or `undefined`) is now rethrown unchanged instead of turning into a `TypeError`. - **S26:** the four network-setting reads are now retried together while the database is locked, within one time budget. Each database query was already retried on a lock, so this mainly puts the four reads under one shared limit. Other errors, such as disk I/O, still fail the run, so it still fails closed. - **S27:** the settings page now checks allowlist entries before saving. An entry the API would reject stays in the box with a red "Not saved" reason. The checker is a browser copy of the API's rules, and a new parity test checks both give the same answers on about 40 entries. - **S28:** `iptables` is no longer installed in the agent image. I also removed it from `NOTICE`, `THIRD_PARTY_LICENSES.md` and `generate-notices.sh`, and added a test that the agent Dockerfile doesn't install it. This changes the agent image's contents. - **S29:** I did not block the whole `64:ff9b::/96` range as the suggestion proposed. Workers on IPv6-only networks reach every IPv4 site through addresses in that range, so blocking it would cut them off from all providers. Instead the proxy reads the IPv4 address inside a NAT64 address and blocks it only when that IPv4 address is private. - **S30:** indexing runs without a task now log failed upstream connections too. A new test fails without this change. - **S31:** a new "Allowed hosts list" setting chooses between the environment default and a custom list. An empty custom list is saved as `[]` and adds no hosts. One change in behaviour: clearing the box while a custom list is selected now saves an empty list rather than going back to the default. I captured preview screenshots of the default, invalid-entry and empty-custom-list states. I updated `execution-safety.md` and the CHANGELOG to match. I found nothing new that needs a separate report. PR: #2847 Comment by: @integry (ID: 6038358625) Model: Claude Opus 5.5
|
CI failed: CodeQL Please investigate and fix this CI failure.
Failure evidence
|
|
✅ Applied the requested follow-up changes in commit 7692324 Summary of ChangesI removed the regular expression CodeQL flagged in The problem: The fix: the function now takes the part after the last Checks:
There is nothing visual in this change, so I made no previews. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used. This task didn't need them. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…dIpv4` (`packages/core/src/network/egressProxy.ts:148`). I removed the regular expression CodeQL flagged in `embeddedIpv4` (`packages/core/src/network/egressProxy.ts:148`). **The problem:** `/(\d+\.\d+\.\d+\.\d+)$/` isn't anchored at the start. On a long run of digits, the regex engine retries from every starting position, which makes it slow (polynomial time). **The fix:** the function now takes the part after the last `:`. If that part contains a `.`, it is the dotted IPv4 address and is returned as is. Otherwise the existing hex-group path is used. This only runs on strings that `net.isIP` has already accepted as IPv6, and there the dotted form can only be the last segment, so the result is the same. **Checks:** - The two egress proxy test files (`egressProxyAddressPolicy` and `egressProxy`) pass, 21 tests. They already cover NAT64 addresses in both the dotted and hex forms. - ESLint on the file is clean. - I also ran a few addresses by hand, including a long run of zeros. Private embedded addresses (`64:ff9b::10.0.0.1`, `64:ff9b::a00:1`, `::ffff:127.0.0.1`) are still refused, and public ones (`64:ff9b::8.8.8.8`, `64:ff9b::808:808`) are still allowed. There is nothing visual in this change, so I made no previews. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used. This task didn't need them. PR: #2847 Comment by: @github-advanced-security[bot] (ID: 4207376540) Model: Claude Opus 5.5
|
ℹ️ Analyzed the follow-up request by @propr-dev[bot] Analysis SummaryThere's nothing new to change. The current branch head (
The CodeQL alert should clear once CodeQL runs on the current head. This doesn't change anything visual, so I made no previews. The Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used. This task didn't need them. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
Full Test Suite ResultsValidation failed during: Test shard (shard 4).
View shard 4/4 outputDetails truncated; see the uploaded artifacts for complete failure rows and logs. |
|
✅ Applied the requested follow-up changes in commit eace5c4 Summary of ChangesI fixed the shard 4 failure in Cause: this PR added Fix: the test now replaces ESLint isn't set up for root There are no visual changes, so I didn't make previews. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…b.test.ts`. The failure came from the test's setup, not from the merge-conflict code, and the file now passes locally (22 of 22). I ran only this file, not the full suite. I fixed the shard 4 failure in `test/processMergeConflictJob.test.ts`. The failure came from the test's setup, not from the merge-conflict code, and the file now passes locally (22 of 22). I ran only this file, not the full suite. **Cause:** this PR added `src/jobs/networkEgress.ts`, and `prCommentAgentUtils.js` imports it. `processMergeConflictJob.ts` imports `prCommentAgentUtils.js`, so loading the job now loads `networkEgress.ts` too. That file imports `executeWithNetworkPolicy` and other network-policy functions from `@propr/core`. The test replaces `@propr/core` with a fixed list of fake exports that doesn't include them. So the file crashed while loading with `SyntaxError: The requested module '@propr/core' does not provide an export named 'executeWithNetworkPolicy'`, before any test ran. **Fix:** the test now replaces `../src/jobs/networkEgress.js` too, with a `runWithNetworkPolicy` that just runs the work it's given (`test/processMergeConflictJob.test.ts`, after the `prPublication.js` mock). `test/prCommentAgentUtils.test.ts` already handles that module the same way. ESLint isn't set up for root `test/` files, so I couldn't lint this one. There are no visual changes, so I didn't make previews. PR: #2847 Comment by: @github-actions[bot] (ID: 6039169194) Model: Claude Opus 5.5
|
/review astra fable |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — astraOverall EvaluationThe PR implements restricted container networking through a worker-side proxy and Unix socket, with policy settings, lifecycle cleanup, and timeline reporting. It needs a localized correction before merge: equivalent IPv6 address spellings do not match consistently. ✅ Container isolation — Supported restricted runs use ✅ Private-address protection — Direct connections use vetted DNS results, and repository entries cannot independently authorize private addresses. ✅ Validation coverage — Tests cover proxying, refusals, cancellation, cleanup, and real container transports. The supplied current-head status reports 42 passed checks and no failures. This review is based on static inspection; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F8: 🔴 Normalize equivalent IPv6 address spellings
SuggestionsThese are optional follow-ups and are not sent to S32: 🟢 Test the candidate agent imageThe smoke workflow pulls ScoreThe implementation has substantial coverage and passing current checks, but an accepted IPv6 configuration can incorrectly block an explicitly authorized registry. The correction is localized. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
🔍 AI Code Review — fableOverall EvaluationThis PR implements issue #2743: restricted network egress for agent containers through a per-run, per-container allowlist proxy on the worker, without privileged containers. The design is sound: the container gets Coverage is extensive and real: unit tests for allowlist parsing (with a UI parity test), proxy behaviour (CONNECT, absolute-form HTTP, Host rewriting, hop-by-hop stripping, upstream chaining with credentials, 502/504 accounting, mid-body drop), address policy, orphan sweeping across PID namespaces, argument rewriting in every Docker env/network form, a Docker-gated container smoke test, and a live provider transport test run by a new CI workflow. All current-head checks pass, including the restricted-network container smoke. ✅ Address vetting closes the worker-position SSRF hole — ✅ Cleanup and lifetime are tied to the container, with a correct sweeper — ✅ Fail-closed policy reads — I found no PR-introduced defect that I could drive from a reachable trigger to an incorrect observable outcome. The PR is merge-ready within scope; the items below are optional follow-ups. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S33: 🟢 Expect denied telemetry hosts on every Claude/Codex run
S34: 🟢 Verify the indexing worker's socket mount in production ComposeThe dev S35: 🟢 Audit non-agent
|
|
/fix all |
|
✅ Applied the requested follow-up changes in commit c946eaa
Summary of ChangesAll nine records are applied and verified locally. Nothing is left to fetch. F8, fixed. Every IP literal now passes through one canonical spelling in Suggestions:
Verification. The three core egress suites (40 tests) and the four root suites (16 tests) pass. Root lint, core lint and the root typecheck are clean, except the pre-existing complexity warning in core's 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…is left to fetch. All nine records are applied and verified locally. Nothing is left to fetch. **F8, fixed.** Every IP literal now passes through one canonical spelling in `normalizeEgressHost`, using Node's `SocketAddress`, with any zone suffix kept. That covers allowlist entries, CONNECT authorities, the plain HTTP URL host that `new URL()` compresses, and the resolved addresses checked against the administrator's address allowlist. I checked the siblings: `bypassesUpstreamProxy` and `deniedTarget` go through the same normalization, and the settings UI's parity copy only validates, so its error messages are unchanged. New tests cover an expanded administrator entry with a compressed DNS answer, three CONNECT spellings, an absolute-form IPv6 URL, and IPv4-mapped forms. Those tests fail on the old allowlist code and pass now. **Suggestions:** - **S32 and S36.** The smoke workflow now builds `propr/agent:<sha>` from the checkout with the same build script the preview pipeline uses, unless a dispatch names a published image. The live provider test runs only nightly and on dispatch, so a provider outage cannot fail a pull request. The job moved to the amd64 runner with a longer timeout, and the build script was added to the trigger paths. - **S33.** A restricted Claude container gets `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` unless the run's configuration already sets it. I did not find a documented Codex equivalent in the bundled docs, so the docs note that Codex exports telemetry only when its config enables an exporter. - **S34.** The legacy production Compose file defines no indexing worker, so no Compose change was needed. The contract test now checks every service that runs a worker process for the socket directory env and mount, and holds any future indexing service to it. - **S35.** Audit result: inside worker run scopes, the only non-agent `docker run` sites are the exempt Agent Tank probe and the runtime package inspection, which already uses `--network none`. The package catalog queries and image builds happen in the API or outside runs. The docs now say plainly that plan generation and login containers in the API process run open even under enforcement. - **S37.** Before its first restricted container, each worker process runs one throwaway container with the run's own image and mount and checks for the socket. Failure logs one warning naming both directory settings and the Docker Desktop limitation. It is enabled from the existing worker safety-net helper, so the two worker entry files are unchanged. - **S38.** A nested `executeWithNetworkPolicy` with the same policy now joins the enclosing record and reports `nested: true`, and `runWithNetworkPolicy` skips recording in that case. A nested scope with a different policy keeps its own record. Tests cover both, including the failure path. - **S39.** Added `media.githubusercontent.com` and `github-cloud.githubusercontent.com` to the base list, with a docs note for repositories whose LFS objects live elsewhere. **Verification.** The three core egress suites (40 tests) and the four root suites (16 tests) pass. Root lint, core lint and the root typecheck are clean, except the pre-existing complexity warning in core's `dockerResultProcessor.ts`. The Docker-gated suites skip here, so the rebuilt workflow and the preflight have not run against a real daemon. No preview files were created because none of this is visible in the UI. PR: #2847 Comment by: @integry (ID: 6041416135) Model: Claude Fable 5.1
|
/review fable astra |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — fableOverall EvaluationThis PR implements issue #2743: a per-run, worker-side HTTP/HTTPS CONNECT proxy behind a Unix socket, with agent containers started under The current head is green on all 42 checks, including the new "Restricted network container smoke" job, which exercises the socket mount, in-container bridge and allow/deny decisions against a real agent image built from this checkout. I traced the argument rewriting ( ✅ Resolve-then-dial with private-address refusal — ✅ Fail-closed policy read and single timeline record — ✅ Argument rewriting handles every Docker env/network spelling — The PR is merge-ready within scope. The one material caveat is that the live provider-transport test ( Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S40: 🟢 A nested scope with a different policy can relax an enclosing restricted scopeIn S41: 🟢 Run the provider-transport test on this head before relying on restricted mode
S42: 🟢 Safety net and docs leave non-enforced restricted instances partially uncovered
S43: 🟢 Reviews now fail on any workflow read error, even without a spend cap
S44: 🟢 Audit helper containers inside enforced restricted scopesUnder S45: 🟢 Validate the socket path length at startup
S46: 🟢 Settings API reports defaults when the stored policy is unreadable
ScoreThe implementation satisfies the original objective end to end with fail-closed defaults, strong SSRF protections, exhaustive unit/integration tests and a passing Docker-backed smoke job on the current head; no PR-introduced correctness or safety regression was demonstrated, with only the untriggered nightly provider test and a few hardening items left as follow-ups. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
🔍 AI Code Review — astraOverall EvaluationReady to merge within scope. The PR implements restricted egress through worker-side proxies and isolated container networking, with configuration, cleanup, and reporting integrated across the supported execution paths. The authoritative current-head checks report 42 passed, none failed, and none pending. ✅ Enforced network isolation — Supported containers receive ✅ Address validation — Direct connections use vetted DNS results, and private addresses require instance-authorized IP entries. ✅ Lifecycle coverage — Both executor-managed containers and directly spawned goal sessions release their proxies, with orphan cleanup and regression coverage. This assessment is based on static review of the supplied code; no commands were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S47: 🟢 Distinguish provider and proxy rejectionIn ScoreThe implementation addresses the objective with substantial boundary, lifecycle, and integration coverage, and current checks are green. No verified merge blocker remains. Score: 9/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |



AI Implementation Summary
Closes #2743
Branch:
2743/claude-opus-5-5-restricted-network-egress-20261006-2103-yelCommits: ✅ Changes committed (c0c6732)
AI Processing Completed
Execution Details:
Summary:
Restricted network mode for issue #2743 is implemented. Lint and typecheck pass, the unit, UI and e2e tests pass, and I ran the existing test files most likely to be affected. But Docker isn't available here, so it has never been run against a real agent container. The Docker integration test (
test/egressProxyContainerSmoke.test.ts) skips without Docker and an agent image, and the full repository suite wasn't run.How it works
/tmp/propr-egress/<id>/). Each container has its own socket, so there are no ports to collide.--network none, the socket directory mounted read-only, andHTTP_PROXY/HTTPS_PROXY/NO_PROXYplus git'shttp.proxyset. There is no--privilegedand noNET_ADMIN.127.0.0.1:3128before setup hooks and the agent start. I ran it outside Docker against a live proxy: an allowed request went through, and a denied CONNECT got 403 and was recorded.*.example.commatch subdomains only, entries can carry a port (otherwise only 80/443), and IP addresses are denied unless listed exactly.Policy
.propr/workflow.ymlacceptsnetwork: { mode, allow }, validated in code and in the editor JSON schema.agent_network_mode,agent_network_mode_enforcedandagent_network_allowdefault from theAGENT_NETWORK_*env vars. They're available in the API, a new Settings → Automation → Agent network section, the CLI and MCP.mode: openis ignored and the timeline says so; the repository'sallowhosts still apply.Agent compatibility. Claude Code, Codex, OpenCode and Vibe are marked as supported based on their documented or library proxy behaviour, not live runs. Antigravity's sign-in and API traffic couldn't be confirmed, so it falls back to open networking with a timeline warning. When restricted mode is enforced, Antigravity runs are refused instead. That goes beyond the issue's plain "fall back", because an enforced policy shouldn't be silently bypassed.
Observability. Each run ends with one timeline event showing the mode, any fallback or refusal, and every denied host with its count. After 100 distinct hosts, the rest are still counted rather than dropped. The task detail shows this event.
Limitations to know about
/tmp/propr-egressmount to both Compose files and the launcher.Other changes
scripts/init-firewall.shand all the "Skipping firewall setup" lines are removed. Theiptablespackage is still installed in the agent image; removing it would also mean editing the licence notices.@propr/coremocks or expected settings responses in five existing test files so they match the new exports and settings fields.Previews of the timeline event (desktop and mobile) and the new settings section were captured.
Detailed Logs:
4c0afeef-fb0f-4618-b4a7-4cb2d9bd4584Log files stored at:
/tmp/claude-logs/issue-2743-2026-10-06T21-43-56-444Z-conversation.json/tmp/claude-logs/issue-2743-2026-10-06T21-43-56-444Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #2743.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Agent network settings
New Settings → Automation → Agent network section: mode, enforcement and additional allowed hosts
Original unavailable: managed storage is unavailable or the upload has expired.
Restricted network timeline event (desktop)
Task timeline with the end-of-run Restricted Network event: mode, its source (.propr/workflow.yml) and each denied host with its attempt count
Original unavailable: managed storage is unavailable or the upload has expired.
Restricted network timeline event (mobile)
The same network egress event on a 390px phone viewport
Original unavailable: managed storage is unavailable or the upload has expired.