Repository navigation
Integrations Langsmith Tool Gateway
Experimental: this works and is tested, but may change and gets less hardening than the stable core.
LangSmith's Tool Gateway is a managed layer that sits between agents and the MCP servers they call: it holds the credentials, knows which identity a call runs as, and applies its deny and approval policies. Each tool kit is one MCP URL. Tracekit adds what it doesn't: a decision before the call leaves your side, and a signed, hash-chained record that neither the agent nor LangSmith can edit and that verifies offline.
| LangSmith's Tool Gateway | Tracekit | |
|---|---|---|
| Holds | The credentials for each MCP server, the access and identity of each caller | The signing key and the policy; for the LangSmith API key, see the two paths below |
| Decides | Its own deny and approval policies, on every call | Your Tracekit policy, before the call is sent, with approvals bound to the exact arguments |
| Records | An optional trace per call: the tool, the server and the identity. Not the data sent or returned | A signed event for the decision and for the result, committed to by the signer, verified offline |
Both policies apply: Tracekit decides first, and a call it allows can still be blocked by LangSmith. That call is recorded as an error, whichever form its refusal takes (a tool error or a JSON-RPC error).
path 1: agent --> tracekit mcp-gateway --Streamable HTTP, X-Api-Key--> LangSmith Tool Gateway --> your MCP servers
|
+-- decide, approve, complete --> signer
path 2: LangChain agent (TracekitMiddleware) --X-Api-Key--> LangSmith Tool Gateway --> your MCP servers
|
+-- decide, complete --> signer
Run Tracekit's MCP gateway (a v2 signer that lists it under gateways, its http and signer
sections, agents that send their run in X-Tracekit-Run), and add the kit as one upstream:
upstreams:
- name: langsmith # tools listed as langsmith__<tool>, decided as mcp:langsmith/<tool>
url: https://api.smith.langchain.com/v1/managed-tools/kits/<kit-id>/mcp
headers: {X-Api-Key: secrets/langsmith.key} # the file holds the LangSmith API key, one line
settings: {X-Tenant-Id: <workspace-id>} # only for an organization-scoped key: not a secrettracekit mcp-gateway serve --config mcp-gateway.yamlPoint the agent at the gateway's /mcp, not at LangSmith. The API key stays in the gateway's secret file: the agent's
own headers are never forwarded, and the key is cut from everything the gateway answers or records.
-
A rule names the kit and the tool:
mcp:langsmith/<tool>. Name the upstream after the kit if you use several. -
Custody holds only while the agent can't reach LangSmith itself. An agent that holds a LangSmith key can call the
kit around Tracekit. Give the key only to the gateway, and fence the agent's egress to
api.smith.langchain.com(Kubernetes). - Whose credentials a call uses is LangSmith's choice and depends on the key type (a personal access token acts as you; a service or agent key acts as the user, agent or profile LangSmith is told). Tracekit's record names the agent that called, and the upstream sees one caller, Tracekit's gateway.
If the agent is a LangChain create_agent agent that loads the kit with langchain-mcp-adapters, wrap it with
TracekitMiddleware and the call is decided and signed in the agent's process:
import asyncio
import os
from langchain.agents import create_agent
from langchain_mcp_adapters.client import MultiServerMCPClient
from tracekit.integrations.langchain import TracekitMiddleware
from tracekit.sdk.client import Client
async def main():
kit = MultiServerMCPClient({"langsmith": {
"transport": "streamable_http",
"url": "https://api.smith.langchain.com/v1/managed-tools/kits/<kit-id>/mcp",
"headers": {"X-Api-Key": os.environ["LANGSMITH_API_KEY"], "X-Tenant-Id": os.environ["LANGSMITH_WORKSPACE_ID"]},
}})
tools = await kit.get_tools()
with Client().run(agent="support-agent") as run: # the client and run, as in the LangChain page
agent = create_agent("anthropic:claude-sonnet-5-5", tools,
middleware=[TracekitMiddleware(run.client, run.run_id, run.run_token)])
out = await agent.ainvoke({"messages": [("user", "file a ticket for the printer")]})
print(out["messages"][-1].content)
asyncio.run(main())(X-Tenant-Id is only for an organization-scoped key.) Here the agent's process holds the API key (the middleware is
inside the agent), so this path gives the decision and the signed record but not custody of the key. With the dev
signer that Client() starts, the agent can also reach the signing key, so tracekit verify says the record is not
proof against the agent; point Client at a signer the agent can't reach (deploy). The
tool is decided under the name LangChain gives it (create_ticket), not mcp:langsmith/create_ticket, so a rule for
it names the tool that way (^create_ticket$). Use path 1 when the agent mustn't hold the key.
langchain-mcp-adapters needs mcp 1.x (0.3.2 installs 1.30.0; 0.3.1 fails to import against mcp 2.3). The MCP
gateway of path 1 needs mcp>=2.3,<2.4. They don't share an environment: install the adapters where the agent runs
and the gateway where it runs.
- LangSmith: stores the MCP servers' credentials, authenticates the caller, applies its deny and approval policies, and may trace each call.
- Tracekit: decides each call before it is sent, holds risky ones for a person, signs the decision and the result. Path 1 also keeps the LangSmith key away from the agent and the signer.
-
The record: a signed bundle (
tracekit export,tracekit verify) that a reviewer checks without LangSmith or Tracekit running.
Confirmed from LangSmith's docs (beta, Plus and Enterprise plans): the kit URL is
<langsmith-api-url>/v1/managed-tools/kits/<kit-id>/mcp, it speaks Streamable HTTP, and it takes the key in
X-Api-Key (plus X-Tenant-Id for an organization-scoped key).
-
Tested: path 1 against a stand-in kit, a local Streamable HTTP MCP server that requires
X-Api-KeyandX-Tenant-Idand records what it receives (tests/test_langsmith_tool_gateway.py): an allowed call reaches it with the headers and is signed and completed (tier T2), a denied call never reaches it, a kit that refuses a call by a tool error or by a JSON-RPC error is recorded as an error, a tool that echoes the key is cut from what the agent gets and from every record, the content vault and the bundle, and the exported bundle verifies. -
Tested, by hand on 2026-11-20: path 2 in a scratch environment (
langchain1.4.10,langgraph1.2.24,langchain-core1.8.4,langchain-mcp-adapters0.3.2,mcp1.30.0) against the same stand-in kit, with a fake chat model that asks forcreate_ticketanddelete_ticket: the stand-in receivedcreate_ticketwith the key, a deny rule ondelete_ticketkept that call from it, and the record, signed through the middleware, verified. The script that did it is not in the repo, and it isn't a test in the suite: the adapters and themcp2.3 the suite pins can't be installed together. -
Not tested: LangSmith's real Tool Gateway (it needs an account and key), including the exact shape of its
refusal (its docs show a blocked call as failed, not what the MCP client receives);
?mode=search,kits/meandservers/<id>URLs; LangSmith's OAuth-based and"auth": "langsmith"setups (Managed Deep Agents), which don't send anX-Api-Keythe gateway could hold; approval policies on LangSmith's side (an approval LangSmith asks the client for isn't something the MCP gateway relays).
The MCP gateway's own limits apply too. Limits lists these with what to do.
Generated from docs/ at v1.8.1. Edit the docs in the repository, not here.
Get started
- Quickstart: the v2 signer
- Quickstarts
- Spending limits and receipts for any agent
- Quickstart: Claude Agent SDK
- Quickstart: Claude Code
- Quickstart: a custom agent
- Quickstart: LangChain and LangGraph
- Quickstart: MCP client
- Quickstart: OpenAI Agents SDK
- Coding agents other than Claude Code
- tracekit doctor
- Walkthrough: Tracekit end to end
How it works
- How Tracekit works
- Overview
- The life of a tool call
- The evidence format
- Verification and assurance
- Witnesses and monitoring
- Policy
- Approvals
- Detection and containment
- Capture and completeness
- Custody
- Provenance and tracekit why
- Deployment and isolation
- Storage, durability and performance
- Integrations
- Security model
- Architecture
- tracekit why: architecture
Integrations
- Integrations
- Adapters
- Signer API reference
- OpenTelemetry
- Remote clients
- Kubernetes agent-sandbox
- agentgateway
- agentsh and Tracekit
- Browser Use
- Claude Agent SDK
- Claude Code's sandbox
- Codex's sandbox
- CrewAI
- Docker MCP Gateway
- E2B
- Falco
- Gemini CLI's sandbox
- Google ADK
- Haystack
- Hermes Agent
- Inspect AI
- LangChain v1
- LangSmith Tool Gateway
- LiteLLM
- LlamaIndex
- MCP client
- microsandbox
- Microsoft Agent Framework
- OpenAI Agents SDK
- NVIDIA OpenShell
- Pydantic AI
- sandbox-runtime's proxy on its own
- Strands Agents
- Tetragon
- Vercel AI SDK
- Wassette
Policy and approvals
- Your own policy
- Policy reference
- Approvals
- Intent grants: approve costly payments once, with limits
- PCM 0.1: proof-carrying messages
- Findings
- tracekit audit
- Reading the model's reasoning
- Incidents and containment
- Webhooks
Deploy and operate
- Deploying the signer
- The signer as a container
- The signer on Kubernetes
- The compose stack
- Identity
- Tool executor
- A2A gateway
- Latent transfers and C2C
- MCP gateway
- LLM gateway
- Egress observation
- Witnesses
- Log monitor
- Record-key issuer
- Signer observability
- Viewer
- Event Horizon
- Viewer 1.4
- tracekit why: causal investigation and replay
- Migrating
- Platforms
- Deploy the public witness
Verify the evidence
- Tracekit for auditors
- Reading a v2 verify report
- Evidence format v2
- Auditor guide
- Sample evidence bundle
- Signing
- tracekit graph: what agents did across runs
- What Tracekit guarantees
Security and privacy
- Threat model: the v2 signer
- Threat model: the v1 laptop signer
- HTTP security checklist
- Threat-model review packet
- Privacy
- What the public witness sees
- Known limits and trade-offs
- What's stable
Compliance
- Compliance mapping
- EU AI Act
- ISO/IEC 42001
- NIST AI RMF and the Generative AI Profile
- OWASP Top 10 lists for LLM and agentic applications
Evaluation
Use cases and demos
- Use cases
- Demos
- Agent approvers within bounds
- A production bucket
- A production database
- Completeness and tamper evidence
- Detection and containment
- Network coverage: an egress observer
- Guardrails: allow, deny, or ask a person
- MCP tools, gated and recorded
- A production volume
- Prompt injection held by provenance
- Why: which input caused the action
Help