Allow models.dev in sandbox proxy for model catalog resolution#3041
Merged
Conversation
docker-agent
reviewed
Jun 9, 2026
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The changes are clean, correct, and well-structured:
pkg/modelsdev: ExportingAPIHost = "models.dev"and derivingModelsDevAPIURLfrom it is a sound refactor — it eliminates the possibility of the host and URL drifting apart.sandbox.go: Unconditionally prependingmodelsdev.APIHostto the allowlist is the right approach since every run resolves model metadata, and the newprintModelsDevAllowancehelper follows the same pattern as the existing gateway/tool-install print functions.sandbox_test.go:TestPrintModelsDevAllowanceis correctly structured witht.Parallel()and astrings.Builder.
No bugs found in the added code.
melmennaoui
approved these changes
Jun 10, 2026
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.
What
docker agent run --sandboxnow always allowlists themodels.devcatalog host in the sandbox's default-deny network proxy, so the
in-sandbox agent can fetch the model list and resolve model metadata
(context limits, pricing, capabilities).
Why
Every agent run resolves model metadata against
models.dev, but thesandbox proxy denies it by default. Without an explicit allow rule the
inner agent's first catalog lookup fails with a misleading
403 Blocked by network policy. This wiresmodels.devinto the sameauto-allowlist machinery that already opens the models gateway and the
auto-installer's package hosts.
Changes
pkg/modelsdev: exportAPIHost = "models.dev"and deriveModelsDevAPIURLfrom it so the host and URL can't drift.cmd/root/sandbox.go: always includemodelsdev.APIHostinallowSandboxHosts, and surface it via a newprintModelsDevAllowanceline alongside the gateway/tool-install output.
cmd/root/sandbox_test.go: addTestPrintModelsDevAllowance.Validation
go build ./...go test ./cmd/root/ ./pkg/modelsdev/golangci-lint run(0 issues)