Pydantic AI logo + P
Integration

Observe, evaluate, and improve your Pydantic AI agents

Capture every Pydantic AI tool call as the typed event the SDK already emits — FunctionToolCallEvent in, FunctionToolResultEvent out — plus the RunContext each call carries.

What Prefactor records from Pydantic AI

agent runstool calls (FunctionToolCallEvent / FunctionToolResultEvent, with RunContext)output validation steps (Pydantic schema checks against the agent's result type)LLM calls

Pydantic AI + Prefactor

How the Pydantic AI integration works

See setup + the install snippet →

Pydantic AI integration FAQ

Do I need a dedicated package for Pydantic AI?

You can instrument Pydantic AI today with the framework-agnostic prefactor-core SDK; a dedicated package can be added on request.

What does Prefactor capture from Pydantic AI?

Prefactor records agent runs, tool calls, output validation steps and LLM calls as structured, timestamped spans — so every Pydantic AI run is captured as trace data you can reconstruct, search and export end to end.

Does Prefactor add latency or change how Pydantic AI runs?

No. Observability capture is designed to stay off your agent's critical path, so it doesn't alter your Pydantic AI logic or your users' responses. The only part that acts inline is the optional runtime guardrails you enable per agent — by design, so a high-risk or low-confidence action can be held for human approval before it executes.

Can I evaluate agents built with Pydantic AI and catch regressions?

Yes. Once runs are captured, eval suites score quality and groundedness on real traffic, drift detection flags behaviour changes after deployment, and versioned eval history catches regressions before they ship — the observe → evaluate → improve loop applied to your Pydantic AI agents.

Related guides

See it on your Pydantic AI agents

Book a 15-minute setup and our team gets you tracing in production.