# PostgreSQL and AI agents, safely.

> Let AI coding agents work on PostgreSQL 15 to 18 safely: limited roles instead of your password, every row recorded, risky statements held for approval.

Source: https://osevel.com/integrations/postgresql/

Put OsBase, Osevel’s database product, in front of your PostgreSQL database. Agents get limited roles instead of your password; every change is recorded in your own database, risky statements wait for you, and any change can be undone.

## Good to know

- **Tested on PostgreSQL 15 to 18.** The installer and the security tests run against each of the four versions in containers.
- **No superuser needed.** An admin that owns your tables and has CREATEROLE is enough, and preferred: approved schema changes run with its rights.
- **The database enforces it.** Each job has its own role. The agent’s role cannot change the schema, switch triggers off or touch the change log.
- **Schema changes through a gate.** DDL runs only from an approved, single-use, expiring request, and an event trigger cuts an agent off when a risky capability appears.

## Set it up

```sh
# 1. add the change log and the rules to your database
osevel init --project myapp
# 2. give an agent its own key
osevel agent add cursor-main --ide cursor --access write
# 3. read what agents changed
osevel log
```

Pre-release (0.2). Install: `npm i -g @osevel/cli` (the command is `osevel`).

More: [The install guide](https://osevel.com/docs/getting-started/install/)
