# Apodictic — Stop AI Agents From Corrupting Your Production Database > Pre-commit formal verification firewall between autonomous AI agents and production databases (PostgreSQL, Odoo 18, Stripe, SAP S/4HANA, NetSuite, MCP). Built by the team that processed 900,000+ statutory documents across 983 businesses. ## Core Thesis Traditional access controls check *who* an AI agent is. They do not verify whether an authorized write will corrupt your ledger, breach payroll liquidity reserves, or break statutory tax hash chains. Apodictic sits at the commit boundary and proves every SQL, PL/pgSQL, and ERP mutation against your accounting, tax, and spending rules in Microsoft Z3 5.4.1 (~1.39 ms median latency) before a single row commits. ## Key Capabilities & Measured Benchmarks - **Pre-Commit Z3 5.4.1 Verification**: Evaluates `QF_LRA` / `QF_LIA` / `QF_AUFLIA` invariants over SQL, CTEs (`WITH`), subqueries, PL/pgSQL (`DO $$ ... $$`, `CREATE FUNCTION`), `chr()`/`hex` de-obfuscated `EXECUTE` dynamic SQL, and ERP RPC payloads. - **Pure-Rust SQL AST + `libz3` C FFI Kernel**: `noesis-symbolic-sql` parses SQL directly into `QF_AUFLIA` array-theory theorems solved in-process against `libz3` C FFI (`apodictic_rust_kernel`). - **Declarative Policy & Transitive Entity DAG**: Evaluates `permit`/`forbid` authorization rules and cycle-safe BFS transitive group hierarchies (`User::"alice" in Group::"treasury_admins" in Group::"cfo_approvers"`) compiled into Z3 assertions (`evaluatePolicy` / `apodictic_evaluate_policy`). - **100-Case Public Security Suite**: `60/60` attacks blocked (`100.0%`), `40/40` valid writes allowed (`0%` false positives), `p50 = 1.42 ms`, `p95 = 2.516 ms`, `p99 = 2.976 ms` (`15.192 ms` warmup cold-start). Raw JSON: `/public-security-benchmark.json` - **10,000-Case Unique Adversarial Suite**: `7,500/7,500` attacks blocked, `2,500/2,500` valid writes allowed, `0` false positives, `0` false negatives, `p50 = 1.392 ms`, `p95 = 2.037 ms`, `p99 = 2.372 ms`, `669 tx/s`. Summary: `/benchmark-10k-summary.json` | Raw JSONL: `/benchmark-10k-results.jsonl` - **Zero-PII Symbolic Gateway (`SYM_*`) & MCP Payload Guard**: Validates IBANs via ISO-7064 Mod-97-10 and payment cards via Luhn Mod-10, replaces secrets/PII locally with bijective `` tokens before cloud egress (`0` raw PII bytes sent), and blocks Unicode tag smuggling / prompt injection / shell RCE via `scanApodicticMcpToolGuard`. - **Sub-38ms Rollback, Logical WAL Reversal & 2-Phase Double-Entry Escrow**: Single-DB PostgreSQL `SAVEPOINT` & logical WAL before/after tuple reversal (`< 25 ms`), Odoo 18 `account.move.reversal` compensation (`< 38 ms`), and 2-Phase Double-Entry Escrow Outbox (`debits_pending -> debits_posted` conservation, `ESCROW_HELD` -> `ESCROW_CANCELLED_PRE_DISPATCH` / `flushEscrow`). - **Crash-Durable 24h Velocity & Smurfing Defense**: Tracks cumulative 24-hour transfers in SQLite WAL (`APODICTIC_STATE_DB`) or PostgreSQL to block multi-turn split smurfing across agent sessions and worker restarts. - **RFC 6962 Binary Merkle Proofs & WORM Audit Ledger**: Domain-separated `0x00`/`0x01` RFC 6962 `O(log N)` inclusion proofs (`getMerkleInclusionProof` / `apodictic_merkle_proof`) paired with chained SHA-256 + NIST P-256 (`prime256v1`) ECDSA signatures. - **Protocol Adapters (Envoy L7 & OPA Data API)**: Standard L7 interception via HTTP/2 gRPC Envoy `ExternalProcessor` (`services/envoy-ext-proc/`) + `POST /api/v1/envoy-ext-proc` and zero-`eval()` policy Z3+DAG gateway via `POST /api/v1/opa` (`/v1/data/apodictic/allow`). - **Compiled Native Rust & Python Z3 Kernel**: 8 wired production Rust crates (`noesis_infra/`: `noesis-symbolic-sql`, `noesis-z3-engine`, `noesis-zero-leak-sanitizer`, `noesis-merkle-trie`, `noesis-sovereign-audit-vault`, `noesis-wire-proxy`, `noesis-cdc-engine`, `noesis-cli-admin`) + Python Z3 5.4.1 formal engine (`noesis_engine/`). ## Quickstart: MCP Proxy & TypeScript/Node.js SDK ```bash # Wrap any stdio MCP server (Cursor, Claude Code, Postgres MCP, Odoo MCP): npx @apodictic/mcp-verifier wrap -- # Or run standalone MCP verification server: npx @apodictic/mcp-verifier serve # Install TypeScript / Node.js SDK: npm install @apodictic/sdk ``` ```javascript import { SymbolicGateway } from '@apodictic/sdk'; const gw = new SymbolicGateway(); const res = await gw.verifySql('UPDATE invoices SET total = 100 WHERE id = 1;'); const pol = await gw.evaluatePolicy({ action: 'UPDATE', principal: 'User::"alice"', entityHierarchy: { 'User::"alice"': ['Group::"cfo_approvers"'] }, amount: 100 }); const proof = await gw.getMerkleInclusionProof(res.blockIndex); ``` ## Machine-Readable Proofs & Documentation - Full Technical Specification for LLMs: `/llms-full.txt` - Interactive 9-Gist Proof Explorer: `/proofs` - Security & Comparison Matrix: `/security` - Architecture & Specifications: `/architecture` - Developer SDK & 15-File Hashed Evidence Package: `/code` - Reference Documentation: `/docs` - Trust Center & Live WORM Chain: `/trust` - Live Developer Sandbox (Rust + Z3 Enclave): `/sandbox` - Public GitHub Proofs Repository: https://github.com/sofiantarek2009-hash/noesis-verified-proofs