Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

Deployment Helpers

These variables are consumed by the repository’s Docker Compose and Kubernetes helpers, then passed to the server or gateway-specific variables listed below.

VariableDefaultDescription
SANDBOX_PROXY_DOMAINSemptyComma-separated DNS domains for host-based sandbox data-plane URLs. In multi-node deployments this single value is applied to both gateway routing and runtime sandbox response metadata.

Server

VariableDefaultDescription
API_ADDR0.0.0.0:8000Address and port the API server listens on
AENV_CONFIG_PATHconfig/default.tomlPath to the TOML configuration file
AENV_LOG_FORMATcompactServer log output format: compact, pretty, or json
AENV_LOG_SPAN_EVENTSoffTracing span lifecycle events to emit: off, new, enter, exit, close, active, or full
AENV_NODE_IDhostname-derivedOverride the runtime node identifier used in observability/admin snapshots
AENV_CLUSTER_IDnil UUIDOverride the cluster UUID used for P2P peer discovery and scheduler grouping
AENV_SERVICE_INSTANCE_IDrandom UUIDv7Override the per-process service instance UUID included in heartbeats
AENV_OBSERVABILITY_SCHEDULER_REPORT_ENABLEDfrom configEnable scheduler heartbeat reporting
AENV_OBSERVABILITY_SCHEDULER_ENDPOINTunsetOverride scheduler heartbeat reporting endpoint
AENV_OBSERVABILITY_REPORT_INTERVAL_SECS5Override heartbeat reporting interval in seconds
AENV_CUSTOM_EXTENSION_URLunsetOverride [custom_extension].url, the HTTP base URL of the custom extension service
AENV_SANDBOX_PROXY_DOMAINSfrom configComma-separated DNS domains that enable server-side host-based sandbox proxy URLs like {port}-{sandboxID}.{domain} and populate the sandbox response domain field. Empty or unset keeps [sandbox_proxy].domains.
AENV_HOME_PATH/var/lib/aenvOverride the base directory from which AgentENV derives local state, caches, logs, generated configs, and downloaded dependencies. Component-specific path settings remain available as advanced overrides.
AENV_RUNTIME_PATH/run/aenvOverride the transient runtime directory used for network namespace mount points and the default ublk daemon socket.
AENV_DEPS_PATH$AENV_HOME/depsOverride root directory for auto-downloaded runtime assets (Firecracker, kernel, tools drive).
AENV_SNAPSHOT_LOCAL_CACHE_PATH$AENV_HOME/snapshot-local-cacheOverride the snapshot manager’s node-local artifact/cache root
AENV_SNAPSHOT_STORE$AENV_HOME/snapshot-storeOverride the posix_fs snapshot repository root directory
AENV_UBLK_DAEMON_BINARY_PATH$AENV_HOME/ublk/uvm-ublk-daemonOverride path to the uvm-ublk-daemon binary
AENV_UBLK_DAEMON_METRICS_LISTEN_ADDR0.0.0.0:9103Override ublk daemon Prometheus metrics listen address; empty string disables it
AENV_FORCE_SYSCTL_TUNINGunsetSet to 1 to force sysctl tuning in a privileged container with writable host sysctls. Normally skipped automatically inside containers.
AENV_FIRECRACKER_WORK_DIR$AENV_HOME/firecracker-workOverride the parent directory for per-sandbox Firecracker work directories.
AENV_FIRECRACKER_SERIAL_DIR$AENV_HOME/logs/serialOverride the directory for persistent Firecracker serial output. Files are grouped under {serial_dir}/{sandbox_id}/.
AENV_PERSISTED_SANDBOX_STORE_PATH$AENV_HOME/persisted-sandboxesOverride the directory where paused sandbox state is persisted across server restarts.

E2B SDK / CLI

These variables configure the E2B SDK and CLI to point at an AgentENV server. Values depend on your deployment mode.

VariableDescription
E2B_API_URLAgentENV server API base URL
E2B_SANDBOX_URLSandbox proxy URL (for WebSocket and process interaction)
E2B_API_KEYAPI key for authentication
E2B_ACCESS_TOKENAccess token (used by e2b template commands)

Values by Deployment Mode

Manual compile (single node):

export E2B_API_URL=http://127.0.0.1:8000
export E2B_SANDBOX_URL=${E2B_API_URL}
export E2B_API_KEY=e2b_000000
export E2B_ACCESS_TOKEN=dummy

Docker Compose / Kubernetes (multi-node):

export E2B_API_URL=http://127.0.0.1:8080
export E2B_SANDBOX_URL=${E2B_API_URL}
export E2B_API_KEY=e2b_000000
export E2B_ACCESS_TOKEN=dummy

In both modes, sandbox data-plane requests can use routing headers with E2B_SANDBOX_URL=${E2B_API_URL}. The explicit /proxy prefix (${E2B_API_URL}/proxy) is still accepted for back-compat.

For local development, any non-empty value works for E2B_API_KEY and E2B_ACCESS_TOKEN because the server only checks that the auth header is present.

Gateway and Scheduler

These variables apply to both the gateway and scheduler processes.

VariableDefaultDescription
LOG_LEVELinfoLog level: debug, info, warn, or error
LOG_FORMATautoLog output format: auto, console, or json

Gateway

VariableDefaultDescription
GATEWAY_HTTP_LISTEN_ADDR:8080HTTP listen address
GATEWAY_METRICS_LISTEN_ADDR:9102Prometheus metrics listen address
GATEWAY_SCHEDULER_ADDR127.0.0.1:9090Scheduler gRPC address for routing and node lookup
GATEWAY_QUERY_ONLY_SCHEDULER_ADDRunsetOptional secondary scheduler gRPC address used only for sandbox data-plane LookupNode queries. When set, creation and control-plane calls still go to GATEWAY_SCHEDULER_ADDR.
GATEWAY_REQUEST_TIMEOUT30sOverride the gateway’s HTTP request timeout (for example, 1m30s)
GATEWAY_SANDBOX_PROXY_DOMAINSfrom configComma-separated DNS domains that enable gateway host-based sandbox proxy URLs like {port}-{sandboxID}.{domain}. Empty or unset keeps gateway.sandbox_proxy_domains.
GATEWAY_DEBUG_MODEfalseEnable gateway debug mode

Scheduler

VariableDefaultDescription
SCHEDULER_GRPC_LISTEN_ADDR:9090gRPC listen address
SCHEDULER_METRICS_LISTEN_ADDR:9101Prometheus metrics listen address
SCHEDULER_STRATEGYround_robinNode selection strategy for new sandboxes: round_robin or random
SCHEDULER_REDIS_ADDRunsetRedis address for persistent sandbox-to-node bindings (for example, redis:6379). Unset = in-memory bindings, lost on scheduler restart.
SCHEDULER_BINDING_TTL30sHow long a sandbox-to-node binding is kept without a confirming heartbeat. Accepts Go duration strings (for example, 1m).
SCHEDULER_ARTIFACT_STORE_CAPACITY1000000Maximum number of P2P artifact entries held in the scheduler’s in-memory index
SCHEDULER_ARTIFACT_LOOKUP_NODE_LIMIT0Maximum number of nodes checked per P2P artifact lookup. 0 means no limit.