Skip to content

Network & exposing ports

Networking is part of the sandbox contract. Name what the guest can reach, name what ports are exposed, and keep service exposure separate from outbound egress.

Use a preset when it matches the workload:

Terminal window
mvmctl up --flake . --network-preset none
mvmctl up --flake . --network-preset registries
mvmctl up --flake . --network-preset dev

Use explicit allow rules for narrow agent workloads:

Terminal window
mvmctl up --flake . \
--network-allow api.example.com:443 \
--network-allow github.com:443

For security-sensitive examples, start from no egress and add only required destinations. For grant review, SDK declarations, and agent-tool policy, see Network egress policy.

Expose a guest service to the host:

Terminal window
mvmctl up --flake . --name api-dev -p 8080:8080
mvmctl forward api-dev -p 3000:3000

Use readiness and logs while developing services:

Terminal window
mvmctl wait api-dev --for all
mvmctl boot-report api-dev
mvmctl logs api-dev -f

Host control does not require SSH. Guest communication uses the mvm control plane and guest protocol where supported. For debugging, prefer:

Terminal window
mvmctl console api-dev
mvmctl logs api-dev
mvmctl exec api-dev -- sh -lc 'id && pwd'
  • Do not expose ports unless the workflow requires it.
  • Keep inbound port forwarding and outbound egress policy separate.
  • Treat browser automation and agent workflows as high-risk network users.
  • Prefer explicit allowlists over broad presets for production-like runs.