Pydantic AI integration · released 0.1.0

See what your Pydantic AI agent actually dispatches.

Record governance evidence at the Pydantic AI runtime boundary against the objective and scope declared before the run.

Python 3.10+ · local traces by default · records and flags, does not block

What you receive

A runtime record with useful edges.

01

One session per run

A Sentience Governor session is created for each Pydantic AI run.

02

Declaration before execution

The run’s declaration state is recorded before execution begins.

03

Evidence at the boundary

Scope assertion, dispatch, return, and context are kept in runtime order.

04

Model-turn detail

Measured token usage, model, provider, and tool-use IDs stay attributable.

05

Safe local default

Traces are local by default. No Sentience account or API key is required.

06

Isolation

Concurrent runs and parallel tool calls retain their own evidence.

Works alongside observability

Evidence, not another tracing system.

Logging

Explains application events and messages.

Tracing

Connects operations across a workflow.

Observability

Helps diagnose system behavior.

Governor

Records governance-oriented execution evidence against declared context.

This integration does not replace Pydantic Logfire, OpenTelemetry, logging, or tracing.

Attaching the capability

One capability. The rest is your agent.

Install the released distribution, attach the capability to your agent, and keep using the Pydantic AI runtime you already have.

Read the integration documentation ↗
example.pyPython
from pydantic_ai import Agent
from pydantic_ai_governor import SentienceGovernor

agent = Agent(
    "openai:gpt-4o",
    capabilities=[SentienceGovernor()],
)

result = await agent.run("Reconcile the August invoices")

Execution evidence

The evidence follows the run.

01Run declaration
02Validated tool call reaches execution boundary
03Scope assertion
04Tool dispatch
05Normal tool return
06Context snapshot

Separately recorded

Model-turn evidence

Model response
Model + provider identity
Measured token usage
Tool-use IDs

Tool-context evidence is estimated. Model-turn token usage is measured.

Evidence boundaries

Useful evidence is not a promise of control.

What the evidence can establish

  • A validated tool call reached the execution boundary and was dispatched.
  • Declaration state was recorded for the run.
  • A normal return was observed when the matching context snapshot exists.
  • Model-turn usage came from the Pydantic AI model response.

What it does not establish

  • That the tool accomplished its intended result.
  • Why a normal return was not observed.
  • Which individual records or objects a tool accessed.
  • That target_system establishes object-level scope.
  • That an unattached or unobserved run did not occur.
  • That Governor blocked or controlled the call.

Compatibility

Pinned to the released surface.

pydantic-ai-governor ==0.1.0pydantic-ai-slim >=2.37.0,<2.38sentience-governor >=0.3.1.2,<0.3.2Python 3.10+

Tested behavior

Bounded, not generalized.

Across the execution paths tested for version 0.1.0, attaching the capability did not change agent output, message count, token usage, exception propagation, retries, deferral, streaming, or control flow.

Tested paths include normal returns, text-only runs, parallel tool calls, retries, raised tools, validation failures, streaming, deferred and resumed execution, and concurrent runs.

Evaluate the boundary

Bring us the agent workflow you need to see clearly.

Talk to us

Independent distributions: pydantic-ai-governor on PyPI · source on GitHub