⚡ Quickstart
Get Auditail protecting your AI agents in under 5 minutes.
Step 1 — Install the SDK
- npm
- yarn
- Python (pip)
npm install auditail-sdk
yarn add auditail-sdk
pip install auditail
Step 2 — Get an API Key
You'll get your key within 24 hours. During the private beta, all keys are free.
Step 3 — Initialize the Client
- TypeScript
- Python
import { Auditail } from 'auditail-sdk';
const aegis = new Auditail({
apiKey: process.env.AUDITAIL_API_KEY!,
environment: 'production', // shows in the dashboard
});
import os
from auditail import Auditail
aegis = Auditail(
api_key=os.environ["AUDITAIL_API_KEY"],
environment="production",
)
Step 4 — Add Guardrail Rules
- TypeScript
- Python
aegis
.addRule(Auditail.rules.noExternalEmail())
.addRule(Auditail.rules.noDataDeletion())
.addRule(Auditail.rules.noExternalApiCalls());
from auditail import rules
aegis.add_rules([
rules.no_external_email(),
rules.no_data_deletion(),
rules.no_external_api_calls(),
])
Step 5 — Wrap Every Agent Action
This is the core pattern. Before your AI agent executes any action, call aegis.guard():
- TypeScript
- Python
const result = await aegis.guard({
action: 'send_email',
payload: {
to: 'client@example.com',
subject: 'Q3 Report',
body: 'Please find the report attached.',
},
agentId: 'financial-report-bot',
userId: req.user.id, // optional, for user-level audit trails
});
if (result.approved) {
await emailService.send(result.payload);
} else {
console.log(`Blocked [${result.matchedRule}]: ${result.reason}`);
// result.auditId is already logged — reference it in your incident report
}
result = aegis.guard(
action="send_email",
payload={
"to": "client@example.com",
"subject": "Q3 Report",
"body": "Please find the report attached.",
},
agent_id="financial-report-bot",
user_id=request.user_id, # optional
)
if result.approved:
email_service.send(**result.payload)
else:
print(f"Blocked [{result.matched_rule}]: {result.reason}")
What You Get
Every guard() call returns:
{
"approved": false,
"auditId": "aeg_1a2b3c_x9z4k7",
"reason": "Blocked: sending email to an external domain requires human approval.",
"matchedRule": "no-external-email",
"timestamp": "2025-01-15T10:30:00.000Z",
"latencyMs": 2
}
And every event is logged to the Auditail dashboard with:
- Full payload
- The agent ID and user ID
- Which rule fired and why
- Environment label
Next Steps
- Guardrails → — Write custom rules for your specific use case
- Audit Trail → — Understand what gets logged and how to query it
- LangChain Integration → — Drop-in wrapper for LangChain tools
- Human Approval → — Pause on risky actions and require a human sign-off
tip
The preview SDK runs fully locally — guardrail evaluation and in-memory logging work out of the box. Only the dashboard and persistent log shipping require a beta API key.