Rowsafe
The database admin you never hired. Backups you can restore to any second, a restore test every week, monitoring with one-click fixes and a safety net for AI coding agents, for the databases you run on your own servers. Open source, no account needed.


Try it in 30 seconds
From your laptop, on any database you can connect to (managed ones too):
curl -fsSL https://rowsafe.sh/cli | sh
rowsafe pulse postgres://user@host:5432/dbname
No account, no agent on the server, nothing sent to Rowsafe. The recording above is real. If Rowsafe helps you, a ⭐ helps others find it.
Docs: rowsafe.sh/docs · Databases: PostgreSQL, MySQL, MariaDB, MongoDB, ClickHouse, Redis/Valkey, SQLite and more
Protect a server
This repository is the open-source part of Rowsafe: the agent, the rowsafe CLI, the installer and the MCP server. Everything that touches your data is here, under Apache-2.0.
On your database server (Linux, or Docker):
curl -fsSL https://rowsafe.sh | sudo sh
sudo rowsafe status shop
sudo rowsafe mark shop before-migration
sudo rowsafe restore shop --to "10m ago"
sudo rowsafe channels add --type slack --name ops --url https://hooks.slack.com/...
sudo rowsafe upgrade shop --to 18
Every engine above, with nothing sent to Rowsafe: continuous backups to your own bucket (encrypted on the server, with a passphrase only you have), Marks, a weekly restore test, restore to any second (or rewind the whole database, with undo), a second copy, alerts, Pulse with history, logs, security fixes, file backups, standbys and Prometheus metrics. From your laptop or an AI agent, over SSH: rowsafe add shop ssh://root@db1. All of it: Rowsafe on your server.
From your laptop
On a database you can connect to (managed ones too):
rowsafe add shop postgres://user@host:5432/dbname
rowsafe pulse shop
rowsafe fix shop
rowsafe insights | top | activity | settings | tune shop
rowsafe schema shop [TABLE…]
rowsafe explain shop "SELECT …"
rowsafe preview shop 0042.sql
rowsafe mcp shop --allow-writes
rowsafe use shop
Pulse checks cleanup falling behind, bloat, duplicate and unused indexes, stuck sessions, locks, connections, replication slots, transaction ID wraparound and settings. The connection string stays in your config folder, readable only by you; rowsafe pulse postgres://… works once without saving, and rowsafe use shop makes it a project's database. Through a pooler, everything works but the fixes that run inside the database. Nothing is sent to Rowsafe. rowsafe help local has the rest.
MySQL and MariaDB work the same way (rowsafe add shop mysql://user@host:3306/dbname), and so do MongoDB (mongodb://), Redis and Valkey (redis://). MySQL and MariaDB: stuck sessions and locks, long transactions, InnoDB's old row versions, the buffer pool, free space inside tables, unused and duplicate indexes, tables without a primary key and the slow query log, with fixes to end a session, drop an index, turn on the slow log and rebuild a table. Not yet: schema, explain, preview, replication checks, and MariaDB settings changes (they live in its configuration file).
On Windows, download rowsafe-windows-amd64.exe (or -arm64.exe) from the latest release; the commands from your laptop work there, fixes included, except MySQL for now.
Databases
On Linux servers and in Docker:
- PostgreSQL 13–18, MySQL 8.0/8.4, MariaDB 10.6–11.4, MongoDB 6.0–8.0, ClickHouse 24.8–26.8
- Redis 7.0+ and Valkey 7.2+ (standalone servers)
- SQLite (restore to any second needs WAL mode)
- OpenSearch 2.x/3.x (single node; snapshots every 5 minutes: restores go back to a snapshot or a Mark, not to any second)
- Qdrant 1.13+ (single servers; snapshots every 15 minutes, only of the collections that changed: restores go back to a snapshot or a Mark, not to any second)
- Meilisearch 1.12+, Community Edition, on Linux servers (snapshots every 15 minutes when something changed: restores go back to a snapshot or a Mark, not to any second)
Features per database: protocol.EngineCapabilities.
Link it to the dashboard
The dashboard adds every server and database in one place, alerts from outside when a server is down, email, charts, teams and Rowsafe Storage. Free for one server.
sudo rowsafe login
rowsafe login
rowsafe hosts add root@203.0.113.10
Or install on a new server already linked: curl -fsSL https://rowsafe.sh | sudo sh -s -- --account.
Rewind: continuous backups, restore to any second.
rowsafe mark before-drop
rowsafe rewind copy app --at "14:04"
rowsafe rewind compare app
rowsafe rewind rows app public.orders
rowsafe rewind database app --at "14:04"
Proof: a weekly automatic restore test (rowsafe proof app).
Pulse: a 0–100 health score with fixes you apply (rowsafe pulse, rowsafe fix app), slow queries (rowsafe top app), insights and tuning.
Guard: rowsafe mcp, the Claude Code and Codex plugins and the GitHub Action save a Mark before migrations, destructive SQL and deploys. AI agents act as the person who connected them, right away, with exactly that person's rights, like a CLI token; what that person can't do, Rowsafe refuses and says why. Owners can set a monthly budget for agents (Settings → AI agents). Every agent action is in the audit log.
Rowsafe Cloud: PostgreSQL servers Rowsafe runs for you, billed by the hour (never more than the monthly price), with all of the above on from the first minute.
rowsafe cloud sizes
rowsafe cloud create shop-db --wait
rowsafe env --on shop-db
rowsafe connect shop-db
rowsafe cloud allow shop-db 203.0.113.4
rowsafe cloud resize shop-db medium
rowsafe cloud clone shop-db shop-test --at "10m ago" --delete-after 1d
rowsafe cloud passphrase shop-db --file shop-db-passphrase.txt
rowsafe cloud delete shop-db
The first server billed by the hour gives you a link to add a card, once. Database passwords never pass through Rowsafe: rowsafe env makes the password on your computer and sends only its SCRAM verifier, and other passwords are made on the database server and encrypted for your terminal. rowsafe help cloud has the details.
The CLI does what the dashboard does, as the person behind the key and with that person's rights: security (rowsafe security fix app restrict_access --allow 10.0.0.0/16), the server's security updates and reboots, alert rules, logs and log forwarding, the maintenance window, standbys, moves, upgrades and more. Every change asks first on a terminal; scripts and AI agents pass --yes, and --json prints JSON. rowsafe help all lists everything.
Full guide: Quickstart.
What's in this repository
| Path | What it is |
|---|
cmd/rowsafe-agent, internal/agent | The agent: outbound HTTPS only, a fixed set of tasks, no arbitrary commands or SQL. |
cmd/rowsafe, client | The CLI. |
mcp, integrations/ | Guard: the MCP server, Claude Code and Codex plugins, and the GitHub Action (rowsafe/action). |
collect, tune | Monitoring, and settings recommendations. |
pulse, local | The health score and its fixes, and Rowsafe on a connection string (rowsafe pulse postgres://…). |
protocol | API types shared by the agent, the CLI and the control plane. |
internal/pgbackrest, internal/pginspect | PostgreSQL. |
internal/engine | MySQL/MariaDB, MongoDB, ClickHouse, Redis/Valkey, SQLite, Qdrant, Meilisearch. |
scripts/install.sh | The installer served at https://rowsafe.sh. |
scripts/cli.sh | The CLI installer served at https://rowsafe.sh/cli (macOS and Linux). |
integrations/npm | The rowsafe npm package: downloads the release's CLI for the platform (checked against SHA256SUMS) on first run. |
release, cmd/rowsafe-release | Release signing and verification. |
Safety
- Never restarts or changes production on its own. Restarts, fixes, rewinds and settings changes run only when a person confirms them, or when an AI agent they connected asks with their rights (audited; Rowsafe saves a Mark first for risky ones).
- Fixes come from a fixed list and are re-checked on the server right before they run.
- Restore tests and copies are isolated from production and its backups.
- Your data and secrets stay on your server. Backups are encrypted before upload; Rowsafe sees table names and counts, not rows.
- Signed, reproducible releases with automatic rollback. See verifying releases.
- Monitoring is read-only.
ROWSAFE_COLLECT_QUERY_TEXT=false keeps query text on your server; ROWSAFE_MONITORING=false turns it off.
- No usage tracking unless you turn it on. The CLI sends nothing about how you use it by default.
rowsafe telemetry on sends, after each command, its name (cloud create, never its arguments), the CLI version, OS, exit code, a duration range, whether a terminal or an AI agent ran it, whether you're logged in, and a random ID made on this computer. rowsafe telemetry status shows exactly what goes out; rowsafe telemetry off, ROWSAFE_TELEMETRY=0 or DO_NOT_TRACK=1 stop it. The schema is protocol/telemetry.go.
Build
make build. Locally built agents never auto-update.
Contributing and security
CONTRIBUTING.md · docs in rowsafe/docs · report vulnerabilities through security advisories (SECURITY.md).
License
Apache License 2.0. Copyright 2026 Adraa Labs.