Metadata-Version: 2.4
Name: auditail
Version: 0.4.0
Summary: Guardrails that block risky actions, plus a tamper-evident audit trail for autonomous AI agents.
Author: Auditail
License-Expression: MIT
Project-URL: Homepage, https://auditail.io
Project-URL: Documentation, https://auditail.io/docs
Project-URL: Repository, https://github.com/auditailhq/auditail
Project-URL: Request an API key, https://auditail.io/waitlist
Keywords: ai,agents,security,guardrails,audit,compliance,soc2,langchain
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: verify
Requires-Dist: cryptography>=42; extra == "verify"
Dynamic: license-file

# auditail (Python SDK)

> The security layer for autonomous AI agents. Guardrails that block risky actions, and a tamper-evident audit trail of everything your agents do.

**[📖 Full Documentation](https://auditail.io/docs)** · **[🚀 Join the Private Beta](https://auditail.io/waitlist)**

---

## Install

```bash
pip install auditail
pip install "auditail[verify]"   # adds verify_receipt() for the service that executes actions
```

## Quickstart

```python
from auditail import Auditail, rules

aegis = Auditail(api_key="your_key")

aegis.add_rules([
    rules.no_external_email(internal_domains=["acme.com"]),
    rules.no_data_deletion(),
])

result = aegis.guard(
    action="send_email",
    payload={"to": "client@example.com", "body": "Report attached."},
    agent_id="financial-bot-01",
)

if result.approved:
    send_email(...)
else:
    print(f"Blocked: {result.reason}")
```

## LangChain Integration

```python
from langchain.agents import tool
from auditail import Auditail, rules

aegis = Auditail(api_key="your_key")
aegis.add_rule(rules.no_external_email(internal_domains=["acme.com"]))

@tool
def send_email(to: str, body: str) -> str:
    """Send an email to a recipient."""
    result = aegis.guard(
        action="send_email",
        payload={"to": to, "body": body},
        agent_id="langchain-agent",
    )
    if not result.approved:
        return f"Action blocked by Auditail: {result.reason}"
    # ... actual send logic
    return "Email sent."
```

## Private beta

The SDK, API and dashboard are live. Guardrail rules run locally in your process; every decision is delivered in the background to a **hash-chained audit log** you can browse and verify at [app.auditail.io](https://app.auditail.io).

- Batched, retried, idempotent delivery. `guard()` never waits on the network, and a delivery failure never reaches your agent.
- Secrets are redacted before an event leaves your process (`password`, `token`, `apiKey`, ... plus your own `redact_keys`).
- Call `aegis.flush()` before a serverless function returns or the process exits.

**[Request an API key](https://auditail.io/waitlist)**: keys are issued to design partners personally.

**Human approval** is live: a `require_approval` rule pauses the agent until someone approves or denies it in the dashboard or through your webhook (Slack, Teams, Discord, any HTTPS endpoint). No answer means denied. See the [approval guide](https://auditail.io/docs/guides/human-approval).

**Signed receipts:** every human approval returns a receipt your payment or email service can verify before acting (`verifyReceipt`), so an agent cannot skip the check. Logs export to a file anyone can verify offline: `npx -p auditail-sdk auditail-verify`. See [receipts and evidence](https://auditail.io/docs/guides/receipts-and-evidence).

**Roadmap** (not available yet): native Slack and PagerDuty apps, private-cloud deployment.

## License

MIT
