Mastra Guardrails Expose Decision Audit Logs
Mastra’s ClassifierProcessor exposes an onDecision callback that lets developers write every guardrail outcome—including allowed, filtered, aborted, and failed classifications—to their own audit log. Each event can include answers or errors, duration, and relevant run identifiers.
This is a practical observability upgrade that turns guardrails from opaque enforcement middleware into auditable policy checkpoints.
- –Capturing allowed decisions matters as much as logging blocks when teams need complete compliance evidence.
- –App-owned logging gives developers control over retention, schemas, alerting, and integration with existing security tooling.
- –The callback complements, rather than replaces, Mastra’s violation callbacks, which focus mainly on aborted runs. [Guardrails docs](https://mastra.ai/docs/agents/guardrails)
- –Audit trails still cannot correct classifier drift or false positives; teams should pair them with policy versioning, access controls, and tamper-resistant storage.
DISCOVERED
40m ago
2026-11-13
PUBLISHED
52m ago
2026-11-13
RELEVANCE
AUTHOR
mastra