SQLCipher
$ sqlcipher Official Med Risksqlcipher provides full 256-bit AES database encryption atop the familiar SQLite CLI shell. Agents can safely inspect encrypted databases using -readonly -json -bail by passing PRAGMA key in the SQL batch, avoiding accidental file corruption.
brew install sqlcipher Local encrypted SQLite file engine; agents invoke sqlcipher directly on workspace .db/.enc files.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Inherits SQLite CLI flags (-json, -csv, -readonly, -bail) for clean headless JSON queries, though omitting the SQL argument enters a blocking REPL and PRAGMA key prints ok unless suppressed or handled.
-json,-csv,-readonly, and-bailflags supported natively- Non-interactive when SQL statement is passed as argument or stdin
-readonly guarantees encrypted files cannot be mutated, though passing PRAGMA key in CLI arguments can expose keys in process listings unless piped via stdin.
-readonlyflag prevents write mutations at the SQLite VFS layer- Key passed via CLI arg is visible in
psunless piped via stdin
Easy install via brew install sqlcipher and Linux packages; Windows typically requires building from source or MSYS2.
- Homebrew and distro packages for macOS/Linux; source build on Windows
Transparent AES-256 encryption with full SQLite SQL and .schema/.dump capabilities.
- Drop-in encrypted replacement for
sqlite3CLI
Official Zetetic open-source project (sqlcipher/sqlcipher) actively tracking upstream SQLite.
- First-party Zetetic repository under BSD-3-Clause
Well-documented API/PRAGMA reference on zetetic.net and standard SQLite -help flags.
- Clear PRAGMA and CLI documentation
Security, Auth & Guardrails
Keys are never stored by sqlcipher; pass PRAGMA key via stdin or env-interpolated SQL scripts for each invocation.
BSD-3-Clause open-source SQLCipher Community Edition; free (commercial FIPS/enterprise builds are paid).
# SQLCipher Agent Rules - Always pass `-readonly -json -bail` for read-only inspection of encrypted `.db`/`.enc` files. - Source `PRAGMA key` from an environment variable (never hardcode keys in repo files or logs). - Always supply a SQL argument or piped stdin so `sqlcipher` does not hang in the `sqlite>` REPL.
Agent-Ready Command Recipes
Safe Read-Only Queries
sqlcipher -readonly -json -bail app.enc "PRAGMA key = '$SQLCIPHER_KEY'; SELECT name FROM sqlite_master WHERE type='table';"
Opens app.enc read-only, unlocks it via $SQLCIPHER_KEY, and outputs table metadata as JSON.
Controlled Writes & Previews
sqlcipher -bail app.enc "PRAGMA key = '$SQLCIPHER_KEY'; BEGIN; INSERT INTO settings(k,v) VALUES('mode','ci'); COMMIT;" Unlocks the encrypted database and commits an atomic SQL change, aborting on the first error (-bail).
Strengths for Agents
- + Native
-readonly+-json+-bailflags enable safe encrypted database inspection. - + Full SQLite SQL compatibility with transparent AES-256 page encryption.
Caveats & Pitfalls
- ! Passing
PRAGMA keyin the command-line string exposes the passphrase tops; pipe via stdin for sensitive keys. - ! Running
sqlcipher <file>without a SQL string enters an interactivesqlite>prompt.