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

You'll get your key within 24 hours. During the private beta, all keys are free.


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())
.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 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
}

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​

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.