pydantic-ai-harness

pydantic-ai-harness is a skill for Claude Code, Codex from pydantic/pydantic-ai. It costs 187 tokens per session (5,127 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 · 20,645 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 187 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,127 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.00187 $0.05127
Opus 5.5 $0.00075 $0.02051
Sonnet 5.5 $0.00037 $0.01025
Haiku 4.5 $0.00019 $0.00513

Measured yesterday against content hash 46a3ef21e98b, 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 · 305 lines

How it starts

The opening of the file, as written. The whole thing — 305 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, a model-written workflow over sub-agents, or a stronger model to advise a cheaper one
  • 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 · 305 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 46a3ef21e98b
  2. 2d ago Changed · +2 lines · +22 tokens per session 9bc3bf244f0e
  3. 9d ago Changed d10b9fbd9c32
  4. 14d ago Changed · +21 lines 29962fa331d1
  5. 15d ago Changed b3dd7656c03d
  6. 16d ago Changed 9fc51c026d85
  7. 17d ago Changed · +155 lines · +23 tokens per session 255d2779ba0e
  8. 19d ago First seen · 127 lines · 142 tokens per session scan A 1492bbc887d2

Subscribe to this mod's changes

pydantic-ai-harness is a skill published in the GitHub repository pydantic/pydantic-ai (20,645 stars, last pushed today), licensed MIT. It adds 187 tokens to every session and 5,127 once invoked, about $0.0007 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.