Configuration
Configure your own Worker's wrangler.jsonc for stateless or stateful mode, the runtime Worker's wrangler.jsonc, and guest environment variables.
Configuration differs by mode. In stateless mode, your own Worker needs only a services entry naming the runtime Worker. In stateful mode, your own Worker additionally hosts the Sandbox Durable Object and binds it with durable_objects. Either way, the runtime Worker owns its own Interpreter Durable Object (when it has one), CPU limits, and idle-expiry settings. These pages cover both sides.
- Wrangler configuration — your Worker’s
wrangler.jsoncfor each mode, the runtime Service Bindings, and the runtime Worker’s own Durable Object binding, migration, and deploy settings. - Bindings — the runtime Service Bindings used by both modes, the
SandboxDurable Object binding stateful mode adds, and binding-name rules thatcreateCodeContext({ binding })resolves by name. - Environment variables — passing
envVarsto guest code in both modes, layeringsetEnvVarsand context-level vars in stateful mode, andSANDBOX_IDLE_TTL_MSvs.INTERPRETER_IDLE_TTL_MS.
Related resources
- Get started with stateless mode — add a
servicesentry and call the freerunCode. - Get started with stateful mode — install the client and run your first code context.
- Deploy a runtime Worker — deploy a private runtime Worker with a deploy button or the CLI.
- Security model — isolation guarantees and public-caller responsibilities.