Audit Trail
Every query and transaction executed through Post AI is recorded in an immutable D1 audit trail. Each entry is hash-chained to the previous one — tampering with any record breaks the chain.
Query the audit trail
Section titled “Query the audit trail”curl "https://postdb.dev/api/audit/query/SELECT" \ -H "Authorization: Bearer YOUR_API_KEY"Returns all audit entries for the given entity type and ID, ordered by timestamp.
Audit entry format
Section titled “Audit entry format”{ "id": "audit-001", "entityType": "query", "entityId": "SELECT", "operation": "execute", "data": {"sql": "SELECT * FROM users WHERE id = $1", "params": ["user-123"]}, "timestamp": "2024-01-15T10:30:00Z", "hash": "sha256:abc123...", "prevHash": "sha256:def456..."}Use cases
Section titled “Use cases”- Compliance and SOC 2 audit requirements
- Debugging unexpected data changes
- Forensic analysis of production incidents