How Secrets Work
When a sandbox is created with a project:- The server decrypts the project’s secrets
- Secrets are sent to the worker and sealed into opaque tokens (
osb_sealed_...) - Inside the sandbox, env vars contain sealed tokens — never real values
- When the sandbox makes an outbound HTTPS request, the MITM proxy intercepts it and replaces sealed tokens with real values in headers and request body
- The real secret only exists in the proxy’s memory on the host, never inside the VM
Creating a Project
Project.create(**kwargs)
Project name (unique per organization).
Default template for sandboxes in this project.
Default vCPU count.
Default memory in MB.
Default sandbox timeout in seconds.
Allowed egress hosts (e.g.
["api.anthropic.com"]).dict — Project info with id, name, template, etc.
Listing Projects
Project.list(**kwargs)
Returns: list[dict]
Getting a Project
Project.get(project_id, **kwargs)
UUID of the project.
dict
Updating a Project
Partial updates — only the fields you pass are changed.Project.update(project_id, **kwargs)
UUID of the project to update.
New project name (empty = no change).
New default template (empty = no change).
New default vCPU count (0 = no change).
New default memory in MB (0 = no change).
New default timeout in seconds (0 = no change).
New allowed egress hosts (None = no change).
dict
Deleting a Project
Project.delete(project_id, **kwargs)
Returns: None
Setting a Secret
Project.set_secret(project_id, name, value, **kwargs)
UUID of the project.
Secret name (used as the env var name in sandboxes).
Secret value (encrypted at rest, never returned by API).
None
Listing Secrets
Project.list_secrets(project_id, **kwargs)
Returns: list[str]
Deleting a Secret
Project.delete_secret(project_id, name, **kwargs)
Returns: None
Creating a Sandbox with a Project
Pass theproject parameter to Sandbox.create() to inherit the project’s config and secrets:
timeout, envs, cpu_count, etc.) override project defaults.