This package has had its final release, 0.28.3. Development continues as
django-spec-agents(documentation), which merges this package withdjangorestframework-pydantic-ai. Its import package isdjango_spec_agents. See Moving to django-spec-agents.This release is code-identical to 0.28.2. A known defect stays in it and is fixed only in
django-spec-agents: a destructive tool whose registered name differs from its function's name, through@tool(name=)or aToolSpecregistered directly, is offered to the model under the function's name, so the tool guard does not ask before it runs. If you stay on 0.28.x, put the function's name inrequire_approval; the registered name does nothing there.
django-pydantic-agent
The settings-agnostic agent-host substrate shared by Django's Pydantic-AI transports.
It takes an AgentConfig in and returns a built pydantic_ai.Agent — with
composed toolsets, audit, and user resolution — and reads no Django settings
of its own. Each transport owns its settings namespace, builds an AgentConfig,
and hands it down:
- django-ag-ui — AG-UI over SSE for a browser client.
- django-a2a — agent-to-agent (planned).
pip install django-pydantic-agent
Most projects install a transport and get this as a dependency. Reach for it directly when you are building a transport, sharing agent construction between two of them, or embedding an agent with no HTTP surface at all.
from django_pydantic_agent import AgentConfig, ToolRegistry, build_agent, tool
registry = ToolRegistry()
@tool(registry)
def list_orders(status: str) -> list[dict]:
"""List orders with the given status."""
...
agent = build_agent(registry, AgentConfig(model="anthropic:claude-sonnet-4-5"))
What it provides
- Agent construction —
AgentConfig→build_agent, model and provider resolution, and an escape hatch to replace construction entirely. - A tool registry —
@toolwithdestructive/category/confirm/summarymetadata, and JSON Schema derived from the signature. - Storage contracts —
ConversationStore/AttachmentStoreprotocols, reference implementations, and Django models incontrib.store. - Policy — an audit trail over every tool call, and a server-side approval gate for destructive tools. Both off by default.
- Integrations — optional bridges exposing
djangorestframework-servicesspecs or adrf-mcp-serverregistry as agent tools, in process.
Optional extras: [drf-mcp] (bridge a drf-mcp-server registry as a toolset),
[spec-tools] (drf-services specs as agent tools), [harness]
(pydantic-ai-harness capabilities), and the provider extras [anthropic] /
[openai] / [google].
Documentation
https://artui.github.io/django-pydantic-agent/
- Concepts — how a config becomes an agent, and what belongs here versus in a transport.
- Tools — registering tools and what the metadata does.
- Storage — the store contracts, owner scoping, and the reference models.
- Policy — audit and the destructive-tool gate.
- Integrations — DRF specs and MCP tools as agent tools.
- Reference — the full public API.
Metadata
Release files for django-pydantic-agent 0.28.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_pydantic_agent-0.28.3.tar.gz | 402.4 kB | With provenance | Details for django_pydantic_agent-0.28.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_pydantic_agent-0.28.3-py3-none-any.whl | Python 3 | none | any | Details for django_pydantic_agent-0.28.3-py3-none-any.whl |
Total release size: 525.5 kB
Release files / django_pydantic_agent-0.28.3.tar.gz
| Download URL | django_pydantic_agent-0.28.3.tar.gz |
|---|---|
| Size | 402.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6b1679daa6b2d58c989da28d996fdd37b83ae8289966585c92e79970f4b538c
|
|
BLAKE2b-256 checksum How to use checksums |
94b1f274a35b3ffe1a6b8bb9f98dabc14df9ad6feacbc3632b04df8da17c270a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / django_pydantic_agent-0.28.3-py3-none-any.whl
| Download URL | django_pydantic_agent-0.28.3-py3-none-any.whl |
|---|---|
| Size | 123.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d278637a65bdbbf3f065b6b7d605d9a4c5d8e383bbada45b54d3d4548dc6119e
|
|
BLAKE2b-256 checksum How to use checksums |
85053d55199c9b36adc13354bf208781af157c5aad8b28e3e5ad6cd426fad845
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for django-pydantic-agent 0.28.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for django_pydantic_agent-0.28.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.