Drop the SDK into the framework you already use. Real-time spans, evals, and runtime enforcement: no gateway in your request path, no rearchitecting your deploy pipeline to get it.
Native for LangChain, LiveKit, Claude Agent SDK & Vercel AI SDK, a framework-agnostic core SDK for everything else.
$ pip install prefactor-langchain from prefactor_langchain import PrefactorMiddleware middleware = PrefactorMiddleware.from_config(agent_id="my-agent")
Every option forces a tradeoff: ship fast with no visibility, or bolt on a gateway that sits in your request path. Prefactor is neither, a native integration for the framework you already run.
Every call routes through a proxy in your request path: added latency, another system to run.
Spans ship asynchronously off the critical path: 0ms added to your agent's response.
Native packages for LangChain, LiveKit, Claude Agent SDK, and Vercel AI SDK, plus a framework-agnostic core SDK for everything else: CrewAI, Mastra, LangGraph, and more.
The SDK instruments in-process and ships spans asynchronously. Your calls go straight to your model provider; nothing sits between your agent and its response.
Where a framework has a native interception point, such as LangChain's callback handlers or Claude Agent SDK's PreToolUse hook, Prefactor's runtime policies run through it, not around it.
LLM calls, tool invocations, and agent spans, captured the moment they happen, with token usage and cost attached. See the full integrations list → for what this looks like across frameworks.
Every run gets compared against prior versions and environments, so a regression shows up as a trend the day it starts, not a support ticket a week later. See quality assessment → for how the comparison works.
withSpan() wraps any operation, a tool call, a data write, so a policy can hold or block it before your code runs, not after. See the support-bot case study → for a real handoff built this way.
A Bitcoin custody company's support bot runs on LangGraph. When it hits a step it can't reliably interpret, a screenshot, an ambiguous instruction, Prefactor's real-time monitoring catches the stuck pattern and triggers a human handoff, all through the same LangGraph callback events the agent already emits. No separate monitoring stack, no rewritten agent logic.
Every framework gets you to a working agent fast. None of them ship the governance layer, and the gap looks different depending on your stack.
Tool calls run against production systems with no built-in approval flow, and max_iterations defaults can quietly burn real money per run before anyone notices. Prefactor hooks into LangChain's own callback handlers to add both.
Computer-use agents can take real-world actions with only application-level audit trails and no native approval flow for the high-impact ones. Prefactor runs through the SDK's PreToolUse hook to add policy enforcement before execution.
Edge runtime traces don't persist without an external sink, and tool authorization is binary: allowed or not, nothing in between. Prefactor adds a durable trace store and graduated policy responses on top.
Every tool call and data access gets evaluated against your rules as it happens, not sampled after the fact. See runtime policies →.
A high-risk action pauses and routes to the right approver with full context on what triggered it, no Slack screenshot required. See approval routing →.
Scoped to a single run, one agent, or a whole team, triggered from Prefactor or programmatically from your own code. See the kill switch →.
LangSmith and Langfuse are good at showing you what an agent did. Prefactor does that too, but the job doesn't stop at visibility: a policy has to be able to hold or block the next action before it runs, not just log that it happened. See Prefactor vs. LangSmith → or vs. Langfuse → for the honest breakdown of where each one fits.
Book a demo and we'll walk through your actual framework: real spans, real policies, on a fleet like yours.
Prefactor helps teams observe, evaluate, and improve their AI agents in production — across every framework and provider.