Skip to content

[ApexAgents] Relay policy traffic over a unix socket for network-isolated sandboxes - #3642

Draft
Kh4L wants to merge 1 commit into
NVIDIA-NeMo:arti/apexagentsfrom
Kh4L:spanev/apex-sandbox-egress-relay
Draft

Kh4L wants to merge 1 commit into
NVIDIA-NeMo:arti/apexagentsfrom
Kh4L:spanev/apex-sandbox-egress-relay

Conversation

@Kh4L

@Kh4L Kh4L commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Some world images start their gateway and MCP servers on fixed ports (8000, 8100-8107). Several rollouts on one node then collide in the shared network namespace. Unprivileged Apptainer can give each sandbox its own namespace only with --net --network none, which also removes the sandbox's route to the model server, and the Stirrup Chat Completions client runs inside the sandbox.

This relays the policy traffic through a unix socket, which network namespaces do not affect:

  • stirrup_runtime.py: serve_unix_to_tcp / serve_tcp_to_unix stream relays and a policy_endpoint context. When runner_config carries model_egress_socket, run_stirrup_rollout listens on a loopback port that forwards to the socket and points the client at http://127.0.0.1:<port>/v1. Any entrypoint that calls run_stirrup_rollout gets this without changes.
  • app.py: PolicyEgressRelay opens the host socket and forwards to the model server parsed from model_base_url; the socket directory is bound into the sandbox at /egress through provider_options["binds"]; the relay lives exactly as long as the sandbox. New config policy_egress_relay: auto | always | never (default auto, enabled when the apptainer extra_start_args contain --net or a --network option). Closing cancels in-flight bridges, since the client keeps idle keep-alive connections open.
  • yaml knob apex_agent_policy_egress_relay, README section, tests for both relay halves, the URL rewrite, detection and spec wiring.

Enable per run with

++apex_agent_apptainer_extra_start_args='[--net,"--network=none",--containall,--cleanenv,--writable-tmpfs,--fakeroot]'

Plain-HTTP model endpoints only. Worlds whose tools need the internet keep the default shared network. Default behaviour is unchanged.

…ated sandboxes

Signed-off-by: Serge Panev <spanev@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 23, 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 complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Sep 23, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Sep 24, 2026
@yaoyu-33
yaoyu-33 marked this pull request as draft November 18, 2026 01:55
@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!

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 18, 2026

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 complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work 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.

2 participants