# OsBase in depth · Osevel

> OsBase, the Osevel database product, keeps AI agents safe on your data: agents see no values by default, every row is recorded before and after, rules hold risky statements for approval, and a change or a session can be undone.

Source: https://osevel.com/product/

OsBase in depth

## Record. Ask. Undo.

Three things OsBase does for every statement an AI agent sends to your database. Here is how each one works, with the real rules and numbers.

This page is about OsBase, our database product. Keys, cloud API calls, tool setups and memory have their own products: [OsVault](https://osevel.com/products/osvault/), [OsApi](https://osevel.com/products/osapi/), [OsBox](https://osevel.com/products/osbox/) and [OsMemory](https://osevel.com/products/osmemory/). [OsBrain](https://osevel.com/products/osbrain/) decides on database moves, API calls and tool calls in one place.

1 · Record

### Every row, before and after.

When an agent writes, a trigger in your own database keeps each row it touched as it was before and after, with the agent’s name and the statement. Your application’s writes are not recorded.

- The change log lives in your database, not in our cloud.
- Cascades count: rows changed through foreign keys are kept too.
- Undo is itself recorded, so it can be undone.

2 · Ask

### Rules decide, in order. The first match wins.

These are the rules a fresh install starts with. Pick a statement and watch it go down the list. You can add, change or remove rules, per table and per operation.

1. 10 Opaque code: a DO block or a procedure CALL asks a person
2. 20 UPDATE or DELETE without a WHERE clause asks a person
3. 30 Every schema change asks a person
4. 35 Writes that take this session above 1,000 rows in 10 minutes asks a person
5. 36 Writes that take all agents together above 3,000 rows in 10 minutes asks a person
6. 40 Data writes affecting more than 100 rows asks a person
7. 50 Other data writes (at most 100 rows) runs
8. 60 Reads runs

Floors no rule can lower: forbidden statements are refused, and statements that cannot be undone, or that create code running with another role’s rights, always need approval.

#### Volume limits, on a log scale

Above each line a person is asked. Row counts include rows changed through cascades.

#### What an approval is

3 · Undo

### One change, or a whole agent session.

Undo always shows its plan first. It reverses the agent’s steps, latest first, and leaves alone anything that is no longer the agent’s.

- Agent inserted `1045 · Ada Kaya · paid` deleted again
- Agent deleted `1043 · Aiko Brandt · paid` inserted back
- Agent updated `1042 · status refunded` restored to shipped

#### When a step is skipped

- **`row_missing`**: The row no longer exists.
- **`row_modified`**: The row changed after the agent inserted it, so it is not deleted.
- **`columns_modified`**: Someone changed these columns after the agent; they are not restored.
- **`key_taken`**: A row with this key exists again, so the deleted row is not re-inserted.
- **`schema_drift`**: The table or column changed since.

By default the other steps still apply and the result says “partial”; with `--strict` nothing applies if any step conflicts. Sequence values and irreversible schema changes cannot be undone, which is why such statements always ask first.

Access

### Each agent sees only the tools of its level.

Every agent has its own key and one of three levels. Tools above the level are neither listed nor callable, and no tool approves, denies, undoes or edits the rules.

read

`inspect` `performance` `get_schema` `find_tables` `list_changes` `status`

write

adds `execute` `rehearse` `backfill`

schema

adds `migrate`

Raising a level needs a typed confirmation at the terminal; the dashboard can only lower it or revoke the key, at once.

Sight New in the CLI 0.2.0

### What an agent may see is a setting of its own.

Every column has a class: open, coarse, masked or hidden. A new agent sees the shape of the data and no values. Your database enforces it: the agent's login cannot read, filter on or return a private column, and its errors are rebuilt without values.

structure

tables, columns, keys, plans

shape (default)

counts and yes/no answers, no values

masked

rows, private columns as stand-ins

clear

real values of named columns, for minutes, after a person allows

A reveal is asked for by the agent and given by a person: named columns, at most 15 minutes on production, a row budget, every read logged without its values. Secrets are never revealed. Where several agents share one database role, the database holds the highest level any of them has and osevel holds each agent's own.

Together New in the CLI 0.2.0

### Agents that know about each other, and learn.

Agents on one database see who else is working and which of their changes wait for you. One can hand work to another; the other reads it as an agent's words, never as yours, and it grants nothing. People accept notes that every later agent reads.

- **Handoffs**: at most 20 an hour, inside one database; you switch them off per agent.
- **Notes and lessons**: agents propose, you accept; a denial can leave a lesson.
- **Rehearsal**: a write runs and rolls back first, so the agent sees the rows and your rules' verdict before it asks.
- **Keepers**: a local agent without a model checks the database every day and proposes fixes; it applies nothing.

[Start free](https://app.osevel.com/) [OsBase](https://osevel.com/products/osbase/) [How it works](https://osevel.com/how-it-works/)
