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.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 AudAgent 0.2.2
File Size Uploaded Provenance Actions
audagent-0.2.2.tar.gz 13.9 kB With provenance Details for audagent-0.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 26.2 kB

Release files / audagent-0.2.2.tar.gz

Download URL audagent-0.2.2.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7e709458005b7f7a13739237b79fbd8563ec3a757c9e1f82d465973b0dd81b1b
BLAKE2b-256 checksum
How to use checksums
91e9957118c2b86307c3badaf9e8b6d2962c2c231457051b4c1c8049610f5b27
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 17, 2026.

Transparency log

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

Download URL audagent-0.2.2-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bedaf58fecde42274c6318511d9bb3ee664c558887d4a4123634728424e4ac0
BLAKE2b-256 checksum
How to use checksums
e17e2567324f0c2b01388ebd10ae066f81e7ac557554c6e1991e2bb41c04567e
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 17, 2026.

Transparency log

Security for AudAgent 0.2.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for audagent-0.2.2.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 17, 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