Skip to content

Fix(eval): block build-script internet for submissions#41

Merged
klieret merged 3 commits into
mainfrom
feat/build-internet-block
Jun 18, 2026
Merged

Fix(eval): block build-script internet for submissions#41
klieret merged 3 commits into
mainfrom
feat/build-internet-block

Conversation

@klieret

@klieret klieret commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

A submission's compile.sh runs as root in the build container and could otherwise smuggle install/download steps into the build. Block internet unconditionally during compile.sh via an in-container DNS blackhole (overwrite /etc/resolv.conf with nameserver 0.0.0.0, restore after) — no host privileges, works under docker-in-docker. Test-execution containers are left untouched.

Internal-reference: b993951da7a644d49af19073b745c16c513cc316
Internal-reference: fad6005e0b633e103308ef4bc339848ad4bbc569

Closes #43

A submission's compile.sh runs as root in the build container and could
otherwise smuggle install/download steps into the build. Block internet
unconditionally during compile.sh via an in-container DNS blackhole
(overwrite /etc/resolv.conf with nameserver 0.0.0.0, restore after) —
no host privileges, works under docker-in-docker. Test-execution
containers are left untouched.

Internal-reference: b993951da7a644d49af19073b745c16c513cc316
Internal-reference: fad6005e0b633e103308ef4bc339848ad4bbc569
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 18, 2026
@klieret klieret changed the title Feat(eval): block build-script internet for submissions Fix(eval): block build-script internet for submissions Jun 18, 2026
@klieret klieret requested a review from Copilot June 18, 2026 02:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds build-time internet isolation for submission compilation by DNS-blackholing inside the build container, reducing the ability for compile.sh to download/install dependencies during the build phase.

Changes:

  • Add utils/internet_control.py with helpers to backup/overwrite/restore /etc/resolv.conf to a DNS blackhole.
  • Wire the block/restore around the compile.sh step in Evaluator._compile_executable.
  • Add unit tests covering both the DNS rewrite helpers and the evaluator wiring; document the behavior in CLAUDE.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_internet_control.py Adds tests for DNS block/restore helpers and verifies evaluator wraps compile with block/restore (including failure path).
src/programbench/utils/internet_control.py Implements in-container DNS blackhole by overwriting /etc/resolv.conf with nameserver 0.0.0.0 and restoring from a backup.
src/programbench/eval/eval.py Calls DNS block before compile.sh and restores DNS afterward via try/finally.
CLAUDE.md Documents the new build-time internet isolation behavior and threat model/trade-offs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/programbench/eval/eval.py Outdated
Comment thread src/programbench/utils/internet_control.py Outdated
klieret and others added 2 commits June 18, 2026 12:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@klieret klieret merged commit 57a6d3c into main Jun 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Models can cheat by including download instructions in compile.sh

2 participants