Deep Agents Code can wire theDocumentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-opensw-1779338558-1a9c41a.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
CodeInterpreterMiddleware from langchain-quickjs into the main agent as an opt-in middleware. When enabled, the agent gains a js_eval tool that runs JavaScript in an embedded QuickJS runtime, with optional programmatic tool calling (PTC) into the host toolset.
For background on what an interpreter is and how js_eval differs from normal tool calls, see Interpreters.
The interpreter requires the
quickjs optional extra (langchain-quickjs>=0.1.2,<0.2.0). It is not included in the default install or in the all-providers / all-sandboxes meta-extras.Install the extra
dcode --interpreter without the extra installed, Deep Agents Code prints an actionable error and exits before starting the server:
Enable the interpreter
The--interpreter flag wires CodeInterpreterMiddleware (with tool_name="js_eval") into the main agent for the duration of the session. Subagents do not receive the interpreter in this release.
js_eval tool to run JavaScript:
read_file, task, web_search, etc.) from inside js_eval, enable programmatic tool calling.
Programmatic tool calling (PTC)
PTC exposes selected Deep Agents Code tools inside the interpreter under thetools.* namespace as async JavaScript functions. The agent can then write code that loops, branches, retries, or parallelizes tool calls without round-tripping each result through the model context. See Programmatic tool calling for the underlying mechanism.
js_eval itself is intentionally not gated by HITL. Per-call approval would be unusably noisy and would not block PTC fan-out anyway, so the right place to enforce safety is the allowlist.
CLI: --interpreter-tools
Pass --interpreter-tools to control the allowlist. The flag accepts one of three values:
| Value | Meaning |
|---|---|
safe | Expose the curated read-only preset (read_file, glob, grep) intersected with the live toolset. Tools not present in the session are silently dropped. |
all | Expose every live tool, including write_file, edit_file, execute, task, web_search, and fetch_url. Requires the unsafe acknowledgement (see below) unless --auto-approve is also set. |
| Comma-separated names | Expose exactly the listed tools. Names are validated against the live toolset; unknown names raise a startup error. |
The safe preset
The safe preset is restricted to tools that are already non-HITL outside the REPL:
web_search, fetch_url), subagent dispatch (task), shell execution (execute), and file writes (write_file, edit_file, MCP write tools) are deliberately excluded. Those tools are HITL-gated outside the REPL, and because PTC bypasses interrupt_on, including them in safe would silently escalate privileges. If you need them inside the REPL, list them explicitly so the intent is visible at config time, or use interpreter_ptc="all" with the unsafe acknowledgement.
The all preset
Using --interpreter-tools all (or ptc = "all" in config.toml) exposes every host tool to tools.* calls, including write/shell tools. Because PTC bypasses HITL approval, this is a deliberate sanity gate rather than a convenience toggle.
Outside of --auto-approve, you must explicitly acknowledge the implications by setting [interpreter] ptc_acknowledge_unsafe = true in config.toml. Without that acknowledgement, agent startup raises:
--auto-approve is set, every host tool is already running without prompts, so the acknowledgement is not required.
Configure via config.toml
Persist interpreter defaults under the [interpreter] section in ~/.deepagents/config.toml. CLI flags override these values for the current session.
Wire
CodeInterpreterMiddleware into the main agent on every session. Equivalent to passing --interpreter on each launch. Local-mode only.Per-
js_eval wall-clock timeout, in seconds. Applies to each invocation independently.QuickJS heap memory cap, in megabytes. Shared across all
js_eval calls in the session.Maximum
tools.* host-bridge invocations allowed per js_eval call. Because PTC calls bypass HITL approval, this budget is the only runtime limiter on bursty tool fan-out from inside the REPL.Maximum characters retained from the
js_eval result and captured stdout before truncation.PTC allowlist. Accepts
false (or []) for a pure REPL, the sentinel string "safe" or "all", or an explicit list of tool names. Invalid values fall back to the default and emit a warning at startup.Required when
ptc = "all" is set without --auto-approve. Acknowledges that every host tool, including writes and shell, is reachable from inside js_eval without HITL approval.Example: safe preset by default
dcode session enables the interpreter and exposes the curated read-only preset. Override with --interpreter-tools all or --interpreter-tools task,web_search on a per-session basis.
Example: explicit allowlist with raised limits
js_eval over many slices and needs more headroom per call.
CLI flag reference
| Flag | Description |
|---|---|
--interpreter | Enable CodeInterpreterMiddleware (js_eval) on the main agent. Local mode only; requires the quickjs extra. |
--interpreter-tools VALUE | PTC allowlist for js_eval: safe, all, or a comma-separated list of tool names. Defaults to no PTC (pure REPL). |
[interpreter] keys for the current session. Both flags work in interactive mode and in non-interactive (-n) runs.
Limitations
- Local mode only.
--interpreteris rejected when combined with--sandbox <provider>other thannone. Subagents never receive the interpreter in this release. - PTC bypasses HITL. Tools called as
tools.*from insidejs_evaldo not triggerinterrupt_on, even when those same tools require approval at the top level. The PTC allowlist is the only effective gate. - No standalone meta-extra.
quickjsis intentionally not part ofall-providersorall-sandboxes. Install it directly when you want the interpreter. - Same-process execution. QuickJS runs in the
dcodeprocess. For untrusted or semi-trusted workloads, follow the guidance in the Interpreters security notes.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

