Skip to main content

Configuration

The complete environment-variable reference for the Code Interpreter, grouped by microservice — every CODEAPI_*, SANDBOX_*, REDIS_*, and MINIO_* key each service reads, with defaults and whether it is required.

Every Code Interpreter service is configured entirely through environment variables. In the Compose stack these are set in config/.env under the same names the containers read (documented below); config/codeapi.compose.yml passes each one straight through.

Secrets are auto-provisioned

Every value marked (auto-provisioned) below is generated for you by intelliask secrets gen and the Garage bootstrap — you should never set these by hand. They include the JWT keypair, the execution-manifest keypair, the internal service token, the egress-grant secret, and the S3 (Garage) keys.

Shared across all services

These are read by every (or nearly every) service and must match across them.

NamePurposeDefaultRequired
LOCAL_MODELocal dev mode; disables auth verification when truefalseNo
CODEAPI_HARDENED_SANDBOX_MODEMaster security switch — env scrubbing, manifest signing, network isolationtrueNo
CODEAPI_AUTH_PROVIDERAuth mode: intelliask-jwt or noneintelliask-jwtNo
CODEAPI_INTERNAL_SERVICE_TOKENShared HMAC secret for service-to-service auth(auto-provisioned)Yes
REDIS_HOSTRedis hostnameredisNo
REDIS_PORTRedis port6379No
REDIS_PASSWORDRedis password (blank = no auth)(empty)No

Keep hardened mode consistent

CODEAPI_HARDENED_SANDBOX_MODE must be set to the same value on the api, service-worker, egress-gateway, and sandbox-runner. A mismatch (e.g. the worker signing manifests the runner doesn't require, or vice-versa) will reject jobs.

api

Container: codeapi-api · Port: 3112 · Public entry point; verifies the JWT and enqueues jobs.

NamePurposeDefaultRequired
SERVICE_PORTBind port3112No
FILE_SERVER_URLInternal URL of the file-serverhttp://codeapi-file-server:3000No
TOOL_CALL_SERVER_URLInternal URL of the tool-call-serverhttp://codeapi-tool-call-server:3033No
EGRESS_GATEWAY_URLInternal URL of the egress-gatewayhttp://codeapi-egress-gateway:3190No
SANDBOX_ENDPOINTSandbox-runner API v2 URLhttp://codeapi-sandbox-runner:2000/api/v2No
CODEAPI_JWT_ISSUERExpected JWT iss claimintelliaskNo
CODEAPI_JWT_AUDIENCEExpected JWT aud claimcodeapiNo
CODEAPI_JWT_ALLOWED_ALGSAccepted JWT algorithms (comma-separated)EdDSA,RS256No
CODEAPI_JWT_KIDKey-ID hint for JWT key selectionintelliask-codeapiNo
CODEAPI_JWT_PUBLIC_KEYPEM Ed25519 public key used to verify incoming JWTs(auto-provisioned)Yes
CODEAPI_JWT_SINGLE_TENANT_IDTenant ID all requests run under (single-tenant mode)legacyNo
CODEAPI_TENANT_ISOLATION_STRICTRequire an explicit tenant headerfalseNo

service-worker

Container: codeapi-service-worker · Health port: 3113 · Dequeues jobs, signs the execution manifest, drives the sandbox.

NamePurposeDefaultRequired
WORKER_HEALTH_PORTHealth-check port (used by depends_on)3113No
PYTHON_CONCURRENCYMax concurrent Python jobs5No
OTHER_CONCURRENCYMax concurrent non-Python jobs (Node, Bash, …)8No
SANDBOX_ENDPOINTSandbox-runner API v2 URLhttp://codeapi-sandbox-runner:2000/api/v2No
EGRESS_GATEWAY_URLInternal URL of the egress-gatewayhttp://codeapi-egress-gateway:3190No
CODEAPI_EXECUTION_MANIFEST_PRIVATE_KEYEd25519 private key used to sign execution manifests(auto-provisioned)Yes
CODEAPI_JWT_SINGLE_TENANT_IDTenant ID (single-tenant mode)legacyNo
CODEAPI_TENANT_ISOLATION_STRICTRequire an explicit tenant headerfalseNo

file-server

Container: codeapi-file-server · Port: 3000 · S3-compatible object I/O for job files, backed by Garage.

NamePurposeDefaultRequired
FILE_SERVER_PORTBind port3000No
MINIO_ENDPOINTS3 endpoint hostname (Garage or external)garageNo
MINIO_PORTS3 endpoint port3900No
MINIO_USE_SSLUse HTTPS to S3falseNo
MINIO_BUCKETS3 bucket nameintelliask-codeinterpreterYes
MINIO_ACCESS_KEYS3 access key ID(auto-provisioned)Yes
MINIO_SECRET_KEYS3 secret access key(auto-provisioned)Yes

MINIO_* are the S3 credentials

Despite the name, MINIO_* are just the generic S3 client settings. By default they point at the bundled Garage store; set them to an external S3 endpoint (AWS S3, MinIO, etc.) to use your own object storage. They must match the keys created by the Garage bootstrap. See Components → Garage.

tool-call-server

Container: codeapi-tool-call-server · Port: 3033 · Brokers tool/function calls and manages sessions.

NamePurposeDefaultRequired
TOOL_CALL_SERVER_PORTBind port3033No
TOOL_CALL_REQUEST_TIMEOUTMax time per tool call (ms)300000 (5 min)No
TOOL_CALL_SESSION_EXPIRYIdle session lifetime (seconds)600No

egress-gateway

Container: codeapi-egress-gateway · Port: 3190 · Forward proxy for all sandbox outbound traffic; signs and verifies egress grants.

NamePurposeDefaultRequired
SERVICE_NAMEService identifier (logging)egress-gatewayNo
EGRESS_GATEWAY_PORTBind port3190No
EGRESS_GATEWAY_MAX_TOOL_CALL_BYTESMax bytes per proxied tool-call request1048576 (1 MiB)No
CODEAPI_EGRESS_LEDGER_REQUIREDRequire a signed egress grant per requesttrueNo
EGRESS_GATEWAY_FILE_SERVER_URLFile-server URL (internal)http://codeapi-file-server:3000No
EGRESS_GATEWAY_TOOL_CALL_SERVER_URLTool-call-server URL (internal)http://codeapi-tool-call-server:3033No
CODEAPI_EGRESS_GRANT_SECRETHMAC secret used to sign egress grants(auto-provisioned)Yes

sandbox-runner

Container: codeapi-sandbox-runner · Port: 2000 · Privileged. Executes untrusted code in NsJail. This service has the largest surface because it governs isolation, resource limits, and the sandbox filesystem.

Isolation & mounts

NamePurposeDefaultRequired
KVM_ENABLEDUse libkrun microVM isolation (true) vs direct NsJail (false)falseNo
SANDBOX_PACKAGES_DIRECTORYRead-only mount point for language runtimes/pkgsNo
NSJAIL_PATHPath to the NsJail binary/usr/sbin/nsjailNo
NSJAIL_CONFIGPath to the NsJail config (mounts, namespaces, seccomp)/sandbox_api/config/sandbox.cfgNo
SANDBOX_CHECK_CGROUP_LIMITSVerify cgroup v2 support at startup (fails fast if missing)trueNo
SANDBOX_EXTRA_READONLY_DIRSColon-separated paths bind-mounted read-only into every sandbox/app/client/public/imagesNo
LAUNCHER_VCPUSmicroVM vCPU count (only when KVM_ENABLED=true)2No
LAUNCHER_RAM_MIBmicroVM RAM in MiB (only when KVM_ENABLED=true)2048No

SANDBOX_EXTRA_READONLY_DIRS is shared across tenants

Anything listed here is visible to every job, of every tenant. Only expose non-sensitive shared assets (e.g. public image directories) — never secrets or per-user data.

Resource & output limits

NamePurposeDefaultRequired
SANDBOX_RUN_TIMEOUTMax wall-clock time per job (ms)300000 (5 min)No
SANDBOX_RUN_CPU_TIMEMax CPU time per job (ms)300000 (5 min)No
SANDBOX_COMPILE_TIMEOUTCompilation-phase timeout for compiled langs (ms)30000 (30 s)No
SANDBOX_RUN_MEMORY_LIMITMemory cgroup limit (bytes; -1 = unlimited)1073741824 (1 GiB)No
SANDBOX_RLIMIT_ASVirtual address-space limit (MB)4096No
SANDBOX_RLIMIT_AS_BROWSERAddress-space limit for browser jobs; inf/max/numberinfNo
SANDBOX_RLIMIT_FSIZEMax file size a job may write (MB)100No
SANDBOX_EXECUTE_BODY_LIMITMax request body (code payload) size50mbNo
SANDBOX_OUTPUT_MAX_SIZEMax stdout/stderr captured per job (bytes)65536 (64 KiB)No
SANDBOX_MAX_CONCURRENT_JOBSMax parallel jobs on this runner8No
SANDBOX_UPLOAD_CONCURRENCYConcurrent S3 uploads per job8No
SANDBOX_WORKSPACE_REAPER_MAX_AGE_SECONDSAge at which idle workspaces are cleaned up (s)3600No
SANDBOX_LOG_LEVELLog verbosity (DEBUG/INFO/WARN/ERROR)INFONo

Browser jobs need more memory

Chromium (Playwright) needs roughly 1 GiB, which is why SANDBOX_RUN_MEMORY_LIMIT defaults to 1073741824. Browser jobs also use SANDBOX_RLIMIT_AS_BROWSER=inf because Chromium's V8 reserves a very large virtual address space — a numeric cap would crash it with SIGTRAP.

Network & security

NamePurposeDefaultRequired
SANDBOX_DISABLE_NETWORKINGIsolate the sandbox from the network (only the egress-gateway is reachable)trueNo
SANDBOX_ALLOWED_LOCAL_NETWORK_PORTThe single local port the sandbox may reach (the egress-gateway)3190No
SANDBOX_REQUIRE_EGRESS_MANIFESTReject unsigned job requeststrueNo
EGRESS_GATEWAY_URLEgress-gateway URL for allowed outbound requestshttp://codeapi-egress-gateway:3190No
SANDBOX_FORWARD_TARGETFallback egress target if the primary gateway failscodeapi-egress-gateway:3190No
SANDBOX_EXECUTION_MANIFEST_PUBLIC_KEYEd25519 public key used to verify execution manifests(auto-provisioned)Yes

Browser support

NamePurposeDefaultRequired
PLAYWRIGHT_BROWSERS_PATHPath to the Chromium build for browser jobs${SANDBOX_PACKAGES_DIRECTORY}/ms-playwright (auto-derived)No

Redis

Container: redis · Job queue, cache, tool-call sessions, and the egress-grant ledger. Every codeapi service reads these REDIS_* keys.

NamePurposeDefaultRequired
REDIS_HOSTRedis hostnameredisNo
REDIS_PORTRedis port6379No
REDIS_PASSWORDRedis auth password(empty)No

Garage (S3)

Container: garage · The bundled S3 store backing the file-server. See Components → Garage for the full lifecycle.

NamePurposeDefaultRequired
GARAGE_RPC_SECRETInternal cluster secret (node-to-node auth)(auto-provisioned)Yes
GARAGE_ADMIN_TOKENAdmin API token used by the bootstrap to create the bucket/keys(auto-provisioned)Yes
MINIO_ACCESS_KEYS3 access key (shared with the file-server)(auto-provisioned)Yes
MINIO_SECRET_KEYS3 secret key (shared with the file-server)(auto-provisioned)Yes
MINIO_BUCKETS3 bucket for job filesintelliask-codeinterpreterYes

Applying changes

The Code Interpreter services read env at startup, so after editing any CODEAPI_* value in config/.env, recreate the affected services:

intelliask up codeapi-api codeapi-service-worker codeapi-sandbox-runner
# or simply bring the whole codeapi profile back up:
intelliask up

Run intelliask env doctor first to confirm every variable is wired between config/.env and the compose files.

Last updated on