What is an environment
An environment serves as the infrastructure layer for a session:
- Container type — Currently supports
cloud(a cloud-hosted container). - Network policy — Controls the container's outbound network access.
- Packages — Pre-installs system, Python, and Node.js packages.
Fields
Parameter | Type | Required | Description |
| string | — | System-generated ID with the |
| string | — | Fixed to |
| string | Yes | Name of the environment. |
| string | No | Optional description. Defaults to |
| object | Yes | Environment configuration (type, networking, packages). |
| string | Yes | Container type. Currently fixed to |
| object | No | Network policy object. The |
| object | No | Configuration for pre-installed packages. |
| string | — | Environment status. Always |
| boolean | — | Indicates whether the environment is archived. Defaults to |
| string|null | — | Archival timestamp (ISO 8601). |
| string | — | Creation timestamp (ISO 8601). |
| string | — | Last update timestamp (ISO 8601). |
Network policy
The config.networking field supports three modes. All modes must use the object form; string shorthands like "unrestricted" are unsupported and will cause a 400 error.
| Mode | Value | Description |
|---|---|---|
| Unrestricted | {"type": "unrestricted"} | The container can access any external address. |
| Limited | {"type": "limited", "allow_package_managers": true} | Allows access only to known-safe public services and package managers. |
| Allowlist | {"type": "allowed_hosts", "allowed_hosts": [...]} | Restricts access to a specified list of hostnames. |
networking fields
| Parameter | Type | Description |
|---|---|---|
networking.type | string | Network policy type: unrestricted, limited, or allowed_hosts. |
networking.allow_package_managers | boolean | Whether to allow package manager access (pip, npm, and apt) in limited mode. |
networking.allowed_hosts | array | A list of allowed hostnames in allowed_hosts mode. |
Unrestricted mode
Limited mode
Allowlist mode
Preinstalled packages
Use config.packages to specify packages to preinstall when the container starts:
| Package manager | Parameter | Description |
|---|---|---|
| apt | packages.apt | Debian/Ubuntu system packages. |
| pip | packages.pip | Python packages. |
| npm | packages.npm | Node.js packages (installed globally). |
Create an environment
Create a secure environment
Get environments
Update an environment
Delete an environment
"Environment is in use and cannot be deleted". Archive or delete the associated sessions first, or use POST /environments/{id}/archive to soft-delete the environment instead.
Recommended configurations
| Scenario | Recommended configuration |
|---|---|
| General development | Use the default environment; no extra configuration needed. |
| Data analysis | Preinstall pandas/numpy; use unrestricted networking. |
| Security audit | Use an allowlist for the network and install minimal packages. |
| Frontend development | Preinstall Node.js ecosystem tools; allow access to the npm registry. |
| CI/CD integration | Preinstall the Git and Docker CLIs; use allowlist mode. |
FAQ
Q: How long do I have to wait to use an environment after creating it?A: After an environment is created, its status is immediately set to ready, and you can use it to create a session right away. The actual container initialization, which includes installing dependencies, occurs when the session starts.Q: Can I specify the versions of pre-installed packages?A: Yes, you can specify versions for pip and npm packages, such as "pandas==2.1.0" or "typescript@5.0.0". apt packages use the default version from the system's repository.Q: What should I do if the Agent fails to run because of an incorrect networking configuration?A: Create a new environment or update the existing one, modify the network policy, and then restart the session.Q: What is the maximum number of environments that an account can create?A: There is no hard limit. However, we recommend that you create environments based on your actual needs to prevent management issues. We suggest using naming conventions to organize them.
Next steps
- Start a session — Use an Agent and an environment to start a task.
- Define an Agent — Review the Agent configuration.