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

Pydantic AI Harness A

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

CategoryWeightDSPyPydantic AI HarnessEdge
Reliability16%6261DSPy +1
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%7198Pydantic AI Harness +27
Agent ergonomics13%6489Pydantic AI Harness +25
Security & auth14%6085Pydantic AI Harness +25
Payments & pricing10%9090even
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%8787even
Transparency & trust7%5282Pydantic AI Harness +30
Negative events≤1500
TotalB 68.3/100A 83.5/100

Facts side by side

FactDSPyPydantic AI Harness
KindAgent frameworkAgent framework
VendorStanford NLPPydantic
Hosted endpointno (local only)no (local only)
Transports
AuthNoneNone
PricingFreeFree
x402nono
LicenceMITMIT
Read-only variant documentednoyes
llms.txtnoyes
Last release2026-11-102026-11-27
Terms last updatedno document linkedno date given
Privacy policy last updatedno document linked2024-02-21
Customer content may train modelsnot read yetnot found in the text
Terms restrict automated accessnot read yetnot found in the text
Terms restrict benchmarkingnot read yetyes
Terms or service can change without noticenot read yetnot found in the text
Arbitration or class-action waivernot read yetyes
Popularity39k starsnone

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

  1. Re-evaluate saved programs after upgrading to 3.5, since the default adapter and prompts changed
  2. Install dspy[mcp] and convert each MCP tool with dspy.Tool.from_mcp_tool while the client session stays open
  3. Disable the answer cache for calls whose output must change between runs, since memory and disk caches are on by default
  4. Wrap tools that send, pay or delete in your own confirmation step, because ReAct runs tools without approval
  5. Pin dspy to a minor version, since minor releases remove APIs

Pydantic AI Harness

  1. Attach a workspace capability. Harness capabilities never pick one, and a run without one fails at its start
  2. Use a sandbox capability instead of LocalWorkspace for model-written commands. LocalWorkspace runs them on your machine as you
  3. Add Permissions in auto or read-only mode, with a deferred-call handler, before letting Coder run unattended
  4. Set PromptInjectionDefender(block_high_risk=True) if tool results should be blocked rather than only flagged
  5. 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

Machine-readable

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.