pydanticai

pydanticai is a skill for Claude Code, Codex from magnus919/agent-skills. It costs 93 tokens per session (3,685 once invoked), scanned A, original, MIT.

A Python framework for building AI agents and graph-based workflows with typed inputs and outputs.

In plain words
What is it for?
Use it to create tool-using agents, structured responses, dependency injection, multi-agent workflows, tests, evaluations, and state-machine graphs.
Why use it?
It helps developers make agent behavior, tool use, dependencies, streaming, and multi-step control flow more explicit and testable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create tool-using agents, structured responses, dependency injection, multi-agent workflows, tests, evaluations, and state-machine graphs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/magnus919/agent-skills/pydanticai
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.

Any agent
npx skills add magnus919/agent-skills --skill pydanticai
Clone the repo
git clone --depth 1 https://github.com/magnus919/agent-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin pydanticai/plugin install pydanticai after adding the marketplace above.

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 pydanticai

README.md
[![agentmods](https://agentmods.dev/badge/skills/magnus919/agent-skills/pydanticai/github.svg)](https://agentmods.dev/skills/magnus919/agent-skills/pydanticai)
Your own site
<a href="https://agentmods.dev/skills/magnus919/agent-skills/pydanticai"><img src="https://agentmods.dev/badge/skills/magnus919/agent-skills/pydanticai/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pydanticai

Your own site · 80×15
<a href="https://agentmods.dev/skills/magnus919/agent-skills/pydanticai"><img src="https://agentmods.dev/badge/skills/magnus919/agent-skills/pydanticai.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,685 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00093 $0.03685
Opus 5 $0.00046 $0.01843
Sonnet 5 $0.00019 $0.00737
Haiku 4.5 $0.00009 $0.00368

Measured 8d ago against content hash dd79884cfe92, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

pydanticai 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 8d ago.

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.

pydanticai/SKILL.md · 248 lines

How it starts

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

PydanticAI & PydanticGraph Expert Skill

PydanticAI is a Python agent framework for building production-grade GenAI applications, built by the team behind Pydantic. PydanticGraph is its companion graph/state-machine library.

Install:

pip install pydantic-ai               # Full install (all providers)
pip install "pydantic-ai-slim[openai]" # Minimal install + your provider

Quick Reference

from pydantic_ai import Agent

# Basic agent — one line
agent = Agent('openai:gpt-5.2', instructions='Be concise.')

# Run it
result = agent.run_sync('What is the capital of France?')
print(result.output)

When to Load Which Reference

Topic Load When File
Agent creation & lifecycle You need to create, configure, or run an agent — define tools, deps, output types, run methods, streaming references/core-agents.md
Capabilities & hooks You need built-in capabilities (Thinking, WebSearch, MCP, etc.), on-demand loading, lifecycle hooks, or custom capabilities references/capabilities-hooks.md
PydanticGraph You need a state machine, graph-based control flow, parallel execution, BaseNode subclasses, or GraphBuilder with joins/decisions references/graph.md
Models, output & streaming You need multi-model setups, FallbackModel, streaming output, output functions, or structured output with validation references/models-output.md
Multi-agent patterns & integrations You need agent delegation, programmatic hand-off, MCP servers, durable execution, or UI adapters references/patterns.md
Testing & evaluation You need TestModel, FunctionModel, pytest patterns, overrides, or Pydantic Evals for systematic eval references/testing-evals.md
Full worked examples You want complete runnable examples — bank support agent, email feedback graph, multi-agent flight booking references/examples.md
Framework boundaries You need to compare PydanticAI vs LangGraph for a project, or want to combine them references/hybrid-pydanticai-langgraph.md — also load skill_view(name='langgraph')
API surface reference You need to find the right import path, class name, or method signature quickly references/api-reference.md

Read the full file on GitHub · 248 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. 8d ago First seen · 248 lines · 93 tokens per session scan A dd79884cfe92

Subscribe to this mod's changes

pydanticai is a skill published in the GitHub repository magnus919/agent-skills (76 stars, last pushed yesterday), licensed MIT. It adds 93 tokens to every session and 3,685 once invoked, about $0.0005 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-09-03.