Skip to main content

⚡ Quickstart

Get Auditail protecting your AI agents in under 5 minutes.


Step 1 — Install the SDK​

npm install auditail-sdk

Step 2 — Get an API Key​

👉 Request your API key here

We issue keys to private-beta design partners personally, usually within a day. Then open your dashboard at app.auditail.io and paste the key to see events arrive.


Step 3 — Initialize the Client​

import { Auditail } from 'auditail-sdk';

const aegis = new Auditail({
apiKey: process.env.AUDITAIL_API_KEY!,
environment: 'production', // shows in the dashboard
});

Step 4 — Add Guardrail Rules​

aegis
.addRule(Auditail.rules.noExternalEmail({ internalDomains: ['acme.com'] }))
.addRule(Auditail.rules.noDataDeletion())
.addRule(Auditail.rules.noExternalApiCalls());

Step 5 — Wrap Every Agent Action​

This is the core pattern. Before your AI agent executes any action, call aegis.guard():

const payload = {
subject: 'Q3 Report',
body: 'Please find the report attached.',
};

const result = await aegis.guard({
action: 'send_email',
payload,
agentId: 'financial-report-bot',
userId: req.user.id, // optional, for user-level audit trails
});

if (result.approved) {
await emailService.send(payload);
} else {
console.log(`Blocked [${result.matchedRule}]: ${result.reason}`);
// result.auditId is already logged — reference it in your incident report
}

What You Get​

Every guard() call returns:

{
"approved": false,
"auditId": "aeg_1a2b3c_x9z4k7",
"reason": "Blocked: sending email to an external domain is not permitted.",
"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​

tip

Guardrail rules run locally inside your process, so a decision never waits on the network. Events are sent to Auditail in the background. Call await aegis.flush() before a serverless function returns.