# What is BasaltDB

What BasaltDB does for an agent that writes to your Postgres, and where it stops.

BasaltDB is the action ledger for AI agents on a Postgres you already own. It is not a database. Your data stays in your Postgres, and BasaltDB adds the `basalt_meta` schema, its own roles, and triggers and policies on the tables you guard. `basalt uninstall` removes all of it.

It sits between your agent and your Postgres. Every change the agent makes is saved with the reason the agent gave and the values it replaced. If a whole job goes wrong, you undo that job. Anything your team or your app changed since stays as it is.

## What it does

- **Records every action.** The agent states why it is writing. BasaltDB saves that reason, the statement, the rows it touched and their old values. Reads are recorded too, so you can see what the agent looked at.
- **Applies everyday changes.** An insert or an update of up to 10 rows goes through and can be undone.
- **Holds bigger changes for you.** A write of 11 to 50 rows, or any delete, waits until you approve it.
- **Refuses what an agent should never do.** Dropping or changing tables, running several statements at once, and touching more than 50 rows in one action never run.
- **Undoes a run.** `basalt revert` puts back every row the agent changed. A row someone changed after the agent is left as it is, and you get a list of those rows. See [Undo a run](/guides/undo/).

The full list of rules is on [Rules](/concepts/rules/).

## Where it runs

Two small pieces. The engine runs next to your agent and serves it over MCP. The guard lives inside your Postgres as the `basalt_meta` schema, with its own roles and triggers.

The rules are enforced in Postgres, so they hold on any path. If an agent opens a direct connection with its own credential and tries to write without a reason, Postgres refuses it. See [Architecture](/concepts/architecture/).

## What it does not do

- **It cannot tell that an allowed change is wrong.** A one-row update to the wrong value goes through, is recorded, and can be undone. Nothing stops it first.
- **It keeps old values for 30 days.** After that, undo has nothing to put back.
- **It cannot reach outside your database.** An email already sent or a payment already taken stays sent and taken.

The full list is on [Limits](/limits/). BasaltDB is not built for time-critical or mission-critical systems.

## Who it is for

Solo founders, indie hackers and small teams who run internal tools or back-office data on Supabase, RDS or a Postgres they host themselves, and who want an agent doing real work on that data.

## Cost and licence

BasaltDB is free and released under Apache-2.0. The source is on [GitHub](https://github.com/BasaltDBHq/BasaltDB). BasaltDB runs on your side and does not need a paid service. A bot's engine uses the hosted BasaltVault portal for approval and undo links by default. BasaltVault is the planned paid service for many agents and machines. It is a separate service and is not open yet.

## Next

- [Quickstart](/start/quickstart/): replay an agent's bad run on a sample database and undo it.
- [Install](/start/install/): guard your own tables.
- [Connect an agent](/start/connect-agent/): OpenCode, Claude Code, Codex or a bot.
