fix(agent): pass docker_network config to backend-probe container - #62023
fix(agent): pass docker_network config to backend-probe container#62023sagitario-jpn wants to merge 1 commit into
Conversation
The backend probe in prompt_builder.py builds its own container_config dict but omitted docker_network, so the probe container always launched with the default bridge network regardless of the operator's docker_network: false setting (issue NousResearch#46358 introduced the toggle but only wired it through terminal_tool.py/code_execution_tool.py/file_tools.py). Also extends test_sibling_container_config_sites_carry_docker_network to cover agent.prompt_builder, closing the gap that regression guard was meant to catch.
|
Thanks for tracing the remaining backend-probe path. Current The added propagation matches the established terminal-path pattern, and extending Automated hermes-sweeper review. |
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs address the Docker egress-lockdown configuration: #46358 introduced the operator-facing docker_network toggle and propagated it through the primary container paths, while #62023 fixes the remaining backend-probe path that still defaulted to bridged networking.
Related pull requests
- #46358 [closed]
related— (+94/-0) — foundational, already superseded by merged #59149: it exposed terminal.docker_network, bridged it through CLI and gateway configuration, forwarded it to DockerEnvironment, and added regression coverage; #59149 cherry-picked and widened this implementation to additional container paths and safe container reuse. - #62023
related— (+3/-1) — merge: it propagates docker_network into agent.prompt_builder's backend-probe container_config, preventing that container from silently falling back to network=True, and extends the sibling-site regression guard to cover this path.
Suggested consolidation
Merge #62023: it is a small, complementary fix for a concrete propagation gap left after the #46358 implementation was integrated and widened through #59149, and its diff matches the visible keep_open review with no identified blocker. No PRs should be closed as duplicates; #46358 remains relevant as the superseded source of the foundational implementation.
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 9 kB of PR diffs, 5 kB of issue/PR text, 4 kB of discussion (4 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
The backend probe in prompt_builder.py builds its own container_config dict but omitted docker_network, so the probe container always launched with the default bridge network regardless of the operator's docker_network: false setting (issue #46358 introduced the toggle but only wired it through terminal_tool.py/code_execution_tool.py/file_tools.py).
Also extends test_sibling_container_config_sites_carry_docker_network to cover agent.prompt_builder, closing the gap that regression guard was meant to catch.
What
Fixes a
docker_networkconfig gap in the backend probe (agent/prompt_builder.py). Whenterminal.docker_network: falseis set, the probe container spawned by_probe_remote_backend()still launched with the defaultNetworkMode: bridge, ignoring the operator's egress lockdown.Why
#46358 introduced
terminal.docker_networkand wired it throughtools/terminal_tool.py,tools/code_execution_tool.py, andtools/file_tools.py. The backend probe inagent/prompt_builder.pybuilds its owncontainer_configdict for_create_environment(...)but was never updated to includedocker_network, so it silently falls back toDockerEnvironment's default (network=True).In practice this means an operator running with
docker_network: falsefor a fully air-gapped Docker sandbox still gets one bridged, internet-reachable container per model backend on disk (labeledhermes-task-id:prompt-backend-probe). The probe itself only runs a fixeduname/whoami/pwdcommand today, so there's no immediate exploit path, but it breaks the operator's stated intent and the existing regression guard (test_sibling_container_config_sites_carry_docker_network) didn't catch it because it didn't checkagent.prompt_builder.Changes
agent/prompt_builder.py: add"docker_network": config.get("docker_network", True)to the probe'scontainer_configdict, matching the pattern already used interminal_tool.py/code_execution_tool.py/file_tools.py.tests/tools/test_docker_network_config.py: extendtest_sibling_container_config_sites_carry_docker_networkto also walkagent.prompt_builder, so this asymmetry can't reappear silently.How to test
terminal.backend: dockerandterminal.docker_network: false.hermes-*containers.execute_code— its container correctly getsNetworkMode: none.hermes-task-id:prompt-backend-probestill comes up asNetworkMode: bridge. After this fix: it comes up asnonetoo.Automated:
Platforms tested
Windows 11 (PowerShell), Python 3.12.
Related
Follow-up to #46358, closing the gap flagged in that PR's own regression-guard test docstring ("the probe/exec asymmetry reported on issue #46358").