Article 12 of the EU AI Act requires that high-risk AI systems include automatic logging capabilities. For AI agents, this means recording every significant decision and action the agent takes, stored in a way that enables post-hoc analysis and compliance verification.
The Act requires logging of events that are relevant to:
For AI agents, this translates to:
Logs must be retained for a period appropriate to the intended purpose of the high-risk AI system. The minimum is six months, but many deployments will need longer retention based on their domain requirements.
Article 12 implicitly requires that logs be reliable. If logs can be modified after the fact, they cannot serve their intended purpose of enabling investigation and compliance verification.
Hash-chained receipts satisfy this requirement. Each receipt includes a cryptographic hash of the previous receipt, creating a chain that breaks if any entry is modified, deleted, or reordered.
Authensor generates a receipt for every policy decision automatically:
const guard = createGuard({
policy,
receipts: {
store: 'postgresql',
connectionString: process.env.DATABASE_URL,
retention: '24months', // Retention period
}
});
Each receipt contains:
{
"id": "rec_abc123",
"timestamp": "2026-01-15T10:30:00Z",
"tool": "email.send",
"args": { "to": "user@example.com" },
"action": "escalate",
"reason": "External emails require approval",
"threats": [],
"principal": { "user": "user_456", "agent": "agent_support" },
"hash": "sha256:a1b2c3...",
"previousHash": "sha256:d4e5f6..."
}
The control plane API provides a chain verification endpoint:
curl https://control-plane/api/receipts/verify?session_id=sess_abc123
This returns whether the chain is intact and identifies any breaks. Run verification periodically as part of your compliance monitoring.
When a regulator or auditor requests records, you need to produce them quickly. Structure your receipt storage for efficient querying by session, by agent, by time range, and by decision type. The control plane API supports all of these query patterns out of the box.
Explore more guides on AI agent safety, prompt injection, and building secure systems.
View All Guides