Solutions · Developers

Guardrails that ship with your agent, not against it

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.

agent.py live
terminal
$ pip install prefactor-langchain
from prefactor_langchain import PrefactorMiddleware
middleware = PrefactorMiddleware.from_config(agent_id="my-agent")
6
spans / run
0ms
added latency
in-process
1
held for review
on_chain_startchainspan ✓
on_tool_startrefund_apipolicy check
Held1
§01 / THE STACKproblem: visibility vs. velocity

The tradeoff you shouldn't have to make

Every existing option asks you to choose: ship fast with no visibility, or bolt on an observability platform that adds a gateway to your request path and its own onboarding project. Prefactor is built to be neither — a native integration for the framework you're already running, not a new system to stand up.

Native, not bolted on

Works with your actual stack

Native packages for LangChain, LiveKit, Claude Agent SDK, and Vercel AI SDK; a framework-agnostic core SDK for everything else — CrewAI, Mastra, LangGraph, and more.

No request-path gateway

In-process, not a proxy

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.

Real enforcement, real hooks

Uses the framework's own mechanism

Where a framework has a native interception point — LangChain's callback handlers, Claude Agent SDK's PreToolUse hook — Prefactor's runtime policies run through it, not around it.

§02 / DAY ONEpath: install → enforcement

What you get on day one

Observe

Every span, real time

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.

Evaluate

Drift you'd otherwise miss

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.

Act

Custom spans you define

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.

Real example

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.

§03 / YOUR FRAMEWORKgap: what each one leaves you to build

The problem looks different depending on your stack

Every framework gets you to a working agent fast. None of them ship the governance layer — that part is bring-your-own, and it looks different depending on what you're building on.

LangChain

Tool calls, unreviewed

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.

Claude Agent SDK

Real-world actions, no gate

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.

Vercel AI SDK

Short-lived edge traces

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.

§04 / RUNTIME CONTROLpath: policy trip → response

What happens when a policy actually trips

Runtime policies

Block, throttle, or escalate

Every tool call and data access gets evaluated against your rules as it happens — not sampled after the fact. See runtime policies →.

Approval routing

Human review, in context

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 →.

Kill switch

Stop it now, no deploy

Scoped to a single run, one agent, or a whole team — triggered from Prefactor or programmatically from your own code. See the kill switch →.

Why not just use a tracer?

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.

Frequently asked questions

Do I need to change how I build my agent?
No — the SDK instruments your existing agent code. For native frameworks it’s a callback handler or middleware; for everything else it’s the framework-agnostic core SDK.
Does this add latency to my agent’s responses?
No. Observability capture ships asynchronously, off the critical path. The only inline part is the runtime policy check you opt into per agent.
What if my framework isn’t natively supported?
The core SDK (Python and TypeScript) instruments any framework via custom spans — see the full integrations list for what’s natively supported today.
Is Prefactor open source or can I self-host it?
No — Prefactor is a hosted product, not an open-source or self-hosted tool. If self-hosted, open-source tracing is a hard requirement, something like Langfuse fits that on its own; most teams still add a runtime governance layer on top once agents touch production systems.
How is this different from a tracer like LangSmith or Langfuse?
Those tools show you what an agent did after the fact. Prefactor does that too, but also evaluates and acts on it at runtime — holding, blocking, or escalating a specific action before it executes, not just logging that it happened.

Related glossary terms

See it on your own stack

Book a demo and we'll walk through your actual framework — real spans, real policies, on a fleet like yours.

Agent Performance Platform
Unified performance platform for agents, authentication, and risk management
All Systems Operational
3Global Agents
7Instances
5Services
12%Human Intervene
4High Risk
$2,360Monthly Spend
Mission ControlLive agent health with 7-day activity heartbeat
Claims Proc...68
$330/moRed
Claims Proc...65
$160/moRed
Claims Proc...82
$170/moAmber
ChatGPT74
$150/moAmber

See how every agent performs — and make it better

Prefactor helps teams observe, evaluate, and improve their AI agents in production — across every framework and provider.