Head to head · Agent frameworks · October 2026 research run
DSPy vs Pydantic AI Harness
Pydantic AI Harness scores 83.5 (A) on agent readiness against DSPy's 68.3 (B), and leads in 4 of 7 scored categories. Both do agent frameworks.
Best agent frameworks and SDKs · All 276 frameworks comparisons
Which one, for what
DSPy B
Best for Python teams who want typed LM programs they can evaluate and optimise against a metric, with ReAct for tool use.
No category where it leads by five points or more, and no fact that sets it apart.
Watch for
3.5 changed the default adapter, reasoning and API routing and removed CodeAct and ProgramOfThought in a minor release
Best for Python developers building coding, research or long-running agents on Pydantic AI who want sandboxes, budgets and approvals as parts.
Ahead on
- Schema & documentation, 98 against 71
- Agent ergonomics, 89 against 64
- Security & auth, 85 against 60
- Transparency & trust, 82 against 52
Also in its favour
- Agent-ready, a grade of BB or better
Watch for
0.76.0 and classed Alpha. Minor releases may rename parameters or change defaults
Why the edge
Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.
Transparency & trust Pydantic AI Harness +30
DSPy 52
MIT (30). The library keeps only its answer cache, in memory and on disk by default, which the cache guide describes; no terms or privacy policy exist for the project (18). Deprecation warnings name the removal version (ReActV2 removed in 3.6), but there is no written policy and 3.5 removed APIs without a prior deprecation release (8). No telemetry, though no page states it (12). 30+18+8+12 = 68.
Pydantic AI Harness 82
MIT, with third-party notices in the package (30). The docs say where Harness files go (.pydantic-ai-harness/ in the workspace, git-ignored) and which stores sit on the agent's machine, and the threat model says computer use sends screenshots, secrets included, to the model provider. Pydantic's privacy policy covers its hosted services (22 of 30). The 0.x policy promises deprecation warnings where practical and migration guidance in release notes, and sets the rules from 1.0, with no dated notices (14 of 20). No telemetry of its own, and instrumentation is opt-in and documented (18 of 20). 30+22+14+18 = 84.
Schema & documentation Pydantic AI Harness +27
DSPy 71
Framework reading. A typed Python API with an API reference for modules, tools, adapters and errors (20). No llms.txt at dspy.ai; the docs are Markdown in the repository but not served for agents (0). The tools and ReAct pages say what each part is for and when to read on (15). Tools are typed from signatures and Pydantic annotations and validated against JSON Schema (14). Many tutorials with code, and an errors page in the reference (12). Versioned docs, GitHub release notes and an upgrade guide, with no changelog file (10). 20+0+15+14+12+10 = 71.
Pydantic AI Harness 98
Framework reading. Typed package (Typing :: Typed), with about 280 API reference blocks across the capability pages (25). About 96 Harness pages in pydantic.dev's llms.txt, each with a Markdown twin (10). Each capability page sets out the problem and the solution, the README maps problems to capabilities, and the docs say plainly what isn't a boundary (LocalWorkspace isn't a sandbox, Bubblewrap is best effort, command patterns are a convenience) (19 of 20). Capabilities are typed classes with named modes ('full', 'auto', 'read-only') and documented defaults (14 of 15). Examples on every page, and named exceptions such as OutputBlocked, LoopDetectedError and UsageLimitExceeded (15). A version policy and Harness entries in the shared changelog (15). 25+10+19+14+15+15 = 98.
Agent ergonomics Pydantic AI Harness +25
DSPy 64
Framework reading. MCP tools through the dspy[mcp] extra, converted one by one from a client session the developer opens (14). max_iters with a turn budget shown to the model and a forced final submit bound a run (17). Unknown tools and tool exceptions return to the model as error results (15). History continuation and saved programs, but no resume of an interrupted run or durable store; answer caching can mask repeated calls (8). Signatures keep required arguments few, an LM must be configured, Python only (10). 14+17+15+8+10 = 64.
Pydantic AI Harness 89
Framework reading. A coding agent is an Agent with LocalWorkspace('.') and Coder() in its capabilities, MCP comes from core, and hosted MCP integrations such as GitHub, Linear and Slack are capabilities of their own (23 of 25). ToolOutputLimits spills results of 10,000 characters or more to a file, and SpendLimits, ToolBudgets, ReportRemainingBudget and DetectLoops bound runs (20). ReportToolErrors turns exceptions into tool results the model can act on, RepairToolArguments fixes malformed JSON, and a run without a workspace fails at its start saying what to attach (19 of 20). Step persistence, Temporal and DBOS extras and Absurd, pgtask, Lambda and Azure Durable Task pages (18 of 20). Sensible defaults, but Python only, as for pydantic-ai (9 of 15). 23+20+19+18+9 = 89.
Security & auth Pydantic AI Harness +25
DSPy 60
Framework reading (telemetry defaults, approvals, guardrails, sandboxing). No telemetry found, and the optional LiteLLM engine switches LiteLLM telemetry off (25). No tool approval hook; RLM runs generated code in a Deno and Pyodide sandbox with no filesystem or network access (10). No prompt-injection guidance found (5). MLflow tracing through OpenTelemetry and callbacks (12). SECURITY.md with GitHub private reporting and a maintainer address, but OSV lists CVE-2025-12695 for the PythonInterpreter sandbox with no fixed version (8). 25+10+5+12+8 = 60.
Pydantic AI Harness 85
Framework reading (telemetry defaults, approval hooks, guardrails, sandboxing). The Harness sends nothing of its own, and tracing goes through core's opt-in instrumentation. FileSystem keeps secrets and .git read-only by default and checks path traversal, and Shell can strip LLM credentials from command environments, which the docs call coarse (27 of 30). Permissions with full, auto and read-only modes, Approval Reviewer, Tool Call Judge and Deny Unanswered, and twelve workspace backends, but full is the default and Coder's shell has no allowlist (17 of 20). A Prompt Injection Defender (report-only unless block_high_risk=True), output guardrails, and workspace authority that keeps files below operator authority out of the instructions (13 of 15). OpenTelemetry spans for every model and tool call through core, plus trajectory and artifact-scanning capabilities (13 of 15). A valid security.txt and GitHub private reporting, a threat model that covers the Harness, and one moderate advisory, GHSA-3589-pxp7-3gj8, published with a fix in 0.59.0 on 21 October 2026 (15 of 20). No bounty found. 27+17+13+13+15 = 85.
Score by category
| Category | Weight | DSPy | Pydantic AI Harness | Edge |
|---|---|---|---|---|
| Reliability | 16% | 62 | 61 | DSPy +1 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 71 | 98 | Pydantic AI Harness +27 |
| Agent ergonomics | 13% | 64 | 89 | Pydantic AI Harness +25 |
| Security & auth | 14% | 60 | 85 | Pydantic AI Harness +25 |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 87 | 87 | even |
| Transparency & trust | 7% | 52 | 82 | Pydantic AI Harness +30 |
| Negative events | ≤15 | 0 | 0 | |
| Total | B 68.3/100 | A 83.5/100 |
Facts side by side
| Fact | DSPy | Pydantic AI Harness |
|---|---|---|
| Kind | Agent framework | Agent framework |
| Vendor | Stanford NLP | Pydantic |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | ||
| Auth | None | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | MIT | MIT |
| Read-only variant documented | no | yes |
| llms.txt | no | yes |
| Last release | 2026-11-10 | 2026-11-27 |
| Terms last updated | no document linked | no date given |
| Privacy policy last updated | no document linked | 2024-02-21 |
| Customer content may train models | not read yet | not found in the text |
| Terms restrict automated access | not read yet | not found in the text |
| Terms restrict benchmarking | not read yet | yes |
| Terms or service can change without notice | not read yet | not found in the text |
| Arbitration or class-action waiver | not read yet | yes |
| Popularity | 39k stars | none |
Verdicts
DSPy
An MIT Python framework with typed signatures, a ReAct agent that returns tool errors to the model, MCP tool conversion, a Deno sandbox for generated code, no telemetry found and monthly releases. Release 3.5 changed defaults and removed APIs in a minor version, and there is no tool approval hook or llms.txt.
Pydantic AI Harness
The Harness turns a Pydantic AI agent into a coding or research agent by adding capabilities, with twelve workspace backends, permission modes, spend and tool budgets, loop detection and a documented page for each part. It is 0.x and classed Alpha, minor releases may break APIs, and Coder's shell is unrestricted unless you attach a sandbox or permissions.
Before you call either
DSPy
- Re-evaluate saved programs after upgrading to 3.5, since the default adapter and prompts changed
- Install dspy[mcp] and convert each MCP tool with dspy.Tool.from_mcp_tool while the client session stays open
- Disable the answer cache for calls whose output must change between runs, since memory and disk caches are on by default
- Wrap tools that send, pay or delete in your own confirmation step, because ReAct runs tools without approval
- Pin dspy to a minor version, since minor releases remove APIs
Pydantic AI Harness
- Attach a workspace capability. Harness capabilities never pick one, and a run without one fails at its start
- Use a sandbox capability instead of
LocalWorkspacefor model-written commands.LocalWorkspaceruns them on your machine as you - Add
Permissionsinautoorread-onlymode, with a deferred-call handler, before lettingCoderrun unattended - Set
PromptInjectionDefender(block_high_risk=True)if tool results should be blocked rather than only flagged - Pin the Harness and Pydantic AI together and read the release notes before a minor upgrade. 0.x minors can break APIs
Questions
Which is better for AI agents, DSPy or Pydantic AI Harness?
Pydantic AI Harness scores 83.5 (A) on agent readiness against DSPy's 68.3 (B), and leads in 4 of 7 scored categories.
Are DSPy and Pydantic AI Harness open source?
Yes. DSPy is open source (MIT). Pydantic AI Harness is open source (MIT).
Other comparisons with DSPy or Pydantic AI Harness
- AgentOS vs DSPy
- AgentOS vs Pydantic AI Harness
- Agno vs DSPy
- Agno vs Pydantic AI Harness
- BoxLang AI vs DSPy
- BoxLang AI vs Pydantic AI Harness
- Claude Agent SDK vs DSPy
- Claude Agent SDK vs Pydantic AI Harness
- CrewAI vs DSPy
- CrewAI vs Pydantic AI Harness
- Cursor Agent SDK vs DSPy
- Cursor Agent SDK vs Pydantic AI Harness
- Docker Agent vs DSPy
- Docker Agent vs Pydantic AI Harness
- DSPy vs Genkit
- DSPy vs Agent Development Kit (ADK)
- DSPy vs guilds.run
- DSPy vs Haystack
- DSPy vs LangGraph
- DSPy vs LlamaIndex Framework
- DSPy vs Mastra
- DSPy vs Microsoft Agent Framework
- DSPy vs OpenAI Agents SDK
- DSPy vs Pydantic AI
- DSPy vs smolagents
- DSPy vs Strands Agents
- DSPy vs Terse Durable Actors
- DSPy vs TradingAgents
- DSPy vs AI SDK
- Genkit vs Pydantic AI Harness
- Agent Development Kit (ADK) vs Pydantic AI Harness
- guilds.run vs Pydantic AI Harness
- Haystack vs Pydantic AI Harness
- LangGraph vs Pydantic AI Harness
- LlamaIndex Framework vs Pydantic AI Harness
- Mastra vs Pydantic AI Harness
- Microsoft Agent Framework vs Pydantic AI Harness
- OpenAI Agents SDK vs Pydantic AI Harness
- Pydantic AI Harness vs smolagents
- Pydantic AI Harness vs Strands Agents
- Pydantic AI Harness vs Terse Durable Actors
- Pydantic AI Harness vs TradingAgents
- Pydantic AI Harness vs AI SDK
- Pydantic AI vs Pydantic AI Harness
Machine-readable
- This page as Markdown
/compare/dspy-vs-pydantic-ai-harness.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/dspy.json·/api/v1/tools/pydantic-ai-harness.json - From a terminal
anchor compare dspy pydantic-ai-harness(the CLI) - Over MCP
compare_tools {"a": "dspy", "b": "pydantic-ai-harness"}at/mcp, no key