# Pydantic AI — Open-source Python agent framework from the Pydantic team, with a typed agent loop and swappable models.

> Source: The Agents Index — https://theagentsindex.com/pydantic-ai (structured, researched, re-verified)
> Facts last verified: 2026-09-21

Pydantic AI is an MIT-licensed Python SDK for building agents with a typed agent loop, structured outputs and swappable model providers. Its Harness package adds composed capabilities such as a coding agent, sub-agents, guardrails and durable execution.

| Fact | Value |
| --- | --- |
| Website | https://ai.pydantic.dev |
| Price | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files |
| Free tier | Yes |

The framework, Harness, Evals and Graph packages are MIT-licensed and free with no usage ceiling; you pay your model provider for inference, and the vendor's optional Logfire/Gateway platform is priced separately from $49/month with a free Personal plan.

## What it does

**Writes code** · Partly — The framework itself is a Python SDK, but its Harness ships a Coder capability whose file tools let an agent author and edit files in a workspace, so code writing comes from the bundled agent rather than a product you sign into.

> Coder provides six tools: read_file, write_file, edit_file, list_files, grep, and shell, plus repository context and context controls.
> — https://pydantic.dev/docs/ai/harness/ · Quick start section, paragraph under the first Coder code example

**Debugs and fixes** · Partly — Harness Coder is documented as investigating, editing and testing a local codebase, which covers diagnosing a failure and landing a fix, but only for an agent you assemble and run yourself with your own model key.

> Coder gives a Pydantic AI agent tools and guidance for investigating, editing, and testing a local codebase.
> — https://pydantic.dev/docs/ai/harness/coder/ · Opening paragraph of the Coder page

**Reviews code** · Partly — Review is not native: the Harness capability table offers a Macroscope capability that runs that third-party code-review tool locally and hands its findings to the agent, so reviewing a diff depends on an external tool.

> Run a local Macroscope code review and hand the findings to the agent
> — https://pydantic.dev/docs/ai/harness/ · Capabilities > Tools & native abilities table, Macroscope row

**Whole-codebase work** · Partly — The Harness is explicitly aimed at long-running repository work with repo context and context management, but the framework supplies the machinery rather than a measured guarantee about repository-wide migrations.

> But set an agent loose on complex, long-running work (fix a codebase, research a question, run for hours unattended) and what it needs around the model grows
> — https://pydantic.dev/docs/ai/harness/ · Introduction, second paragraph

**Ships it** · Partly — There is no deployment feature; the Coder shell tool runs unrestricted commands that outlive the run, so an agent can execute deploy commands you allow, and the docs warn to sandbox untrusted work.

> Unrestricted commands rooted at the workspace that outlive the run.
> — https://pydantic.dev/docs/ai/harness/coder/ · Six tools table, shell(command, mode, timeout) row

**Done-for-you service** · No — Nobody builds or runs the agent for you: this is a Python package you install from PyPI and operate yourself, with no managed or done-for-you service described anywhere in the docs.

> Pydantic AI is available on PyPI as pydantic-ai so installation is as simple as:
> — https://pydantic.dev/docs/ai/overview/install/ · Installation, first sentence

_Not established: Writes tests_

## How much it does unattended

**Runs autonomously** · Yes — Coder's default instructions push autonomous investigation through to completion, and the GitHub Agentic Workflows integration runs the same agent headless on a runner with nobody at a prompt.

> The default instructions keep engineering guidance brief: autonomous investigation and completion, focused changes and verification, and pragmatic DRY, YAGNI, SOLID, and the Zen of Python.
> — https://pydantic.dev/docs/ai/harness/coder/ · Instructions section, first sentence

**Multi-agent** · Yes — The SubAgents capability gives a parent agent a delegate_task tool over named child agents, each running in its own message history with its own budgets, which is coordination between several agents on one task.

> SubAgents lets an agent delegate self-contained tasks to named child agents. It takes a sequence of SubAgent entries and exposes a single delegate_task(agent_name, task) tool.
> — https://pydantic.dev/docs/ai/harness/subagents/ · Opening paragraph of the Subagents page

**Agent permissions** · Yes — Tools can be marked as requiring human approval, and the run pauses with the pending calls so a person approves or denies each one before the tool body executes; the docs also warn approval is not an authorization boundary.

> If a tool function always requires approval, you can pass the requires_approval=True argument to the @agent.tool decorator
> — https://pydantic.dev/docs/ai/tools-toolsets/deferred-tools/ · Human-in-the-Loop Tool Approval section, first sentence

## Which models it runs on

**Claude** · Yes — Anthropic is a first-class built-in provider with its own model class and install extra, selectable by a provider-prefixed model string like anthropic:claude-sonnet-4-6.

> Pydantic AI is model-agnostic and has built-in support for multiple model providers:
> — https://pydantic.dev/docs/ai/models/overview/ · Model Providers, intro sentence above the list containing Anthropic

**GPT** · Yes — OpenAI is the first listed built-in provider and appears throughout the docs as openai:gpt-… model strings, with an openai extra installed by the default package.

> openai -- installs OpenAI Model dependency openai
> — https://pydantic.dev/docs/ai/overview/install/ · Slim Install, optional groups list, openai bullet

**Open models** · Yes — Open-weight models are reachable through OpenAI-compatible providers the docs enumerate, including local runtimes Ollama and vLLM as well as Hugging Face and Groq, so weights you host yourself are supported.

> In addition, many providers are compatible with the OpenAI API, and can be used with OpenAIChatModel in Pydantic AI:
> — https://pydantic.dev/docs/ai/models/overview/ · OpenAI-compatible Providers section, intro sentence above the list including Ollama and vLLM

**Model choice** · Yes — You choose the model, not the vendor: an agent is portable across LLM vendors by swapping the model string, and the docs state no flagship feature is locked to one vendor.

> ensuring a single Pydantic AI agent is portable to different LLM vendors without any other code changes just by swapping out the Model it uses
> — https://pydantic.dev/docs/ai/models/overview/ · Models and Providers section, Model definition bullet

## Where you use it

**In your editor** · Partly — An agent can appear inside editors such as Zed through the ACP adapter, but that adapter is shipped under the harness experimental path and may be removed in any release without deprecation.

> Unlike the graduated capabilities in these docs, ACP itself may still be removed, not just changed -- it lives under pydantic_ai_harness.experimental and may change or be removed in any release, without a deprecation period.
> — https://pydantic.dev/docs/ai/harness/acp/ · Experimental callout near the top of the ACP page

**On the command line** · Yes — The clai command ships with the package and runs an interactive terminal chat against any model, and any agent object can launch the same interface with Agent.to_cli_sync().

> Pydantic AI comes with a CLI, clai (pronounced "clay"). You can use it to chat with various LLMs and quickly get answers, right from the command line
> — https://pydantic.dev/docs/ai/integrations/cli/ · Command Line Interface (CLI), first paragraph

**In your pipeline** · Yes — A pydantic-ai engine for GitHub Agentic Workflows runs your agent from a Markdown workflow file on issues, pull requests or a schedule, writing back through gh-aw safe outputs; the engine declares itself experimental to gh-aw.

> GitHub Agentic Workflows (gh-aw) runs an agent from a Markdown file in .github/workflows/: it triggers on issues, pull requests or a schedule
> — https://pydantic.dev/docs/ai/harness/gh-aw/ · Opening paragraph of the gh-aw page

**In a browser** · Yes — A browser chat interface ships in the package via Agent.to_web() or clai web, though the docs position it for local development and debugging rather than production use.

> Pydantic AI includes a built-in web chat interface that you can use to interact with your agents through a browser.
> — https://pydantic.dev/docs/ai/guides/web/ · Web Chat UI page, first sentence

## Whose machine it runs on

**Self-hosted** · Yes — There is no vendor runtime to depend on: the package installs into your own Python environment and the web app it produces runs under any ASGI server you operate.

> Run the app with any ASGI server:
> — https://pydantic.dev/docs/ai/guides/web/ · Basic Usage section, line above the uvicorn command

**Open source** · Yes — The pydantic-ai repository ships an MIT licence granting unrestricted use, modification and redistribution, so the framework source is fully available.

> The MIT License (MIT) Copyright (c) Pydantic Services Inc. 2024 to present
> — https://github.com/pydantic/pydantic-ai/blob/main/LICENSE · LICENSE file, first lines

## What it costs to run

**How it meters** · Partly — The framework charges nothing per seat, task or token; your spend is model inference, paid either straight to providers with your own keys or through the vendor's Gateway, which adds a markup on built-in providers.

> BYOK and managed providers: Bring your own API keys (BYOK) from LLM providers, or pay for inference directly through the platform.
> — https://pydantic.dev/docs/ai/overview/gateway/ · Key features list, BYOK and managed providers bullet

**Free tier** · Yes — No call, account or card is needed: the package is MIT licensed and free of charge, and a built-in test model lets you exercise an agent offline before you hold any provider key.

> Permission is hereby granted, free of charge, to any person obtaining a copy of this software
> — https://github.com/pydantic/pydantic-ai/blob/main/LICENSE · LICENSE file, grant paragraph

**API access** · Yes — The product is itself a programmable library: you construct an Agent in your own code, call run(), and can expose it as an ASGI app or UI event stream inside your stack.

> Create a web app from an agent instance using Agent.to_web():
> — https://pydantic.dev/docs/ai/guides/web/ · Basic Usage section, sentence above the to_web example

**MCP server** · Partly — MCP is supported as a client: the MCP capability connects any MCP server's tools into your agent, and the CLI takes an mcpServers config file; the docs I read establish consumption, not your agent being queried as an MCP server.

> MCP is a provider-adaptive capability and the primary entry point for MCP in Pydantic AI. It runs the MCP server locally by default
> — https://pydantic.dev/docs/ai/capabilities/mcp/ · MCP capability page, opening paragraph

**Bring your own key** · Yes — Your own provider keys are the default path: you set the provider's API key environment variable yourself, and the vendor's optional Gateway also supports bringing your own credentials.

> You'll need to set an environment variable depending on the provider you intend to use.
> — https://pydantic.dev/docs/ai/integrations/cli/ · CLI Usage section, first sentence

## Buying it for a team

**A company can buy it** · Partly — There is nothing to buy for the framework itself; purchasing applies to the surrounding Logfire platform, which is sold to organisations from a paid team plan up to Enterprise.

> For organizations where observability has to pass security review.
> — https://pydantic.dev/pricing · Enterprise plan card, description

**Seat model** · Partly — The framework has no seats. Logfire's Team plan includes five and caps at twelve at $25 each, while Growth and Enterprise are flat-price with unlimited seats.

> Admin or member seats for you & your core team. 5 seats included, $25/extra seat.
> — https://pydantic.dev/pricing · Team plan, Scale section, seats row

**Pooled budget** · Partly — Gateway budgets are pooled by scope you choose - project, user or key - rather than per seat; in the OSS harness, SpendLimits can share one spend counter across worker processes.

> Cost Limits: Set spending limits at project, user, and API key levels with daily, weekly, and monthly caps.
> — https://pydantic.dev/docs/ai/overview/gateway/ · Key features, Cost Limits bullet

**Admin controls** · Partly — Constraints are developer-level rather than an org admin console: guardrail capabilities screen prompts, tool calls and outputs, and the Shell capability supports allowlists, denylists and credential stripping.

> Guardrails put a validation layer on the three edges of an agent run: the prompt on its way in to the model, the tool calls the model makes along the way, and the output on its way out to the caller.
> — https://pydantic.dev/docs/ai/harness/guardrails/ · Guardrails page, first paragraph

**Audit log** · Partly — There is no vendor-side administrative log, but every model call and tool call is emitted as standard OpenTelemetry spans you can send to Logfire or any OTLP backend you already run.

> Pydantic AI is OpenTelemetry-native: the Instrumentation capability emits standard OTel spans for every model call and tool call
> — https://pydantic.dev/docs/ai/overview/ · Instrumentation with Pydantic Logfire section, first sentence

**Single sign-on** · Partly — SAML and OIDC exist but sit on Logfire Enterprise in the plan comparison, which marks SSO absent on Personal, Team and Growth.

> Bring your identity provider — first-party integrations for the common IDPs and generic SAML for the rest.
> — https://pydantic.dev/pricing · Enterprise plan card, Single sign-on feature

## What happens to your code

**Opt out of training** · Partly — No training-opt-out toggle is published, and none is needed for the library itself, which sends prompts straight to the provider you configure. Where Pydantic is in the path, the Gateway terms license your content only to operate the Gateway, and provider terms govern the provider leg.

> You grant Pydantic a limited, non‑exclusive license to process Customer Content solely to provide, secure, troubleshoot, and improve the Gateway
> — https://pydantic.dev/legal/terms-of-service · Section 22, Pydantic AI Gateway — Data Handling

**Data residency** · Partly — The library holds nothing, so residency is yours. If you send telemetry to Logfire, you choose a US or EU region at signup; regions are strictly separated and migration between them is not available.

> Logfire is hosted in two separate geographic regions to provide you with options for data residency, compliance with local regulations, and optimal performance.
> — https://pydantic.dev/docs/logfire/manage/data-regions/ · Opening paragraph

**Getting out** · Partly — Prepaid Gateway credits are non-refundable and expire after twelve months of account dormancy; Logfire data is exportable over its query API and Growth adds self-serve deletion.

> Gateway Credits will expire if your Account remains dormant (inactive) for a period of twelve (12) months.
> — https://pydantic.dev/legal/terms-of-service · Section 22, Gateway Credits — Credit Expiration

**Certifications** · Partly — The certifications cover the hosted platform, not the library: SOC 2 Type 2 audited, GDPR with a DPA, and HIPAA under a signed BAA, with the report itself behind a document request.

> SOC 2 Type 2 — Type 2 audited Independently audited controls for security, availability, and confidentiality.
> — https://pydantic.dev/security · Compliance section, SOC 2 Type 2 card

## Platform record (as of 2026-08-30)

Reported by the code-hosting platform, not by the vendor.

| Fact | Value |
| --- | --- |
| Licence | MIT |
| Stars | 19584 |
| Forks | 2617 |
| Last push | 2026-08-30 |

## Provenance

1 of 32 sources behind the facts above are independent of the vendor.

## Coverage elsewhere

None recorded. Every fact above comes from the vendor and is not independently corroborated yet.

## What changed

- 2026-09-21 — Capabilities · Commercial terms · Free tier · Price
- 2026-09-02 — Capabilities · Commercial terms · Free tier
- 2026-08-31 — Capabilities · Commercial terms · Free tier
- 2026-08-23 — Alternatives · One-liner · Summary · Website

## Correcting this record

Anything marked "Not established" is a question we have not answered — it is not a No. If you represent Pydantic AI, or anything here is wrong or out of date, you can supply it with a source: the operations this site accepts from an agent are listed at https://theagentsindex.com/.well-known/agents.json — that catalogue needs no key to read, and each entry states its own auth.

Supplying evidence is free. Nothing that can be bought here changes what a field says, whether a gap is closed, or how this record is scored.
