--- id: pydantic-ai-harness version: "0.20.0" license: MIT license_treatment: permissive maintenance: active --- # pydantic-ai-harness — The batteries for your Pydantic AI agent License: permissive · Maintenance: active · Downloads: 2.1M/mo ## What it is and what it does Pydantic AI Harness is the official capability library for Pydantic AI, maintained by the Pydantic AI team. It provides reusable building blocks—tools, lifecycle hooks, instructions, and model settings—that compose into agents to add functionality like code execution, web search, sub-agent orchestration, and external service integrations. The core framework ships only capabilities requiring deep model or framework support; everything else lives in this harness library, where new capabilities can start as experimental and graduate into core once they stabilize. The library centers on two orchestration patterns: CodeMode lets the model write a single Python script batching multiple tool calls into one round-trip instead of sequential calls, and DynamicWorkflow does the same for sub-agents—allowing an orchestrator to fan out work across multiple agents and collect results in a single model call. Optional extras let you add specialized capabilities only when needed: sandboxed code execution, web research, browser automation, MongoDB persistence, and more. The library is actively maintained and designed modularly—install the base package and add only the extras your use case requires. Use it for: - Build a coding agent that executes and tests code in a sandbox without leaving the model's control flow. - Orchestrate multiple sub-agents (reviewer, summarizer, fact-checker) in a single model call instead of sequential delegations. - Batch web search and tool calls so the model gathers information and processes it in one round-trip. - Integrate an agent with external business applications or serve it over the Agent Client Protocol. - Persist agent steps and externalize media to MongoDB for audit trails and long-running workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pydantic AI Harness provides pre-built capabilities and tools that extend Pydantic AI agents—including code execution sandboxes, web search, sub-agent orchestration, and integrations with external services—without requiring framework changes. Yes. Pydantic AI Harness is actively maintained by the Pydantic team, has low install friction, carries no security vulnerabilities, and offers a modular approach to extending agents with pre-built capabilities. Install the base package and add extras only for the specific capabilities you need. The library is in Alpha (Development Status 3), so expect some APIs to evolve, but core use cases are production-ready and backed by a well-resourced team. ## Install pip install pydantic-ai-harness uv add pydantic-ai-harness poetry add pydantic-ai-harness ## Installing pydantic-ai-harness Before you install: Low install friction; pure Python wheel with three runtime dependencies (pydantic-ai-slim, httpx, genai-prices). Active maintenance with recent release and 768 repository stars. Optional extras for specialized capabilities add dependencies only when needed. License in practice: MIT license (permissive); you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install pydantic-ai-harness from pydantic_ai_harness import CodeMode capabilities = [CodeMode()] # Pass to your agent's capabilities parameter Requires Python 3.10+ and pydantic-ai-slim>=2.18.0. Some optional extras (browser-use) require Python 3.11+. Verify before relying: - Production readiness status of each optional extra (codemode, modal, exa, browser-use, stackone, acp, mongodb). - Performance characteristics and latency overhead of CodeMode sandboxing and DynamicWorkflow orchestration. - Stability guarantees for DynamicWorkflow, noted as subject to breaking changes during planned extensions. - Whether the Monty sandbox, Modal SDK, and other optional dependencies are included in the extras or must be installed separately. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pydantic ai agent capabilities, agent tools and extensions, code execution sandbox for agents, sub-agent orchestration, ai agent harness library, agent workflow composition, llm tool batching, agent-orchestration, llm-tools, sandbox-execution [View on SkillFed](https://skillfed.io/packages/pydantic-ai-harness) · [View on PyPI](https://pypi.org/project/pydantic-ai-harness/)