Choose an internet setting
Network Control currently supports these two settings. Domain and IP allowlists are not available.
Create an offline computer
Passnetwork_policy={"mode": "off"} when you create a computer with Python, or networkPolicy: { mode: "off" } with TypeScript. The CLI provides the same choice through --no-internet.
The Python and TypeScript examples print information about the computer’s operating system. Commands and terminal sessions remain available while outbound internet access is off.
Keep the setting with the computer
Internet access is fixed when the computer is created. Stopping, starting, and restoring a computer keeps the same setting. This makes an offline workflow predictable when an agent resumes work later. You can read the selected setting from the computer response:Use an offline computer with local home storage
An offline computer uses the default home storage. A persistent home is a saved home folder that uses external storage, and it needs internet access. Keeppersistent_home=False in Python or persistentHome: false in TypeScript when you select off.
Use the default open setting when your workflow needs a persistent home. Learn more about saved work in Keep work between sessions.
Use Network Control with OpenAI Agents
CelestoSandboxClientOptions accepts the same policy when it creates a hosted computer for an OpenAI agent. Install the OpenAI Agents integration first with pip install "celesto[openai-agents]".
network_controlled_agent.py
computer_id, the requested policy must match that computer’s saved setting. Omit network_policy when you want to reuse the computer’s existing setting. For a complete agent workflow, see Sandbox an OpenAI agent with Celesto or SmolVM.
