Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,23 @@ DBShield operates with a **Two-Phase Distributed Dry-Run Engine**:
### What is Virtual Schema Masking?
When AI coding agents run introspection queries like `SELECT * FROM information_schema.tables`, DBShield intercepts the wire protocol and rewrites catalog responses. Sensitive internal tables (`credentials`, `sessions`, `api_keys`) and restricted columns are hidden entirely from the agent's view.

### How do I stop AI coding agents from running `DROP TABLE` or full table scans?
Point your agent or ORM (`Prisma`, `Drizzle`, `TypeORM`, `psql`) at DBShield (`npx @ritualdev-lab/dbshield proxy --port 5433 --tier STRICT`) or add `npx @ritualdev-lab/dbshield mcp` to Claude Desktop/Cursor. Destructive DDL (`DROP`, `TRUNCATE`), unconstrained mutations, and unindexed full-table scans are blocked or routed through rollback dry-runs and Slack/Teams sign-off before execution.

---

## Why DBShield vs PgBouncer, Cloud WAFs, & Regex Proxies?

| Capability | DBShield (`@ritualdev-lab/dbshield`) | PgBouncer | Cloud WAFs (AWS / Cloudflare) | Naive Regex SQL Proxies |
| :--- | :---: | :---: | :---: | :---: |
| **Primary Purpose** | **AI Agent Wire-Protocol SQL Firewall** | Connection Pooling | HTTP Edge Traffic Filtering | Simple String Matching |
| **PostgreSQL Extended Query (`Parse`/`Bind`) Inspection** | ✅ Full Wire AST Reconstruction | ❌ Passthrough | ❌ HTTP Layer Only | ❌ Bypassed by Prisma/Drizzle |
| **Zero-Lock Dry-Run Blast Radius (`ROLLBACK`)** | ✅ Automatic Row/Column Diff | ❌ None | ❌ None | ❌ None |
| **Intent vs. Effect Gap & Privilege Checks** | ✅ Detects Role Escalation & Cascade | ❌ None | ❌ None | ❌ Syntax Only |
| **Dynamic PII & Virtual Schema Masking** | ✅ Wire-Level Catalog & Row Redaction | ❌ None | ⚠️ Limited Response Masking | ❌ None |
| **Signed ChatOps Approval (`HMAC-SHA256`)** | ✅ Slack / MS Teams Two-Man Rule | ❌ None | ❌ None | ❌ None |
| **Direct SQLite `.db` OS VFS Guard** | ✅ Built-in Page-Level Shim | ❌ Not Applicable | ❌ Not Applicable | ❌ None |

---

## 🚀 Key Capabilities
Expand Down