LangSmith launches LLM Gateway for agent governance; enforces spend caps and redacts PII at request layer
LangChain released LangSmith LLM Gateway in private beta, a runtime governance layer that sits between agentic applications and LLM provider APIs. The gateway enforces cost caps, redacts PII/secrets, and logs all policy violations as traceable events within LangSmith's observability layer. Users configure the gateway by swapping their base_url to the LangSmith Gateway endpoint, adding provider API keys to workspace secrets, and setting policies in the UI—no separate infrastructure or orchestration required.
The gateway ships with four core controls. Spend limits enforce hard caps at org, workspace, user, or API key granularity; when exceeded, agents receive a 402 response. PII and secrets detection redacts sensitive data from requests and responses before they reach the model or trace storage. Real-time spend visibility aggregates costs by workspace, user, and key, eliminating month-end invoice surprises. Trace continuity preserves observability: all gateway-proxied calls appear in the same LangSmith workspace as the agent's other traces, avoiding fragmentation.
The governance surface integrates into LangSmith's existing build, observe, evaluate workflow. When a policy fires, the blocked request appears as a traceable event in LangSmith; engineers can click through to the exact trace, adjust system prompts or tool configuration, and re-evaluate against test sets without context-switching. Every administrative action is audit-logged for compliance. This co-location of governance and observability differs from standalone guardrails platforms (which require separate tuning of evaluation models) or network-layer gateways (which lack trace context for debugging policy decisions).
The motivation is concrete: coding agents stuck in retry loops can rack up four-figure invoices overnight; customer support agents processing refund requests can leak PII (social security numbers, bank details) to LLM provider logs and downstream systems. Observability alone cannot prevent these problems; enforcement at the request layer is required. LangSmith addresses the gap by embedding governance inside the agent framework where teams already build and observe.
For teams deploying agentic systems in production, the implication is structural. Cost and data leakage are now manageable at the request boundary, not in post-hoc dashboards. This shifts agent safety from a compliance afterthought to a built-in requirement, analogous to how security teams now view API gateways as table-stakes infrastructure. Expect other agent frameworks (AutoGen, CrewAI, etc.) to incorporate similar runtime governance as standard.
Sources
- Primary source
- langchain.com
“LLM Gateway sits between your agents and LLM providers — it enforces spend limits and redacts PII before requests reach the model, stopping problems at the source”
- langchain.com
“A coding agent gets stuck in a retry loop overnight, and by morning it's made 10,000 LLM calls and you have a four-figure invoice”
- langchain.com
“Setup is intentionally boring...Swap the base_url. Keep your code.”