Skip to content

Harnesses

How Submilli works with harnesses

Written by a human with AI assistance

Harnesses can integrate Submilli through MCP, HTTP, or a dedicated package.

Harness Language Integration
Mastra TypeScript MCP
LangChain Deep Agents Python Dedicated package: langchain-submilli
OpenAI Agents SDK Python MCP
Claude Agent SDK TypeScript MCP
Vercel AI SDK TypeScript The HTTP API

A harness defines a set of tools the agent can call directly.

The Submilli integration exposes Submilli as a tool that the harness can assign to agents.

With Submilli, tools are called through code. The code generated by the agent uses Capabilities from the Packages it has access to. The session’s Blueprint controls which Capabilities the code can use.

Direct calls to other tools bypass Submilli entirely. To route all tool use through Submilli, expose only Submilli’s tools directly to the agent. You can still make existing tools available to Submilli programs.

Application context is information your application knows, such as the signed-in user’s customer ID. The harness binds this context to the Submilli session so Blueprint rules can limit access, for example to that customer’s records. These values come from trusted application state, not from the model or chat.

The harness opens a Submilli session and chooses which Blueprint to use. The session holds that Blueprint and the application context while the agent runs code. The harness closes the session when the work ends.

Your existing agent may already use tools provided by its harness. Direct calls to those tools bypass Submilli entirely. For example, if the Blueprint does not allow query_orders, a Submilli program cannot call it. If you also expose query_orders directly to the agent, the agent can still call it through the harness.

To route all of the agent’s tool use through Submilli, expose only Submilli’s tools directly to the agent.

If the integration supports passing tools to Submilli, the agent can keep using them through code run by Submilli after they are removed from its direct tool access.

A harness can optionally make its tools available to Submilli. The LangChain middleware accepts them through its ptc parameter. With the HTTP API, the harness includes the tool definitions when it creates a session.

Submilli exposes these tools as a virtual @tools Package that code generated by the agent can import and use. The tools still run in your application, with its context. This is programmatic tool calling (PTC).

When code calls a tool through @tools, Submilli checks whether the Blueprint allows that tool name. If allowed, it pauses the program. The harness handles any configured approval, runs the tool, and returns the result. Submilli then continues the program.

These Blueprint rules check tool names, not arguments. For example, allowing query_orders does not limit it to one customer’s orders. Your harness or tool must enforce that limit. If you need Blueprint rules to check argument values, use the Submilli skill to create a Package that exposes those fields to Blueprint rules.

Submilli’s MCP connections do not support tools passed in by the harness. The Vercel AI SDK example uses HTTP, but does not implement this feature.

See the HTTP API reference for the protocol, the LangChain middleware reference for ptc and approvals, and the Python SDK reference for implementing the harness side.