Skip to main content

AuditAgent

Drop-in logging, human approvals, and compliance evidence for AI agents.

pip install AudAgent
from audagent import AuditAgent

audit = AuditAgent(api_key="al_live_...", agent_name="support-bot")

@audit.track(action_type="external", action_name="send_email")
async def send_email(to: str, subject: str, body: str):
    return await email_provider.send(to, subject, body)

That's it — every call to send_email is now logged (inputs, output, latency, cost, model, a hash of the prompt) with PII redacted server-side before storage. If your workspace's policy requires approval for action_type: external, the call blocks until a human approves/rejects/edits it in Slack (or via email if Slack isn't configured) — see your dashboard's Policy tab.

Handling rejections

from audagent import ApprovalDeniedError, ApprovalTimeoutError

try:
    await send_email("customer@example.com", "Refund approved", "...")
except ApprovalDeniedError as e:
    print(f"Blocked by {e.decision_by}: {e.note}")
except ApprovalTimeoutError:
    print("Nobody responded in time — treated as denied")

Shutting down cleanly

Logging happens on a background thread so track() adds well under 5ms to the wrapped call. AuditAgent registers an atexit hook automatically, so queued events are flushed on normal process exit without any extra setup.

If you want the queue drained at a specific point instead of waiting for exit — e.g. before a health check reports ready, or between batches in a long-running worker — call audit.flush() or audit.close() yourself (both are safe to call more than once).

Policy

By default the SDK fetches your workspace's active policy from the dashboard at startup. To pin a repo-local policy instead (e.g. for CI, or to review policy changes via pull request):

audit = AuditAgent(
    api_key="al_live_...",
    agent_name="support-bot",
    policy_yaml=open("auditagent.policy.yaml").read(),
)
# auditagent.policy.yaml
rules:
  - match:
      action_type: external
    require_approval: true
  - match:
      action_type: data_access
      action_name: "delete_*"
    require_approval: true

Validate that file (schema + YAML syntax) before committing it, and check what a given action would resolve to under it — both run offline, no API key needed:

audagent validate auditagent.policy.yaml
audagent check auditagent.policy.yaml --action-type external --action-name send_email

What this does not do

Policy enforcement is trust-based: track() checks the policy and calls the approval endpoint itself, but nothing stops a developer from not wrapping a call, or from bypassing the SDK entirely in their own code. AuditAgent's threat model is "give honest teams a governance trail and a real approval gate," not "prevent a malicious developer from evading their own compliance tooling." Treat AuditAgent as you would any other internal logging library.

Metadata

Release files for AudAgent 0.2.4

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

Source distribution (sdist)

Source distribution for AudAgent 0.2.4
File Size Uploaded Provenance Actions
audagent-0.2.4.tar.gz 14.6 kB With provenance Details for audagent-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for AudAgent 0.2.4
File Interpreter ABI Platform Actions
audagent-0.2.4-py3-none-any.whl Python 3 none any Details for audagent-0.2.4-py3-none-any.whl

Total release size: 27.2 kB

Release files / audagent-0.2.4.tar.gz

Download URL audagent-0.2.4.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5f8e8e50c528d0dd6c09a1442f5bcc97a80b2ac366daad89420539b2e6101124
BLAKE2b-256 checksum
How to use checksums
cbf8f97cbca7bfa3691e70d3b9ca4a3d6f808c954c01e79710c2989b9493646b
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 Sep 18, 2026.

Transparency log

Release files / audagent-0.2.4-py3-none-any.whl

Download URL audagent-0.2.4-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fa446589e2ff429c19cd2c775781d61ba321ef71111687ce285dd7da8586cb6
BLAKE2b-256 checksum
How to use checksums
0d43757dc815efb2bf4cecd9dc6e61b517283aa8a86d5bb6ee1087015168f0c6
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 Sep 18, 2026.

Transparency log

Security for AudAgent 0.2.4

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.

Select from 2 files

Attestation for audagent-0.2.4.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 Sep 18, 2026.

Transparency log

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