Workspace Internet access

New and explicitly rebuilt managed Project containers default to enforced Internet restrictions. Claude, Codex and Antigravity model/authentication hosts are included automatically. The editable Development infrastructure template supplies GitHub/GitLab, package registries, image downloads, language tools, Linux packages, supported hosting API domains and grouped AI provider APIs by default. Other public HTTP/HTTPS hosts need an operator-owned Project allowlist. Credentials do not silently open a route. An explicitly saved allowlist, including an empty one, never widens on upgrade.

The website gateway allows HTTP on 80 and TLS with matching SNI on 443. Adding a hostname or a permission document does not open other ports. To connect an explicitly approved external proxy, database or other TCP service on a different port, register its exact upstream as a remote-tcp Resource and grant it to the workspace in service mode. The existing fixed-target proxy gives that workspace an <alias>.devctl.internal:<port> endpoint without attaching the whole external network or changing other Projects' Internet policies. Configure the consumer with that managed endpoint; an application-level proxy can reach destinations through its provider, so grant it only deliberately. Retain sensitive connection variables in the Project's durable .agent.env or existing secret workflow, not only in a temporary session file. Never put credentials in Resource metadata.

The editable baseline also includes Google identity hosts accounts.google.com, www.googleapis.com, oauth2.googleapis.com, and Google profile subdomains *.googleusercontent.com, plus documentation at ai.google.dev, docs.stripe.com, developers.docusign.com, and resend.com. These are separate domain choices; native sign-in prerequisites stay checked and locked. Profile-picture subdomains do not allow all Google or provider domains. HTTPS policy is hostname-based: it does not filter URL paths or HTTP methods inside TLS. Documentation selections do not imply API access. Gemini's generativelanguage.googleapis.com has its own AI provider checkbox and is included in the new built-in AI baseline; transaction APIs such as api.stripe.com and api.resend.com are not added. Each resource still needs its own credentials and applicable permission scope.

The optional Web fonts package contains only fonts.googleapis.com for CSS and fonts.gstatic.com for font files, as used by the official Google Fonts CSS API and font-file metadata. It is separate from mandatory agent sign-in and can be disabled independently. It adds no Google-wide wildcard. Existing explicit policies, empty policies and package exclusions remain unchanged; enable the approved package or explicitly add those exact hosts to the owned repository policy when needed. Team approval ceilings still apply. A session permission document does not itself change the gateway: inspect the durable policy delivery and reloadVerified result before claiming network access. The gateway enforces hosts and public ports, while the original approval still governs read-only usage, asset/license validation and retention limits.

The Google endpoints follow its OIDC discovery document; the documentation hosts are the official Gemini, Stripe, Docusign, and Resend sites.

Existing running containers keep their original network and sessions. Updating the host-agent or opening a session never converts a live legacy container. An explicit Project rebuild migrates that container when its running sessions can be stopped. Creating a new session in an explicitly restricted Project whose selected legacy container lacks the enforced boundary instead allocates an additional policy-N container on the same host. Existing processes are not restarted and their network attachments are not changed. The new container uses the already authorized checkout, including uncommitted work; it is a separate execution environment, not a separate Git worktree. An already running compliant sibling with the same user, repository, host, checkout and resource limits is reused instead of creating another container.

Continue with another account uses this additional container for a saved native conversation when the original container cannot launch under the current policy. A failed, unfinished account transfer can also retry its current account. Only the selected provider process is stopped if it is still alive. The original session remains in history as the parent. Claude retains its native conversation ID; only its selected transcript is staged, never a credential directory or the source account's HOME. Codex uses its existing scoped account store. Cross-agent imports retain their normal native or bounded-history conversion semantics. No user prompt is submitted by this recovery path.

Operator API clients use POST /v1/sessions with continueSessionId and the target accountId to continue a stopped conversation using the same provider. The source must belong to the selected repository, container and controller user, have an official conversation identity, and no longer have an observed process. Use a stable clientRequestId UUID across retries: the receipt covers the new container, session and host launch in one transaction. Other imports/resume sources cannot be combined with continueSessionId. Specialized sandboxes and containers with native-folder leases need an explicitly compatible new container; their immutable mounts are never copied or broadened automatically.

Configure and inspect

Operator MCP exposes project_network_policy for reads/full-policy updates and network_policy_templates for private template CRUD/defaults. Session MCP exposes get_project_network_policy and approval-bound configure_project_network_policy. Tenant sessions cannot broaden their own grants, and a secondary repository cannot change the primary container Project's policy. See MCP workflows.

Open Settings → Network access to manage private templates and future-Project defaults, or choose a Project container and open Security → w Internet policy templates / edit domains to apply a policy. TUI, web and desktop use the same React editor. Groups can nest to any depth represented by a template's category path, for example Services / Data / Analytics / Exports / Europe. Each ancestor has an aggregate checkbox over its descendant domains; a partial group displays a mixed checkbox. Existing AI / … categories appear under AI agents, followed by provider/family groups and their domains. Category labels and existing saved policies are preserved; this presentation does not add network access. Required coding-agent model/sign-in entries are checked and locked. Arrow keys navigate. Right expands a group, then enters its first child; Left collapses an open group or selects its immediate parent. Enter opens a group or toggles a domain; Space toggles all optional descendants of the selected group. / filters group names and domains, with PgUp/PgDn for bounded visible rows. Browser controls use real checkboxes. When filtering, group toggles affect matching domains only. Then:

Templates and future-Project defaults are stored durably on the controller under the current user's identity. Other users cannot read or select those private templates. The catalog lists new AI choices unchecked when opening older private templates or explicit Project snapshots. Unchanged choices do not broaden an existing allowlist: choose the built-in baseline or enable the desired domains, then explicitly Apply. Server users can narrow the supplied baseline and their Project's current grant; new destinations or unrestricted networking require the operator. Required Claude/Codex/Antigravity sign-in/model endpoints are separate and cannot be removed with infrastructure checkboxes. Network connectivity does not deliver credentials, authorize a repository operation or replace a service's method permissions.

Policy belongs to the controller's Project record, not the repository's .devctl.yaml, session Markdown or model advice. Agents cannot disable the boundary by editing those files or unsetting proxy variables.

./devctl project egress PROJECT
./devctl project egress PROJECT '{"mode":"restricted","allowedHosts":["github.com","api.github.com","raw.githubusercontent.com","registry.npmjs.org"]}'

The second command replaces additional hosts. Lowercase hostnames are required; *.example.com admits subdomains, not the apex. Allowed public hosts receive HTTP on port 80 and HTTPS on port 443. Literal IPs, credentials, paths and other ports are not accepted. SSH Git remotes and non-HTTP services need a fixed Service grant; HTTPS Git remotes can use the allowlist. Private/metadata addresses and DNS rebinding to any private result remain denied by the proxy.

An operator can allow all public websites without removing the isolated network boundary or rebuilding the Project container:

./devctl project egress PROJECT '{"mode":"restricted","allowedHosts":["*"]}'

The explicit * entry admits any public DNS hostname over HTTP/HTTPS. It is never added by default. Private/metadata addresses, literal IPs, other ports, DNS rebinding and mismatched TLS SNI remain blocked. Account-specific routes still apply. Ordinary server users may narrow this grant, but cannot add it to a Project that only has named hosts. Other projects retain their existing policy. Gateways installed before this capability need a gateway-only upgrade; coding sessions need not restart. The API/MCP uses the same allowedHosts value, and the network editor can retain, add or remove it like another custom host.

An operator can instead explicitly select unrestricted networking:

./devctl project egress PROJECT '{"mode":"unrestricted","allowedHosts":[]}'

Changing mode marks the desired configuration without restarting sessions. Apply it through an explicit Project rebuild. Adding/removing hosts on a restricted runtime is dispatched independently on hosts advertising workspace-egress-live-policy-v1; other hosts use periodic reconciliation. A gateway reload acknowledgment confirms the live update. Within one host process, updates are serialized per workspace and carry a controller revision so a stale inventory snapshot cannot restore older destinations. Proxy file watchers remain a fallback and load a deployed policy within one second. Removed hosts' tunnels are closed. An offline controller leaves the last deployed policy active.

The authenticated Project API is GET/PUT /v1/projects/:id/egress-policy; named users are limited to their own Projects and may only narrow their policy. Template APIs are GET/POST /v1/network-policy-templates, PUT/DELETE /v1/network-policy-templates/:id, and POST /v1/network-policy-templates/:id/default (with {} JSON body). Its read response shows desired policy, controller revision, per-workspace delivery (command ID, pending/applied/failed and reloadVerified) and observed runtime state. PUT also returns networkDelivery command references. Poll GET /v1/commands/:id/result for accepted updates; the command remains durable when the console disconnects. Mode changes, absent runtimes and legacy boundaries are never converted by this update path. Runtime states:

State Meaning
restricted Created with the isolated-network boundary.
unrestricted Explicitly created/rebuilt with unrestricted networking.
legacy Existing runtime predates enforcement; rebuild is needed.
absent No observed placed container.

Edits are audited and respect the existing immutable autonomous-Run capability lock. Tenant projects cannot use the operator API to broaden their grants. Sessions/repositories sharing a container share its primary Project's policy. Use separate containers for different network boundaries.

Infrastructure boundary

The workspace and rootless DinD sidecar attach only to Docker Internal bridge networks with gateway_mode_ipv4=isolated and IPv6 disabled. This also removes the bridge's host address. There is no Internet route to recover by ignoring HTTP_PROXY, choosing NO_PROXY=* or connecting directly to an IP.

A trusted per-workspace proxy joins that internal network and a separate outbound network. It has a read-only root/files, unprivileged UID, all Linux capabilities dropped and IP forwarding disabled. It pins checked public IPv4 DNS results. HTTPS requires a TLS ClientHello whose SNI matches the allowed target. HTTP, including Node fetch's HTTP CONNECT mode, is parsed and forced to its approved Host instead of becoming arbitrary TCP. TLS verification remains enabled; the proxy does not decrypt it.

Managed containerEnv sets upper/lowercase HTTP(S) proxy variables and NODE_USE_ENV_PROXY=1 for Node 24 fetch. Internal aliases/loopback bypass the proxy. Workspace DNS resolves Docker service aliases but has only a loopback external upstream. Repository devcontainer options cannot add another network, regain NET_ADMIN/NET_RAW, attach host namespaces, use the host Docker API socket, override managed DNS/proxy settings or switch to unmanaged Compose. Actual container/network configuration is checked before managed agent launch. Unsupported enforcement fails closed, with no voluntary-proxy fallback.

Fixed-target Service proxies, controller/MCP Unix sockets, secrets/file mounts and local forwarding remain authorized routes. Service proxies reach their existing target through a trusted outbound or Service network. Whole-network grants are rejected on restricted workspaces. Upstream credentials, method scopes and behavior inside a granted service remain that service's boundary.

The DinD daemon inherits the proxy for registry/image operations. Inner workloads retain the outer boundary, including inner --network host; their HTTP clients must receive proxy variables when they need Internet access. Inner application networks/services continue to work normally.

The proxy is capped at 64 MiB, 0.25 CPU and 64 PIDs and follows the owner's aggregate cgroup parent when present. Stopping a Project stops its sidecar. Reconciliation repairs a missing/stopped proxy without recreating the Project. An update never replaces a running gateway or overwrites the code and provider modules it uses on restart. Live allowlist changes retain the gateway's deployed policy format. New gateways bind versioned script/provider assets; a stopped gateway can upgrade on the next Project start. Background repair restarts an existing gateway with its deployed assets. Stop the Project explicitly before upgrading its gateway to account capability support. Logs record a hostname and bounded reason, never request paths, queries, tokens, authorization headers, prompts or TLS payloads.

Gateways with structured access-audit support also record allowed/denied attempts and distinguish admission from upstream failure. The host resolves best-effort workspace/DinD network origins from fresh Docker endpoints. Shared containers do not provide exact network-to-session attribution. Existing gateways are not replaced merely to enable this capture; an explicit upgrade is needed. Direct packets blocked by the isolated bridge do not reach the proxy and cannot appear in its request history. See access history for bounded loading, privacy, MCP coverage and external collection.

Provider connectivity and support

The immutable base list includes Anthropic API/authentication hosts, downloads.claude.ai, the Claude connector proxy, OpenAI API, ChatGPT model/ WebSocket hosts and OpenAI authentication hosts. Host edits cannot remove them. This permits connectivity, not valid credentials or subscriptions. The removable infrastructure template is distinct from that mandatory list. Its GitHub transport/CDN hosts follow the official GitHub network reference, Docker pull/authentication hosts follow the Docker allowlist, and JavaScript packages use the official npm registry. Hostnames authorize public HTTP/HTTPS destinations, not URL paths or specific operations. Optional telemetry, private registries, custom Git servers and third-party model gateways need additional hosts or Service grants.

Reviewed official references: Claude networking, Codex login endpoints, OpenAI WebSocket/network requirements and Docker isolated gateway mode. Update the shipped base list with toolchain endpoint changes rather than opening unrestricted provider-wide access.

Supported: rootful Docker Engine 28+ on Linux or Docker Desktop's Linux engine, including the existing rootless DinD sidecar within that controlled outer engine, and Rootless Docker Engine 29.9.1+ with the same inspected isolated network/container boundary. Earlier rootless versions fail closed and require an upgrade; devctrl never automatically changes the policy to unrestricted. Provider-native sandbox networking and operator compute exec are not governed by this Docker policy. A sandbox using ordinary managed Docker must pass the same actual engine/network checks. No Boat-level restriction is claimed.

This controls container-originated traffic, not provider-executed remote tools or host-side MCP brokers. HTTPS routing is limited by target/SNI; encrypted paths, methods and Host headers are not inspected. Host Docker administrators remain trusted. This is Internet egress control, not arbitrary internal-peer authorization or an application-policy engine.

Verification

pnpm --filter @devctl/runtime exec vitest run src/workspace-egress.test.ts src/index.test.ts
pnpm --filter @devctl/controller exec vitest run src/workspace-egress.test.ts
docker run --rm --network none --read-only --cpus 0.5 --memory 256m --pids-limit 64 \
  --tmpfs /scratch:rw,noexec,nosuid,size=16m -e HOME=/scratch \
  -v "$PWD/docker:/fixture:ro" node:24-alpine node --test /fixture/workspace-egress-proxy.test.mjs
DEVCTL_TEST_DOCKER_EGRESS=1 node --test docker/workspace-egress.integration.test.mjs
DEVCTL_TEST_ROOTLESS_EGRESS=1 python3 -B docker/rootless-egress.integration.py

The integration fixture uses two temporary isolated internal networks. It checks HTTP/Node fetch and fixed-service aliases, denied public/private/IPv6 routes, host-gateway/DNS isolation, proxy bypass and dropped route/raw-packet capabilities. It changes no host firewall rules and uses no production containers, credentials or paid calls. Owned fixtures are removed in finally.

Antigravity's mandatory console sign-in/model routes are exact hosts: accounts.google.com, oauth2.googleapis.com, www.googleapis.com, auth.cloud.google, cloudcode-pa.googleapis.com and daily-cloudcode-pa.googleapis.com. These are also provider destinations for the account capability proxy; they work with an explicit empty additional-host allowlist. Existing modern gateway policies acquire these entries without a container restart; legacy static gateway format remains intact. No wildcard Google access is added. The official CLI 1.4.0 binary contains these OAuth/model endpoints; upstream CLI auth docs and network issue diagnostics document their role. Optional API-key/Vertex endpoints and Remote Control require their own explicitly configured destinations. Official binary downloads use the host's installation path and do not expand Project networking.

AI API catalog

The built-in provider catalog is exported as aiProviderEgressCatalog and aiProviderEgressHosts from contracts and included in GET /v1/network-policy-templates as providerCatalog, together with providerCatalogReviewedAt and mandatoryAgentHosts. Operator MCP network_policy_templates with action: "list" returns this same catalog. It records public DNS destinations and official references, not credentials or claims of authenticated integration. Cloud endpoints may expose more than model inference on the same host; upstream IAM/API credentials must restrict operations. For Azure or dedicated Alibaba resources, clone the template and prefer the exact resource hostname when a service-zone wildcard is unnecessary. AWS Bedrock and Vertex use enumerated documented regional endpoints rather than wildcards over amazonaws.com or googleapis.com. Private endpoints remain subject to fixed Service routes; this public-host catalog does not bypass private-address denial. Provider availability, region/model access and billing still depend on the provider account. A new API provider does not imply a new supported agent CLI. The catalog can evolve; existing explicit policies never silently inherit it.

The required Antigravity OAuth profile-picture destination *.googleusercontent.com was confirmed from the official native 1.4.0 client. It is a locked model/sign-in exception, separate from optional model API groups. Do not add arbitrary Google domains in response to optional telemetry failures.

Official endpoint references

Provider Public API hosts Official references
OpenAI api.openai.com, us.api.openai.com, eu.api.openai.com, mtls.api.openai.com, mtls-us.api.openai.com, mtls-eu.api.openai.com 1, 2
Anthropic api.anthropic.com 1
Google Gemini generativelanguage.googleapis.com 1
xAI api.x.ai, us.api.x.ai 1, 2
Mistral api.mistral.ai 1
Cohere api.cohere.com, api.cohere.ai 1, 2
Perplexity api.perplexity.ai 1
AI21 api.ai21.com 1
DeepSeek api.deepseek.com 1
Alibaba Qwen / DashScope dashscope.aliyuncs.com, dashscope-intl.aliyuncs.com, dashscope-us.aliyuncs.com, cn-hongkong.dashscope.aliyuncs.com, *.cn-beijing.maas.aliyuncs.com, *.ap-southeast-1.maas.aliyuncs.com, *.eu-central-1.maas.aliyuncs.com 1, 2
Moonshot / Kimi api.moonshot.ai, api.moonshot.cn 1, 2
Z.AI / Zhipu GLM api.z.ai, open.bigmodel.cn 1, 2
MiniMax api.minimax.io, api.minimax.cn 1, 2
Volcengine / Doubao ark.cn-beijing.volces.com 1
BytePlus ModelArk ark.ap-southeast.bytepluses.com, ark.eu-west.bytepluses.com 1
SiliconFlow api.siliconflow.com, api.siliconflow.cn 1, 2
StepFun api.stepfun.com, api.stepfun.ai 1, 2
Baidu Qianfan qianfan.baidubce.com, api.baiduqianfan.ai 1, 2
Tencent Hunyuan api.hunyuan.cloud.tencent.com, hunyuan.tencentcloudapi.com, hunyuan.ap-guangzhou.tencentcloudapi.com 1, 2
OpenRouter openrouter.ai, us.openrouter.ai, eu.openrouter.ai 1, 2
Groq api.groq.com 1
Cerebras api.cerebras.ai 1
Together AI api.together.ai 1
Fireworks AI api.fireworks.ai 1
DeepInfra api.deepinfra.com 1
Nebius Token Factory api.tokenfactory.nebius.com 1
NVIDIA NIM integrate.api.nvidia.com 1
Hugging Face router.huggingface.co 1
Replicate api.replicate.com 1
SambaNova api.sambanova.ai 1
Novita api.novita.ai 1
Chutes llm.chutes.ai 1
AWS Bedrock 29 documented regional hosts; see the exported catalog 1, 2
Azure OpenAI / Foundry *.openai.azure.com, *.services.ai.azure.com, login.microsoftonline.com 1
Google Vertex AI 39 documented regional hosts; see the exported catalog 1
Cloudflare Workers AI api.cloudflare.com 1

Named packages and scoped defaults

Use network access packages to select existing domain groups at shared system, per-user, project-group and repository scopes. The team administrator publishes approved templates and controls member extensions. Explicit legacy policies remain snapshots until inheritance is selected. Package saves use the same desired-policy revision and managed-gateway acknowledgement as the policy editor above.