Skip to content

fix(hermes): refuse a loopback model URL on remote sandboxes - #4582

Draft
adil-a wants to merge 1 commit into
mainfrom
adasif/sandbox-loopback-model-url
Draft

adil-a wants to merge 1 commit into
mainfrom
adasif/sandbox-loopback-model-url

Conversation

@adil-a

@adil-a adil-a commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Inside a container on OpenSandbox or E2B, 127.0.0.1 is the container itself, so a Hermes run with the default model URL scored 0 on every task without being masked. Seeding now fails with the fix named (++use_absolute_ip=true or a reachable model URL). Local Docker only warns, since loopback works there when the container shares the host network.

  • nemo_gym/base_responses_api_agent.py: is_loopback_host and assert_model_url_reachable_from_sandbox, keyed on the sandbox provider name.
  • responses_api_agents/hermes_agent: the check runs at seed, before any runtime is uploaded.

This was commit 1 of the Harbor stack's M4 (#3676). The rest of M4 landed through #4270, so M4 leaves the stack and this guard comes to main on its own. The miniSWE sandboxed agent on the stack imports the same helper, so the stack carries this commit at the base of M11 until this merges.

Test plan

  • responses_api_agents/hermes_agent/tests and tests/unit_tests/test_base_responses_api_agent.py: 356 passed
  • Guard covers loopback IPv4, IPv6 and localhost; remote providers raise, local warns

🤖 Generated with Claude Code

Inside a container on OpenSandbox or E2B, 127.0.0.1 is the container
itself, so a Hermes run with the default model URL scores 0 without being
masked. Seeding now fails with the fix named (++use_absolute_ip=true or
a reachable model URL). Local Docker only warns.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
(cherry picked from commit efc6f7c)
(cherry picked from commit 6a702b2)
@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 added area:agent Agent harnesses and Responses API agent behavior bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer labels Oct 14, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 15, 2026

# Sandbox providers whose processes share the host network namespace, so a loopback model URL still resolves
# to the host. Docker only does so when the daemon runs on the host and the container uses host networking.
_HOST_NETWORK_SANDBOX_PROVIDERS = frozenset({"local"})

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.

[P2] Account for host networking on Enroot and Apptainer

The guard rejects http://127.0.0.1:10001/v1 for both enroot and apptainer, even with their default local, shared-network configuration. Their default start commands do not enable network isolation, so a model listening on the same host's loopback interface is reachable. This prevents valid Hermes sessions, and the mini-SWE session path in #3745, from starting.

Could reachability account for provider configuration, or warn when the provider name alone is insufficient, rather than categorically treating these providers as remote? Nondefault network-isolation settings still need to be respected. I reproduced both refusals and checked the defaults against Apptainer's documentation and Enroot's start documentation; I did not launch live containers.

Found while re-reviewing #3745; posting here because this PR introduces the shared helper.

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 15, 2026
@yaoyu-33
yaoyu-33 marked this pull request as draft November 18, 2026 01:58
@yaoyu-33

Copy link
Copy Markdown
Contributor

We’re doing some cleanup of the open PR list. This PR has had no activity for over a month, so I’ve moved it back to draft.

If this change is still needed, please resolve any merge conflicts and mark the PR ready for review again when it’s ready to merge. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants