Submilli is a dedicated secure runtime for code-mode agents, with built-in isolation, governance, and permissions.
langchain-submilli is the Python integration for
LangChain and
Deep Agents. It lets your agent
execute TypeScript code in Submilli's runtime.
Docs · Connect Deep Agents · Package reference · Submilli runtime · Discord · Website
Copy this prompt into your coding agent to connect your LangChain or Deep Agents project to Submilli:
Show prompt
Connect this project’s LangChain or Deep Agents agent to Submilli. Follow
https://submilli.ai/docs/tutorials/connect-deepagents/.
Keep the existing model. Show me how existing application tools will be
available to the agent, and which calls will go through Submilli.
Show me the Blueprint and code changes. Test with mocked model responses.
Code mode lets agents write code instead of calling tools one at a time. The agent submits code, and Submilli compiles and runs it in WebAssembly for isolation. Programs have no direct access to the network or host filesystem. Programs use Packages to access external systems, and Blueprints define which operations are allowed. See the execution challenges for why isolation alone is not enough.
Suppose your support agent can send replacements with shipping costs up to $25. A prompt can ask the model to respect that limit, but the model can still generate code that exceeds it. Set the limit in a Blueprint, and Submilli enforces it. In the video, a replacement with $18 shipping is allowed and a replacement with $42 shipping is blocked. That replacement succeeds after the developer raises the limit to $50.
submilli-allow-deny-allow-silent.mp4
Python 3.11 or later is required.
pip install "langchain-submilli[deepagents]"For a different LangChain v1 agent, install langchain-submilli without the deepagents
extra. To use submilli-server directly from Python, install the
submilli SDK instead.
Follow Connect Deep Agents for the complete setup, including the server, Blueprint, model provider, agent, and session cleanup.
Your agent can call your existing LangChain tools from the code it runs through Submilli. Pass
those tools to SubmilliMiddleware with ptc to make them available to the program.
The integration guide
explains how these calls work. See the LangChain configuration
for the ptc option.
To control what the agent may do, create a Blueprint and register it on your server. The permissions reference covers rules for the operations your agent needs.
To pass application context or credentials to Submilli, see the middleware settings. The session reference explains reuse across turns and cleanup.
- Blueprints define rules for operation arguments, bind values per session, and deny everything else by default.
- Packages wrap APIs in operations the Blueprint can govern. Credentials can be attached by the host without being returned to the program, and curated integrations cover common services.
- Resource limits bound memory, execution time, stack depth, model tokens, and more.
- The audit trail records refusals, runs, sessions, and administrative changes.
- MCP servers can be exposed as Packages, so Blueprint rules apply to their tools.
- Server controls include HTTPS, API tokens with administrative and user roles, and an encrypted secret store.
For production, deploy with Docker Compose, Kubernetes, or Linux and systemd.
Submilli is young and moving quickly. Breaking changes are recorded in the
langchain-submilli changelog and
submilli changelog. To talk with us, email
hello@submilli.ai or join
Discord.
This repository is a uv workspace.
In the workspace, langchain-submilli uses packages/submilli directly. When published, it
depends on submilli from PyPI.
uv sync --all-packages --all-groups
uv run ruff check .
uv run ruff format .Run type checks and tests inside each package:
cd packages/submilli # or packages/langchain-submilli
uv run mypy
uv run pyright
uv run pyright --verifytypes submilli --ignoreexternal # packages/submilli
uv run pyright --verifytypes langchain_submilli --ignoreexternal # packages/langchain-submilli
uv run pytestIntegration tests start submilli-server from $SUBMILLI_BIN or PATH. A release build can
live in the ignored .submilli-bin/ directory:
SUBMILLI_BIN=$PWD/../../.submilli-bin uv run pytest tests/integration # submilli
SUBMILLI_BIN=$PWD/../../.submilli-bin uv run pytest tests/integration_tests # langchain-submilliSome langchain-submilli integration tests also need the research Blueprint.
packages/langchain-submilli/scripts/test-server.sh starts a suitable server.
From the repository root, after changing packages/submilli/src/submilli/_async_client.py,
regenerate the sync client:
uv run python packages/submilli/scripts/generate_sync.pyCI runs formatting, linting, type checks, unit tests, integration tests, and standalone wheel installation checks.
Release a package by pushing a tag that matches its pyproject.toml version:
submilli-v0.1.0 or langchain-submilli-v0.1.0. The release workflow publishes that package
to PyPI through trusted publishing. Release submilli before a langchain-submilli version
that depends on it.
