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.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 |
|---|---|---|---|---|
| audagent-0.2.3.tar.gz | 14.5 kB | With provenance | Details for audagent-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| audagent-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for audagent-0.2.3-py3-none-any.whl |
Total release size: 27.2 kB
Release files / audagent-0.2.3.tar.gz
| Download URL | audagent-0.2.3.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3549ad21f2d6258b810bf36f03d0ff6e1526c32f218a18bd25f4dd0821d73194
|
|
BLAKE2b-256 checksum How to use checksums |
09fc29a55bb82bac2f57a98e97a1de816b875030778db0683db9bc46f2f9e7ec
|
| 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 logRelease files / audagent-0.2.3-py3-none-any.whl
| Download URL | audagent-0.2.3-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c140a5ca266fe515a7106e56efa571948cff0dcc11d263ea8608ce0bc2a82de7
|
|
BLAKE2b-256 checksum How to use checksums |
b88ed45c985f3163df1a20d26de82557012cfc4a935374d4158cb56a14fdeec0
|
| 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 logSecurity for AudAgent 0.2.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 audagent-0.2.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 Sep 17, 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.