Repository navigation
Limit Sandbox egress to an HTTPS allow-list - #82
Merged
Merged
Conversation
Task Sandboxes reach github.com, the agents' model APIs, and the repository's configured egress hosts. The snapshot builder reaches github.com, deb.debian.org, and the repository's hosts; install-tools.sh switches the image's Debian sources to HTTPS so apt works under the list. A repository can opt out with egress: "allow-all". Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every Sandbox ran with
allow-allegress, so dependency install scripts and prompt-injected agents could send source code or the model key anywhere. Render Sandboxes now support anallow-listnetwork policy. This PR creates every Sandbox with one.github.com, every registered agent harness's model API, and the repository'segressgithub.com,deb.debian.org, and the repository'segressBreaking change for existing deployments
This change is on by default. A deployed fork whose repositories don't list
egresshosts will fail its next snapshot build atinstall. The error names the allowed hosts and says where to add more. To migrate, add each repository's registries tofactory.config.ts:To keep the old behavior for one repository, set
egress: "allow-all".docs/configuration.mdlists common hosts for npm, Go, and PyPI.Changes
RepoConfiggetsegress?: string[] | "allow-all". Hosts are validated whenapp/configloads, so a typo stops both services at startup. The example target getsegress: ["registry.npmjs.org"].egress, the same way they declarecredential.pi()derives the host frommodel.baseUrland takes an explicitegressfor a model served elsewhere, such as through a proxy. A task Sandbox allows the union of every registered agent's hosts, because it opens before the task picks agents and Triage runs two agents in one Sandbox.app/sandbox/egress.tsbuilds both policies and removes duplicate domains, which the API rejects. Install failures under an allow-list now name the allowed hosts, because a blocked host fails as a connection reset that looks like a network flake.install-tools.shswitches the image's Debian sources to HTTPS. The base image has noripgrep, and apt's plain-HTTP sources are blocked under an allow-list.verify.ts: removes the staleALLOW_ALL_EGRESScast, since SDK 1.3.0 types theallow-listpolicy.docs/configuration.md, updates the trust boundaries, adds invariant 11, and rewrites the residual risks indocs/architecture.md. Also updates the setup runbook, the extension runbook,AGENTS.md, and the README.Design notes
github.comfor their whole lifetime, even though they only need it for the fetch.github.comand the model API accept data sent under an attacker's own credentials, and DNS resolution isn't restricted. The residual-risks section indocs/architecture.mdsays so.Verification
npm run checkpasses: Biome,tsc, and 253 Vitest tests. New tests cover the builder and task policies, merging and deduplicating repository hosts, theallow-allescape hatch, the install-failure hint, config host validation, and harnessegress.shellcheck sandbox/*.sh sandbox/build/*.shpasses.allow-list, listed hosts are reachable, includinggit ls-remoteover HTTPS. Every other host gets a connection reset.install-tools.shinstallsripgrepand exits 0 with onlygithub.comanddeb.debian.orgallowed.render-examples/render-factory-example-target,npm ci,npm run build, andnpm testpass with onlygithub.comandregistry.npmjs.org.go mod downloadplus a toolchain download pass withgo.dev,dl.google.com,proxy.golang.org, andsum.golang.org, and fail with onlygithub.com.buildSnapshotand an agent run against a deployed instance.After merge
Existing deployments need to:
egresshosts to each repository infactory.config.ts.sandbox/).