Skip to main content

Asqav

Governance for AI agents. Audit trails, policy enforcement, and compliance.

PyPI version Downloads License: MIT Python versions GitHub stars

Website | Docs | SDK Guide | Compliance

Asqav for PydanticAI

Cryptographic audit trails for PydanticAI agent tool calls.

Uses PydanticAI's Hooks capability to sign every tool invocation with Asqav - producing verifiable records for compliance and governance.

Data handling

asqav-pydantic is a thin wrapper around the asqav Python SDK and inherits its mode behavior:

  • Asqav cloud (*.asqav.com): the SDK hashes your action context locally and sends only the hash plus a small metadata bag (action_type, agent_id, session_id, model_name, tool_name). Raw prompts and tool arguments never leave your infrastructure.
  • Self-hosted: the SDK sends the full context so the server can run policy checks, PII redaction, and richer audit views. Recommended when you control the deployment.

You can override per call:

import asqav

# Force hash-only against a custom URL
asqav.init(api_key="sk_...", base_url="https://api.asqav.com", mode="hash-only")

This is GDPR-aware data minimization by default for cloud deployments. See docs/fingerprint-spec.md in the SDK repo for the fingerprint spec and conformance vectors.

Install

pip install asqav-pydantic

Usage

import asqav
from pydantic_ai import Agent
from asqav_pydantic import AsqavHooks

asqav.init(api_key="sk_...")

hooks = AsqavHooks(agent_name="my-agent")
agent = Agent("openai:gpt-4o", capabilities=[hooks.capability()])

result = agent.run_sync("Search for the latest AI news")

Every tool call the agent makes will produce signed tool:start, tool:end, and tool:error events through the Asqav API. Signatures use NIST FIPS 204 ML-DSA cryptography server-side, producing tamper-evident audit trails for EU AI Act, DORA, and SOC 2 compliance.

How it works

AsqavHooks extends the Asqav adapter base class and builds a PydanticAI Hooks capability with three registered hooks:

  • before_tool_execute - signs tool:start with tool name and input preview
  • after_tool_execute - signs tool:end with tool name and output metadata
  • on_tool_execute_error - signs tool:error with tool name and error details

All signing is fail-open. If the Asqav API is unreachable, a warning is logged but the tool call proceeds normally. Your agent pipeline never breaks because of governance.

Configuration

# Use an existing asqav agent by ID
hooks = AsqavHooks(agent_id="ag_abc123")

# Override the API key
hooks = AsqavHooks(api_key="sk_other", agent_name="audit-agent")

License

MIT

Metadata

Release files for asqav-pydantic 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asqav-pydantic 0.1.2
File Size Uploaded Provenance Actions
asqav_pydantic-0.1.2.tar.gz 4.6 kB Without provenance Details for asqav_pydantic-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asqav-pydantic 0.1.2
File Interpreter ABI Platform Actions
asqav_pydantic-0.1.2-py3-none-any.whl Python 3 none any Details for asqav_pydantic-0.1.2-py3-none-any.whl

Total release size: 9.8 kB

Release files / asqav_pydantic-0.1.2.tar.gz

Download URL asqav_pydantic-0.1.2.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
be013bb37f805df9acc3b99c8a3d6400b5e593eb24879c558adb95f8ef744600
BLAKE2b-256 checksum
How to use checksums
e9a22cf8b57e31dd81086cc04dcbc8580fca19c2351a66f72e3b4d71ce436e9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / asqav_pydantic-0.1.2-py3-none-any.whl

Download URL asqav_pydantic-0.1.2-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30cabf532e6781b5f7363e9ecfa5dd644eeeffb6ac327740475c345cd16cbb04
BLAKE2b-256 checksum
How to use checksums
33d7999391c1bafd207476b9cefdddd609da8ec3f20e14429b2d2375e3ad7583
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for asqav-pydantic 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page