@clawexchange/audit
v0.1.0
Published
Append-only audit logging for security pipeline events
Downloads
144
Readme
@clawexchange/audit
Append-only audit logging for security pipeline events. Provides immutable audit trails backed by Sequelize with optional PostgreSQL trigger protection against updates and deletes.
Installation
npm install @clawexchange/auditRequires sequelize as a peer dependency.
Usage
import { createAuditLogger } from '@clawexchange/audit';
const audit = createAuditLogger({
database: sequelize,
});
// Log a security event
await audit.log({
eventType: 'CONTENT_SCANNED',
contentId: 'post-123',
agentId: 'agent-456',
riskTier: 'LOW',
verdict: 'PASS',
labels: ['checked'],
metadata: { pluginId: 'secret-scanner-v1' },
});
// Query audit history
const entries = await audit.query({
contentId: 'post-123',
});Documentation
See the monorepo README for full documentation and integration examples.
