EC2: support network allowlists and changing network policy between phases
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start in the EC2 environment's capabilities declaration and _EC2ComposeOps(DinDComposeOps), then compare with DockerEnvironment._requires_egress_control, docker-compose-egress-control.yaml and docker-compose-no-network.yaml, plus validate_network_policy_support. Reproduce by constructing a Trial with environment.type: ec2 on a task whose agent phase sets no-network over a public environment, without launching an instance. Done when that construction is accepted and the policy is enforced through the sidecar.
Written by the indexing model from the issue text.
Description
Summary
The EC2 environment can run a task fully online or fully offline, but it cannot restrict egress to an allowlist or change the network policy after the sandbox starts. Tasks that set up with public internet and then run the agent with no-network are rejected, so they cannot run on EC2 at all.
Checked on Harbor 0.25.0 and on main at b06002e (2026-11-13).
Current behaviour
-
EC2Environment.capabilitiesdeclares onlydisable_internetanddocker_compose. It does not declarenetwork_allowlistordynamic_network_policy. -
no-networkis applied by addingdocker-compose-no-network.yaml(network_mode: none) when the task container starts inside the VM. That cannot be changed afterwards and has no exceptions. -
A task whose agent phase is more restricted than its environment baseline is rejected when the environment is constructed:
ValueError: The execution phase network policy differs from a broader setup or shared phase policy, but this environment cannot change network policy after start. Execution mode: 'no-network'; broadest mode: 'public'. -
For an installed agent, Harbor adds the inference host to a
no-networkagent phase, which makes it anallowlistpolicy.validate_network_policy_supportrejects that on EC2 too.
Reproduction
Any task with a public environment and [agent] network_mode = "no-network". All 113 tasks in datacurve/deep-swe-1-1 are like this:
[agent]
network_mode = "no-network"
[verifier]
network_mode = "no-network"
environment_mode = "separate"
Trial.create with environment.type: ec2 raises the error above for these tasks, with both the oracle agent and an installed agent. The same task with environment.type: docker is accepted. I reproduced this without launching an instance.
Why it matters
Benchmarks built from public repositories cut network access during the agent and verifier phases so the agent cannot look up the upstream fix. On EC2 today there is no way to run them without editing the tasks, which changes the benchmark.
Possible approach
Happy to hear a different preference; this is only a sketch.
The EC2 environment already runs Docker Compose inside the VM (_EC2ComposeOps(DinDComposeOps)), so it could reuse the Docker environment's egress-control sidecar there, the way #4193 does for Daytona's Docker-in-Docker sandboxes and #3138 does for GKE:
- When any phase is restricted, add
docker-compose-egress-control.yamland the generated services override after the task's compose files, in the same order as on Docker. - Implement
_apply_network_policyby runningnetwork-policyin the sidecar throughdocker compose exec, and use the sidecar's deny-all forno-networkinstead ofdocker-compose-no-network.yaml. - Advertise
network_allowlist*anddynamic_network_policyunder the same rule asDockerEnvironment._requires_egress_control. Public-only tasks keep today's behaviour, and the VM itself stays public.
One open question is how the sidecar image reaches the VM: built there during bootstrap, or pulled.
Workaround in use
Run these tasks on Modal or local Docker.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 1.9k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 156
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from harbor-framework/harbor
-
Trial runs the agent's `populate_context_post_run` on the event loop, so trials that end together stall the orchestrator for secondsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
harbor-framework/harbor#4652 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
harbor-framework/harbor#4494 · 1 comment ·
Maintainers usually reply within 1 day
-
step workdir upload resets the work folder's owner and permissions in ModalPossibly taken @Sauvi72 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
harbor-framework/harbor#4487 · 3 comments ·
Maintainers usually reply within 1 day
-
Docker: verifier log mounts are chmod 777 (no sticky), so rewardkit sandboxed graders die before writing a rewardPossibly taken @yuyz-cyber claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
harbor-framework/harbor#4469 · 1 comment ·
Maintainers usually reply within 1 day
-
Compare and Pareto hide total token usage when the cached token count is missingPossibly taken @Aafimalek claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
harbor-framework/harbor#4448 ·
Maintainers usually reply within 1 day
All issues in harbor-framework/harbor
Similar issues
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug data-types native-format
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day