Create a runtime over HTTPS. Secrets and a network policy attach to that same microVM.
1Your sideApplication or agentGravix Layer SDK or the REST API
createrun_coderun_cmd
HTTPS
2RuntimeDedicated microVMNo shared kernel. Torn down on kill.
filesystempython · jsshellgit
Attached to the runtime
SecretsEnvironment variablesInjected on each execution
Network policyAllowlist or denylistWhat the runtime may reach
What you get
Why sandboxes
Agents generate code and commands you cannot fully predict. A runtime keeps that work inside an isolated boundary so it does not touch your host credentials or local files. Each runtime has its own CPU, memory, and disk. It stays up until you terminate it (unless you set a timeout).Client defaults
Installgravixlayer (Python) or gravixlayer (TypeScript). Set GRAVIXLAYER_API_KEY.
Cloud and region belong on the client. create() uses the base-small template unless you pass another template or a snapshot.
GRAVIXLAYER_CLOUD and GRAVIXLAYER_REGION. The SDKs fill cloud and region into the create body from the client, so the REST examples show them explicitly; omit them and the API falls back to the platform default.
AWS us-east-1 (Virginia) and ap-south-1 (Mumbai) are available today. Azure and GCP are coming soon — see Multi-Cloud Support.
Basic usage
With secrets
Attach an Identity provider when you create the runtime. The nextruntime run or runtime exec receives those keys as environment variables. An interactive shell does not.
Templates
create() uses base-small unless you pass another template or a snapshot. Sizes and the toolchain are on Templates.
Lifecycle
Create a runtime, run work in it, snapshot if you want to reuse it, then terminate it.
1CreateFrom a template or a snapshot
2ExecuteCode, commands, and files
3SnapshotOptional named checkpoint
4TerminateKill it. Billing stops.
appsandbox = client.runtime.create()
oksandbox ready · ~25 ms · sbx_7f3a
appsandbox.run_code(code="print(2 + 2)")4
appsandbox.run_cmd(command="pip", args=["install", "pandas"])exit 0
appclient.snapshots.create(runtime_id=sandbox.runtime_id, name="deps")snap_a91c
appsandbox.kill()
oktorn down · billed 12.4 s
- Create from a template or a snapshot (optionally attach secrets and network policies).
- Execute code and commands; attached secrets inject per execution.
- Snapshot (optional) to save a named checkpoint, then start more runtimes from it.
- Terminate with
sandbox.kill()when finished.
Next
Create Runtime
Parameters and response fields
Web Services
HTTPS URLs for guest HTTP ports
Identity Providers
Inject credentials safely
Network Policies
Control outbound access