pydantic-ai-harness

pydantic-ai-harness is a skill for Claude Code, Codex from pydantic/pydantic-ai. It costs 208 tokens per session (6,126 once invoked), scanned A, original, MIT.

A guide to adding Pydantic AI Harness capabilities to Python agents. It covers running grouped tool work in a restricted Python environment, using files and shell commands, delegating to smaller agents, planning, and shortening stored conversation context.

In plain words
What is it for?
Use it when building or extending Pydantic AI agents with code execution, file and shell access, sub-agents, planning, or context management.
Why use it?
It helps when an agent needs several connected tool operations or controlled code execution without building all of that support yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; installed under .agents/ (shared by several agents).

Good fit Use it when building or extending Pydantic AI agents with code execution, file and shell access, sub-agents, planning, or context management.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pydantic/pydantic-ai/pydantic-ai-harness
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 · 21,453 stars · on GitHub · pydantic.dev

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 pydantic/pydantic-ai --skill pydantic-ai-harness
Clone the repo
git clone --depth 1 https://github.com/pydantic/pydantic-ai

Made for: Claude Code, Codex.

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-harness

README.md
[![agentmods](https://agentmods.dev/badge/skills/pydantic/pydantic-ai/pydantic-ai-harness/github.svg)](https://agentmods.dev/skills/pydantic/pydantic-ai/pydantic-ai-harness)
Your own site
<a href="https://agentmods.dev/skills/pydantic/pydantic-ai/pydantic-ai-harness"><img src="https://agentmods.dev/badge/skills/pydantic/pydantic-ai/pydantic-ai-harness/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 pydantic-ai-harness

Your own site · 80×15
<a href="https://agentmods.dev/skills/pydantic/pydantic-ai/pydantic-ai-harness"><img src="https://agentmods.dev/badge/skills/pydantic/pydantic-ai/pydantic-ai-harness.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 208 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,126 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.
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.00208 $0.06126
Opus 5.5 $0.00083 $0.02450
Sonnet 5.5 $0.00042 $0.01225
Haiku 4.5 $0.00021 $0.00613

Measured yesterday against content hash cdc585953e1c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pydantic-ai-harness 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

src/pydantic_ai_harness/pydantic_ai_harness/.agents/skills/pydantic-ai-harness/SKILL.md · 310 lines

How it starts

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

Building with Pydantic AI Harness

Pydantic AI Harness is the official capability library for Pydantic AI. Core pydantic-ai ships the agent loop and the capabilities that need model or framework support (thinking, web search, MCP, tool search, workspaces, and provider-native compaction); the harness ships optional capabilities for longer, more involved work: a coding stack, sandboxes, delegation, memory, context management, and controls. Harness capabilities go in Agent(capabilities=[...]) and compose with each other and with core capabilities; a few supporting pieces, such as media stores and the ACP server entry point, are used directly instead.

This skill covers pydantic-ai-harness. For the core framework -- agents, tools, structured output, hooks, workspaces, and testing -- use the building-pydantic-ai-agents skill.

When to Use This Skill

Invoke this skill when:

  • The user mentions pydantic-ai-harness, or code imports pydantic_ai_harness
  • The user wants a coding agent, or an agent that reads and edits files or runs shell commands, locally or in a sandbox
  • An agent should run model-written Python that calls its tools (Code Mode)
  • The user wants sub-agents, planning, peer-session messaging, a model-written workflow over sub-agents, or a stronger model to advise a cheaper one
  • The user wants another model to choose the main agent's model from a named menu
  • A long-running agent needs memory across sessions, context compaction, tool output limits, or SKILL.md skills loaded on demand
  • The user wants guardrails, prompt-injection screening, model-based tool-call decisions, spend limits, human questions mid-run, or a second model reviewing the run
  • The user wants web research beyond core web search (Exa, You.com), a real browser, or a hosted integration such as GitHub, Linear, Notion, Slack, or Google Workspace
  • A run must be saved, resumed, or forked, or an agent should be served over ACP
  • The user is using or evaluating Render Workflows for background agent jobs with separate retries, timeouts, and compute settings for model requests and tool calls

Read the full file on GitHub · 310 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 cdc585953e1c
  2. 2d ago Changed 055a972dab7d
  3. 4d ago Changed 320557d2962f
  4. 5d ago Changed ddd49157ff36
  5. 11d ago Changed · +1 lines · +11 tokens per session 80bac698c698
  6. 12d ago Changed 3ed90568bb5c
  7. 13d ago Changed b834d215d890
  8. 14d ago Changed · +2 lines ade1136c5098
  9. 16d ago Changed c2295bf6e6d2
  10. 17d ago First seen · 307 lines · 197 tokens per session scan A 21f5af1584fc

Subscribe to this mod's changes

pydantic-ai-harness is a skill published in the GitHub repository pydantic/pydantic-ai (21,453 stars, last pushed today), licensed MIT. It adds 208 tokens to every session and 6,126 once invoked, about $0.0008 per session on Opus 5.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-27.

Related

pydantic-ai-harness compared with skills from other repositories

pydantic-ai-harness next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pydantic-ai-harnesspydantic/pydantic-aiSkill21ktodayMITA208Claude Code, Codex
data-analysisvstorm-co/pydantic-deepagentsSkill1.1kyesterdayMITA15Claude Code, Codex
diagram-designvstorm-co/pydantic-deepagentsSkill1.1kyesterdayMITA16Claude Code, Codex
data-formatsvstorm-co/pydantic-deepagentsSkill1.1kyesterdayMITA18Claude Code, Codex
systematic-debuggingvstorm-co/pydantic-deepagentsSkill1.1kyesterdayMITA13Claude Code, Codex
verification-strategyvstorm-co/pydantic-deepagentsSkill1.1kyesterdayMITA13Claude Code, Codex
research-methodologyvstorm-co/pydantic-deepagentsSkill1.1kyesterdayMITA16Claude Code, Codex