OsBrain
OsBrain joins the decisions of the other Os products. It gives each move an agent makes (a database write, a cloud API call, an MCP tool call) one verdict with a reason in plain words, lists every move that waits for you in one place, and keeps one record of every decision. It decides with fixed rules. No AI model takes part in a decision.
- What it protects against
- Set up
- How it works
- What waits for you
- Your rules
- The decision ledger
- The coverage map
- The OsBrain page
- With the other Os products
- Limits
What it protects against
Section titled “What it protects against”- Rules that live in three places. Database rules, API rules and tool rules do not know about each other. One OsBrain rule such as “in production, hold every dangerous move” applies to all three.
- Held moves you do not see. A database change and a cloud API call that both wait for you are in one list, not in two tools.
- A record nobody can check. Every decision is a line in a hash chain whose latest line is sealed in Osevel’s cloud. A removed or rewritten line shows.
- Blind spots. The coverage map lists what agents on this computer can reach without Osevel seeing it.
Set up
Section titled “Set up”OsBrain has no install step of its own. It is part of the CLI and runs as soon as you use OsBase, OsApi or OsBox.
npm i -g @osevel/cli
osevel brain status
status shows how many rules you have, whether the ledger’s chain holds, and how many moves
were held or refused in the files kept.
With the Osevel service installed (daemon mode, see security), the rules and the ledger live in the service’s own folder, out of an agent’s reach. Read and change them through the root-owned launcher:
sudo /opt/osevel/bin/osevel brain status
Without sudo, the commands read the rules and the ledger of runs in your own user’s process.
The service exists on macOS and Linux, not on Windows.
How it works
Section titled “How it works”- An agent makes a move through an Os product.
- The product judges it as it always did. OsBase classifies the SQL and applies your policy. OsApi reads the call against its catalogue. OsBox checks the tool against its pin.
- OsBrain turns that into one shape: the move (product, target, operation, class, environment)
and a verdict:
through,heldorrefused. - OsBrain applies your own rules. A rule can only ask for more:
throughcan becomeheldorrefused,heldcan becomerefused. Nothing a product held or refused is let through. - The product answers the agent. The decision is written to the ledger in the background.
Every move has a class: read, change, danger or unknown. The decision is made on your
computer. The cloud is not on the path.
If your rules cannot be read, every change waits for a person until the file is fixed. If OsBrain cannot judge a database write at all, that write waits for a person too.
What waits for you
Section titled “What waits for you”osevel brain holds
lists every move waiting for a person on this computer, soonest to expire first: calls held by OsApi and the approval requests of every database in your store. Each line gives the command that decides it. Deciding stays with the product, because its own command shows the whole move and asks for a typed code:
- a database change:
osevel approve <id>orosevel deny <id>(see usage); - a cloud API call:
osevel api approve <id>orosevel api deny <id>(see OsApi).
In the dashboard, the Inbox shows both kinds together and you decide with your passkey.
Your answer is written to the ledger: who answered, where (terminal or dashboard), and for a dashboard answer the proof (the digest of the signed statement and the passkey assertion).
Your rules
Section titled “Your rules”List them:
osevel brain rules
Add one. Name at least one condition; a rule that matches every move is refused:
osevel brain rules add --product osapi --class danger --then refuse --note "no deletes through APIs"
| Option | Meaning |
|---|---|
--product |
osbase, osapi, osbox or osvault |
--agent |
An agent’s name |
--environment |
An environment, for example production |
--class |
read, change, danger or unknown |
--operation |
A product’s operation name, for example railway.* |
--then |
hold (the default) or refuse |
--note |
A note for yourself |
Two presets:
osevel brain rules preset production-asks
holds every danger and unknown move in production (name another environment with
--environment). For databases, the labels prod, prd and live count as production.
osevel brain rules preset read-only-agent --agent nightly-bot
refuses every move by that agent that is not a read.
Remove a rule by its id (r1, r2, …):
osevel brain rules remove r1
Adding a rule asks for more, so it needs no code. Removing one asks for less: it needs an interactive terminal and a typed code. Every change is a line in the ledger. A rule applies to the next move.
With the Osevel service installed, run these with sudo /opt/osevel/bin/osevel brain rules ….
Without sudo the command says that it changed only your own user’s runs. Rules are never read
from osevel.yaml, because that file sits in the repository where an agent can edit it.
The decision ledger
Section titled “The decision ledger”The ledger is a file of lines, each carrying the hash of the line before it. It holds operation names, classes, verdicts, reason codes and proofs. It never holds SQL text, request bodies, keys or values.
- Held moves always get their own line.
- Reads that went through are counted in a summary line. In a flood, changes that went through and refusals are counted too.
- Ten closed files are kept.
When the Osevel service runs the dashboard bridge, the latest line (its number and hash) is sealed in Osevel’s cloud every five minutes. The cloud refuses a seal that goes backwards. The ledger is compared with its seal at start and every hour.
Check the chain yourself:
osevel brain verify
It exits with code 4 when the chain is broken. What it proves: nothing was changed by someone who could not also rewrite every line after it. With the seal, lines before the last seal were not changed or removed afterwards.
The coverage map
Section titled “The coverage map”osevel brain coverage
lists what agents on this computer can reach without Osevel seeing it. For each: where it was found and the one step that covers it. It looks at:
- provider keys outside a vault (
.envfiles, shell profiles, the environment, the CLIs’ own sign-in files, git and npm credentials); - other secrets OsVault recognises (Stripe, OpenAI, …) in plain
.envfiles; - services that were reached without a locked key;
- databases without the foreign connection watch.
It never prints a value: a few characters and the length only. It says what it does not look
at: the system keychain, and agents that run in someone else’s cloud. --dir <path> reads
another folder; --json prints JSON.
The OsBrain page
Section titled “The OsBrain page”The dashboard’s home shows an OsBrain card. Its page shows the API calls waiting for you, the ledger’s state (chain, lines, sealed up to), the latest decisions with the rule that asked for more, your answers, and your rules. The rules are read-only there; the page gives the command to change them. The page reads from your personal bridge; a team bridge shows none of it.
With the other Os products
Section titled “With the other Os products”| Product | What OsBrain judges |
|---|---|
| OsBase | Each agent write, before it runs, and each schema change. Reads are not judged. |
| OsApi | Every operation in a call. With several in one call, the strictest verdict stands. |
| OsBox | Each tool call the gateway would forward. |
| OsVault | Nothing. OsVault makes no per-use decision; its own refusals stay its own. |
Limits
Section titled “Limits”- Only what passes through Osevel. An agent that uses its own keys elsewhere is not seen. The coverage map shows where that can happen on this computer.
- A held tool call does not run. OsBox tool calls cannot be approved one by one yet. The agent is told to ask you.
- Rules for one named agent apply to database moves. OsApi and OsBox moves are recorded
under the name
agent, because the run proxy and the box gateway do not know which agent runs them. - Some held moves are refused instead. A rule that would hold an unlisted GraphQL read or an
MCP
tools/listrefuses it, because there is nothing to bind an approval to. - No one command decides everything.
osevel brain holdslists; each product’s own command decides. - Without the Osevel service, the rules and the ledger are in your own folder, which an agent running as you can write. The cloud seal then only shows that something changed after the last seal.
- Nothing is approved for you. A held move waits for a person, then expires.
- Not built: approvals on a phone, and approval routing to a team for OsApi and OsBox moves. Database approvals keep the team rules they already have.
Related: OsBase, OsApi, OsBox, OsVault, security model.