Skip to content

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.

Terminal window
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.

{
"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..."
}
  • Compliance and SOC 2 audit requirements
  • Debugging unexpected data changes
  • Forensic analysis of production incidents