Open-source database audit trail engine written in Rust. Zero daemons, pooler-safe actors, and tamper-resistant diffs.
Auditstream records who changed what at the database level with full before and after values, stored in a partitioned append-only history table (auditstream.changes) inside your own database and exported on demand using a commit-safe xid8 cursor.
No 24/7 consumer daemon. No WAL replication slots. No new infrastructure.
Single-row UPDATE throughput on PostgreSQL 19: −7% limited by the disk, −73% limited by the CPU · 2.4M PgBouncer tx with 0 actor leaks · Benchmarks
→ auditstream.dev · Docs · Quickstart · TypeScript SDK · Evidence · Specification
- Thin adapters attach the actor:
@auditstream/node,@auditstream/prisma(Prisma 7.1+), and@auditstream/drizzle(0.45 & 1.x) propagate identity viaAsyncLocalStorage.run()and append an unpadded base64urlsqlcommentertag (/*auditstream='...'*/) — supporting humans, API keys, services, and AI agents actingonBehalfOfa user. - Database triggers capture atomically: Generated
SECURITY DEFINERtriggers writebefore,after,changed, and actor metadata intoauditstream.changes(statement-level forINSERT/DELETE, row-level withIS DISTINCT FROMforUPDATE). Application roles receiveSELECTonly. - One Rust CLI inspects and exports:
auditstream init,verify,status,history, andexport(JSON Lines & CSV) read committed windows viaxact_id < pg_snapshot_xmin()so concurrent out-of-order commits are never skipped.
| Target | Status | Details |
|---|---|---|
| PostgreSQL | Supported & tested | PostgreSQL 15–19 (verified 15.20–19.0), PgBouncer 1.26, Neon, and Supabase |
| MySQL | Demand-gated | Not supported yet — PostgreSQL is the only supported database |
| TypeScript SDK | Supported | @auditstream/* for Prisma 7, Drizzle, Next.js 16, Hono, and Express |
| Python SDK | Planned | No native SDK yet — works today via psycopg and SQL comments |
| Plain SQL | Supported | Any language or driver (Go, Ruby, Java, psql) via SQL comments or set_config |
| Repository | Description |
|---|---|
auditstream/auditstream |
Rust engine & CLI, normative spec/, conformance fixtures, handbook |
auditstream/auditstream-js |
TypeScript SDKs: @auditstream/node, @auditstream/prisma, @auditstream/drizzle |
auditstream/site |
Documentation & site (auditstream.dev) |
auditstream/auditstream-lab |
Integrated tests of the published CLI and SDK against real PostgreSQL and PgBouncer |
auditstream/homebrew-tap |
Official Homebrew formula (brew install auditstream/tap/auditstream) |
Versions: CLI releases · TypeScript SDK releases · compatibility
# Shell (macOS & Linux)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/auditstream/auditstream/releases/latest/download/auditstream-installer.sh | sh
# Homebrew (macOS & Linux)
brew install auditstream/tap/auditstream
# npm
npm i -g auditstream
# Docker (multi-arch linux/amd64 + linux/arm64)
docker run --rm ghcr.io/auditstream/auditstream:latest --version
# TypeScript SDKs (or replace @auditstream/prisma with @auditstream/drizzle)
pnpm add @auditstream/node @auditstream/prismaWindows (PowerShell): powershell -ExecutionPolicy Bypass -c "irm https://github.com/auditstream/auditstream/releases/latest/download/auditstream-installer.ps1 | iex"
- Questions: GitHub Discussions · SUPPORT.md
- Chat: Auditstream Discord
- License: MIT License
- Security disclosures:
security@auditstream.dev· SECURITY.md - Supply chain: SLSA Build Attestations · GHCR container image