Tracyn
Drop-in logging, human approvals, and compliance evidence for AI agents.
pip install tracyn
from tracyn import Tracyn
audit = Tracyn(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 tracyn 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. Tracyn 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 = Tracyn(
api_key="al_live_...",
agent_name="support-bot",
policy_yaml=open("tracyn.policy.yaml").read(),
)
# tracyn.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:
tracyn validate tracyn.policy.yaml
tracyn check tracyn.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. Tracyn'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 Tracyn as you would any other internal logging library.
Metadata
Release files for tracyn 0.3.0
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 |
|---|---|---|---|---|
| tracyn-0.3.0.tar.gz | 14.4 kB | Without provenance | Details for tracyn-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tracyn-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for tracyn-0.3.0-py3-none-any.whl |
Total release size: 27.0 kB
Release files / tracyn-0.3.0.tar.gz
| Download URL | tracyn-0.3.0.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7c42238c66e841da1335bd842ce8c86258eced1533c3527dbf533c4efae46e2
|
|
BLAKE2b-256 checksum How to use checksums |
c2f2a5a0cb611119c6ceca0edbd311a8ebd1c0c41f7e07fe34f18520ef53bdee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / tracyn-0.3.0-py3-none-any.whl
| Download URL | tracyn-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f6b53678d75610d8434c7335384027dbf73b3a10089bfebcca5087aaaa1252e
|
|
BLAKE2b-256 checksum How to use checksums |
04d0ae917e48c8bddbd155d5a4bb7d4618cf1adb1ed218835ecf462c48680a93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for tracyn 0.3.0
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.