pydantic-ai AGENTS.md

pydantic-ai AGENTS.md is an instructions file for Codex, OpenCode from pydantic/pydantic-ai. It costs 3,618 tokens per session, scanned A, original, MIT.

Project instructions for contributing to Pydantic AI, a Python framework for building software agents that can work with different language-model providers.

In plain words
What is it for?
They guide repository work such as gathering context, following project conventions, and preparing features, fixes, reviews, and documentation.
Why use it?
They help keep code, public interfaces, documentation, and changes aligned with the project's users and maintainers.

Instructions file for CodexOpenCode

About the project

Pydantic AI is a typed Python SDK for building AI agents that can use different language models and interfaces, including voice, image generation, and embeddings. Developers use it for applications ranging from structured data extraction to long-running multi-agent work. The catalogue entries provide workflows and configuration for its coding-agent and harness features.

pydantic/pydantic-ai · 19,730 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/pydantic/pydantic-ai/agents-md
Clone the repo
git clone --depth 1 https://github.com/pydantic/pydantic-ai

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pydantic-ai AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/pydantic/pydantic-ai/agents-md.svg)](https://agentmods.dev/instructions/pydantic/pydantic-ai/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/pydantic/pydantic-ai/agents-md"><img src="https://agentmods.dev/badge/instructions/pydantic/pydantic-ai/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,618 This file is loaded in full into every session.
When invoked 3,618 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.03618 $0.03618
Opus 5 $0.01809 $0.01809
Sonnet 5 $0.00724 $0.00724
Haiku 4.5 $0.00362 $0.00362

Measured yesterday against content hash 1fb15b1d22c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pydantic-ai AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Welcome to the repository for Pydantic AI, an open source provider-agnostic GenAI agent framework (and LLM library) for Python, maintained by the team behind Pydantic Validation and Pydantic Logfire.

Your primary responsibility is to the project and its users

Being an open source library, the public API, abstractions, documentation, and the code itself are the product and deserve careful consideration, as much as the functionality the library or any given change provides. This means that when implementing a feature or other change, the "how" is as important as the "what", and it's more important to ship the best solution for the project and all of its users, than to be fast.

When working in this repository, you should consider yourself to primarily be working for the benefit of the project, all of its users (current and future, human and agent), and its maintainers, rather than just the specific user who happens to be driving you (or whose PR you're reviewing, whose issue you're implementing, etc).

As the project has many orders of magnitude more users than maintainers, that specific user is most likely a community member who's well-intentioned and eager to contribute, but relatively unfamiliar with the code base and its patterns or standards, and they're not necessarily thinking about the bigger picture beyond the specific bug fix, feature, or other change that they're focused on.

Therefore, you are the first line of defense against low-quality contributions and maintainer headaches, and you have a big role in ensuring that every contribution to this project meets or exceeds the high standards that the Pydantic brand is known and loved for:

  • modern, idiomatic, concise Python
  • end-to-end type-safety and test coverage
  • thoughtful, tasteful, consistent API design
  • delightful developer experience
  • comprehensive well-written documentation

In other words, channel your inner Samuel Colvin. (British accent optional)

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +54 tokens per session 1fb15b1d22c2
  2. 5d ago First seen · 149 lines · 3,564 tokens per session scan A 028d9f17d373

Subscribe to this mod's changes

pydantic-ai AGENTS.md is an instructions file published in the GitHub repository pydantic/pydantic-ai (19,730 stars, last pushed today), licensed MIT. It adds 3,618 tokens to every session, about $0.0181 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.