Code Interpreter
Deploy the Code Interpreter service, connect IntelliAsk to it, and turn on the optional code features.
This page covers the admin side of the Code Interpreter. Code runs in a separate service, the codeapi stack, which ships with IntelliAsk. IntelliAsk sends it code and files and authenticates each request. Every IntelliAsk-side variable mentioned here is listed in the .env reference; the service itself is documented under Services ? Code Interpreter.
Deploy the service
Code Interpreter is deployed with the rest of the stack; see Deploy ? Components ? Code Interpreter. The service is made of an API gateway, sandboxed workers, an egress gateway, a tool-call broker, and a file server, which scale independently of IntelliAsk. Workers isolate code with NsJail user namespaces. Memory and CPU limits, upload size, request quotas, and network access for sandboxed code are set on the codeapi service, not in IntelliAsk.
Connect IntelliAsk
The stack wires IntelliAsk to the service for you: INTELLIASK_CODE_BASEURL points at the in-stack codeapi-api service. Then check that code execution is allowed:
execute_codemust be inendpoints.agents.capabilities. It is in the default list.- Users need the run-code permission.
interface.runCodeseeds it for theUSERrole and controls the Run Code button on code blocks. The same permission gates the Run Code tool in the Agent Builder.
Authentication
There is no API key to manage. IntelliAsk authenticates to the Code Interpreter with a short-lived Ed25519 JWT that it mints per request (CODEAPI_AUTH_PROVIDER=intelliask-jwt); the signing keys are auto-provisioned with the stack. The issuer, audience, key ID, algorithm, and keys must match on both services. See Services ? Code Interpreter ? Security for how request authentication and signed execution manifests work, and the JWT section of the .env reference for each variable.
Multi-tenant deployments should provide an authenticated tenant context and set TENANT_ISOLATION_STRICT=true in IntelliAsk and CODEAPI_TENANT_ISOLATION_STRICT=true in the service. Strict mode rejects requests without a tenant instead of falling back to the single-tenant ID.
File uploads and previews
IntelliAsk uploads conversation files to the service before a run and retries uploads that hit a 429 rate limit, honoring Retry-After within a bounded wait. Tune that per user and route with codeApiUploadConcurrency and codeApiMaxRetryWaitMs.
Generated files get an inline preview up to FILE_PREVIEW_MAX_EXTRACT_BYTES (2 MiB by default; see Inline File Previews). Images the agent reads from the sandbox display inline up to 1 MiB. Set INTELLIASK_CODE_SANDBOX_OUTPUT_MAX_SIZE to match the worker's SANDBOX_OUTPUT_MAX_SIZE so IntelliAsk reads images in as few requests as possible; INTELLIASK_CODE_IMAGE_CHUNK_BYTES only pins the transfer window and does not raise the 1 MiB limit.
Previews render in the Artifacts panel through the static Sandpack bundler.
Upgrading with old code outputs
Deployments that regenerated the same Code Interpreter filename before the unique output-file index existed may have duplicate MongoDB records that stop the index from building. Preview the repair with intelliask shell intelliask -- npm run migrate:code-file-duplicates:dry-run, then apply it with intelliask shell intelliask -- npm run migrate:code-file-duplicates.
Optional features
Each of these is off until you turn it on.
- Programmatic Tool Calling: add
programmatic_toolsalongsideexecute_codein the agents capabilities. Requires the service's Tool Call Server. - Background execution: add
run_in_backgroundto the agents capabilities. Delivery of finished results and cancellation are set underbackgroundTasks. - Stateful code sessions: add
stateful_code_sessionsto the agents capabilities and either setINTELLIASK_CODE_BASEURL_STATEFULto a deployment that advertises thestatefulprofile, or configure named environments. Stateless agents keep usingINTELLIASK_CODE_BASEURL; stateful requests never fall back to it. This feature is experimental and may change. - Code environments (attached machines, personal workers, pairing, per-chat machine choice, approval policy): configured under
statefulCodeSessions. Copying chat attachments into an attached workspace is bounded byendpoints.agents.workspaceAttachments:timeoutMs(default 10000, range 1000 to 120000) andconcurrency(default 3, range 1 to 16).
Last updated on