# Red-team findings

> What independent reviews and red teams found in OsBase, OsVault, OsApi, OsBox, OsMemory and OsBrain, finding by finding, and what was fixed.

Source: https://osevel.com/docs/security/red-team-findings/

What independent reviews and red teams found in each Osevel product, and what was fixed. The
security model is in [security.md](https://osevel.com/docs/security/model/).

- **OsBase (the database core):** the four-round red team below, from
  [How the attacks were run](#how-the-attacks-were-run) to [Test suite](#test-suite).
- **The other products:** [OsVault](#osvault), [OsApi](#osapi), [OsBox](#osbox),
  [OsMemory](#osmemory) and [OsBrain](#osbrain), under
  [Reviews of the other products](#reviews-of-the-other-products).

## OsBase: the database core

This is an independent red-team review of the database core. It ran in four rounds on
2026-11-17. Each round re-ran every earlier attack against the reworked code and then attacked
the new mechanisms.

### How the attacks were run

- Attacks use only the agent's own interface: the MCP tools.
- Human steps are modelled exactly as the CLI performs them:
  - approvals go through `PgApproverStore` on an approver-role connection, channel `cli`;
  - accepting a risk means re-installing with `acceptRisks`;
  - undo runs `planUndo` / `applyUndo` on undo, migrator and approver connections.
- Labels in test names:
  - "[social engineering]": a human approves or accepts something plausible.
  - "[credential: …]": one login role's password has leaked.

### How results are recorded

- Every attack is a test in `e2e/adversarial/`.
- An attack that still succeeds is kept as an expected failure (`knownBreak`). Such a test passes
  only when the final security-property check fails. A broken precondition or harness error turns
  it red instead.
- Every open finding was reproduced in two separate runs.
- The images:
  - plain `postgres:15/16/17-alpine`, where the admin is a superuser;
  - `supabase/postgres:15.19.0.019` and `17.11.0.019`, where the admin is `postgres`, not a
    superuser.

**Note (after round 4, dashboard foundation WP0-A):** a sixth login role, `<prefix>_remote`,
now exists for the planned dashboard bridge. It reads the journal and decides approvals only
through the `dashboard` channel (deny any pending request, approve only requests that are not
terminal-only); it has no privilege on user tables, cannot insert or consume approvals and
cannot run DDL. The approver now decides only through `cli`. Its attacks are in
`e2e/adversarial/claims/dashboard-db.ts`; the rounds below predate it and their numbers and
finding statuses are unchanged.

## Headline numbers

| Scenarios (unique attacks, each a test)                                         | Round 1 | Round 2 | Round 3 | Round 4 (final) |
| ------------------------------------------------------------------------------- | ------- | ------- | ------- | --------------- |
| Tried                                                                           | 77      | 91      | 100     | 104             |
| Held, stopped by the database (alone or with the proxy)                         | 29      | 38      | 46      | 53              |
| Held, stopped only by the proxy / executor / undo engine (database would allow) | 23      | 37      | 42      | 42              |
| Succeeded on at least one image (expected-failure tests)                        | 25      | 16      | 12      | 9               |
| Distinct open findings                                                          | 20      | 14      | 12      | 9               |

Final adversarial run: 490 tests on 5 images plus the stdio child process. All green, with the
9 documented expected failures.

None of the 9 open findings lets the agent reach the network, server files or the journal's
decision tables without a human first approving or accepting something. Six of them are
accepted limitations.

## Status of every finding

Each row gives the finding, its status, and how it was verified.

**F-01: DO blocks were trial-run before approval; Supabase extensions and network.** Fixed (r2).
DO returns `approval_required` and `requires_terminal`. After approval, the DDL guard refuses
CREATE EXTENSION, supautils included.

**F-02: search_path shadowing ran agent code as the journal role during undo.** Fixed (r2).
Role split and pinned search_path: the shadowing function is never called.

**F-03: pg_net enabled after install.** Fixed (r3, r4). Enabling it cuts the agent off at once
(NOLOGIN, privileges revoked, sessions terminated). MCP returns `database_access_disabled` and no
request is queued.

**F-04: timeout bypass.** Fixed (r2). The client-side deadline stops it.

**F-05: backend termination crashed the server.** Fixed (r2). The stdio child survives.

**F-06: a huge value was buffered whole.** Fixed (r2). The receive ceiling stops it.

**F-07: FK cascades into unmanaged tables were unjournaled.** Fixed (r2). Cascaded rows are
captured, counted and undone.

**F-08: inheritance children.** Writes are fixed (r2). The read leak is open and accepted (Low):
child rows in another schema are readable through the managed parent.

**F-09: approvals bound counts, not rows.** Fixed for updates and deletes (r3). Renaming rows and
swapping keys both require a new approval. Inserts: see F-27.

**F-10: DDL outside the managed schemas.** Fixed (r2). Refused even after approval.

**F-11: deferred triggers.** Fixed (r2). Their work is measured before policy decides.

**F-12: approved SECURITY DEFINER code.** Mitigated (r4); the residual is accepted. An approved
definer function now cuts the agent off (an unaccepted `security_definer_functions` item). After
the human accepts it by re-installing with `acceptRisks`, it reads `private.secret` with the
admin's rights.

**F-13: writes outside the managed schemas through built-ins.** pgsodium is fixed (r3). Large
objects are accepted (doctor warning): `lo_from_bytea` still commits.

**F-14: `pg_notify` reaches application listeners.** Accepted (doctor warning). Still delivered.

**F-15: ABA overwrite during undo.** Accepted limitation. Still reproduces.

**F-16: guard tag in a column name blocked undo.** Fixed (r2).

**F-17: migrator credential bypassed the journal.** Mitigated (r2). The run is recorded in
`gate_log` and `reconcile` records it as a change; it is still not undoable.

**F-18: journal statistics readable.** Accepted (documented). Still visible.

**F-19: raw rows in `structuredContent`.** Fixed (r2).

**F-20: batching under the thresholds.** Fixed (r3). At most 1000 rows per session and 3000 per
project in 10 minutes without approval.

**F-21: a user `CAST … AS json` called by the capture trigger.** Fixed (r2, `row_image`). The cast
is not called.

**F-22: trigger code fired during undo.** Journal tampering is fixed (r3): the undo aborts with
`journal_tampering`. Reading and leaking the journal is open (Medium, needs one approval):
sequence-channel leak reproduced.

**F-23: capabilities appearing after install.** Fixed (r3, r4):

- immediate DB cut-off;
- reads refused (`database_access_disabled`);
- raw agent login refused (`28000`);
- access returns only through removal or acceptance, plus `sync`.

**F-24: SECURITY DEFINER wrappers around network functions.** Fixed (r4). A wrapper created while
serving cuts the agent off, and a new executor refuses to start.

**F-25: rules and definer triggers outside the closure.** Fixed (r3 rules, r4 definer triggers).
A write rule or an unaccepted definer trigger revokes agent writes on the table, including a
definer trigger on a closure table in another schema.

**F-26: `ALTER ROLE` on itself (agent credential).** Mitigated (r3). It still succeeds, but
`verify` refuses the next executor start.

**F-27: approved INSERT … SELECT is bound by count only.** Open, Low–Medium, needs one approval.
Reproduced.

**F-28: undo made incomplete by a planted row.** Not a finding. The undo reports `partial` with a
`key_taken` conflict, and the human was warned beforehand.

**F-29: foreign tables readable through PUBLIC.** Fixed (r4). The agent is cut off, also when the
foreign table is behind two views and the inner view is owned by another role.

**F-30 (new, r4): a definer function's fingerprint does not cover the functions it calls.** Fixed
(after r4, in the database layer). Any schema change executed through the approval gate re-opens
every accepted SECURITY DEFINER item and cuts the agent off until the human re-accepts them. The
attack in `claims/round4.ts` now holds. Changes made outside osevel to code an accepted
function calls remain undetected and are the application owner's responsibility.

**F-31 (new, r4): an approved definer trigger blocks undo of earlier changes.** Open, Low, needs
one approval. Reproduced.

## Open findings

### F-30 (Medium, fixed after round 4): accepted SECURITY DEFINER functions can change behaviour through their callees

**Status: fixed.** Any DDL executed through the approval gate while SECURITY DEFINER items are
accepted drops those acceptances (`install_settings.definer_reopened` records why) and, in the
same transaction, cuts the agent off (functions) or revokes its writes on the affected tables
(triggers) until a human re-accepts them at install. Schema undo runs through the gate as well and
re-opens them too. The test in `claims/round4.ts` is now a passing attack (`[was F-30]`). Not
detected, and the application owner's responsibility: changes made outside osevel (by the
application's own roles or the admin) to code or objects an accepted function or trigger uses.
The original reproduction is kept below for reference.

**Reproduction, on all images [social engineering]:**

1. The application has a SECURITY DEFINER function `public.report()` that returns
   `public.helper()`. `helper()` is an ordinary SECURITY INVOKER function.
2. The human reviews `report()` and accepts it (`acceptRisks: ['security_definer_functions']`).
3. Later the agent gets `CREATE OR REPLACE FUNCTION public.helper()` approved. To a reviewer it
   looks harmless: it is an invoker function. Its new body reads `private.secret` through dynamic
   SQL.
4. `query: SELECT public.report()` now returns the secret, with the admin's rights. There is no
   new item and no cut-off.

Test: `claims/round4.ts`.

**Why:** the item identity is `schema.name(args)#md5(body | settings | owner)` of the definer
function itself. Anything it calls or reads (functions, views, tables holding dynamic SQL or
names) can change its behaviour without changing its fingerprint.

**Fix:**

- Treat CREATE OR REPLACE / ALTER of any function as a capability change that re-opens every
  accepted definer item whose body names that function.
- More robust: show at approval time that a statement modifies a function called by an accepted
  definer function.
- Otherwise document that accepting a definer function accepts its whole call graph and the data
  it reads.

### F-22 residual (Medium, needs one approval): undo-time trigger code reads and leaks the journal

An approved trigger on a managed table fires as the undo role during undo. It can:

- read `agent_reverse.row_log`, including images of other schemas and other sessions;
- encode what it read in a channel that rollback does not undo. The test advances a sequence by
  `1000 + n`, and the agent recovers `n`.

Changes to `changes` or `ddl_log` are detected and roll the undo back. The plan and the report
warn about triggers before the human confirms.

Test: `claims/new-design.ts`.

**Fix:** separate the undo writer, which has user-table rights and no journal read, from a
journal reader. Otherwise keep this as an accepted limitation; it is already in the undo warning.

### F-27 (Low–Medium, needs one approval): approved INSERT … SELECT is bound by count only

1. The human approves `INSERT INTO public.parents SELECT id, name FROM public.items WHERE id >= 1000`
   (101 rows).
2. The agent rewrites the source rows to `'EVIL'` with two allowed 50-row updates.
3. The approved run inserts 101 `'EVIL'` rows.

At approval time the human sees the SQL, "101 inserted into public.parents", the undo class and
the policy reason. No row contents are shown, for any statement. Inserts are deliberately bound
by count only, so that sequences and volatile defaults keep working.

Test: `claims/round3.ts`.

**Fix (optional):** bind the inserted images when the statement has no volatile parts.

### F-31 (Low, needs one approval): an approved definer trigger blocks undo of earlier changes

1. The agent deletes a row.
2. It then gets an innocuous SECURITY DEFINER trigger on the same table approved.
3. The unaccepted trigger revokes the undo role's writes on that table, so the human's undo of the
   earlier delete aborts.

The trigger is accepted by name, after which undo works again. This is a denial of service on
undo, fail-closed and visible.

Test: `claims/round4.ts`.

**Fix:** say at approval time that an unaccepted definer trigger will block writes and undo on the
table. Or let undo run on that table without firing the trigger, which is not possible without
superuser rights.

### Accepted limitations (Low / informational)

- **F-08:** the read leak through inheritance children.
- **F-12:** accepted definer functions run with the admin's rights.
- **F-13:** large objects.
- **F-14:** `pg_notify`.
- **F-15:** ABA during undo.
- **F-18:** journal statistics.

## Round-4 attacks that failed, and reasoning

These were tested and held:

- a definer trigger on a closure table in another schema;
- a foreign table behind nested views owned by another role;
- a raw agent login after a cut-off (`28000`);
- the agent triggering a cut-off itself through an approved non-definer function (no cut-off);
- lifting the cut-off or running `sync` with any login-role credential.

These were reasoned about but not tested:

- **The same-transaction self-lifting cut-off.** Only the application, the admin or the gate run
  DDL; the agent's own DDL is refused by the guard. A migration statement through `migrate` is
  one statement, so it cannot create and then drop a capability around agent work. The agent is
  not inside that transaction either.
- **The commit-time window before NOLOGIN.** The cut-off terminates agent sessions inside the
  revoking transaction. A session that logs in before that transaction commits survives, but has
  no table privileges after the commit. The executor's per-statement check (at most 1 s stale)
  then refuses everything. What remains is a credential-only window to call PUBLIC functions;
  this was not timed.

## Guarantees that hold only at the proxy

These hold through the MCP tools but not on a direct connection with the agent-role password:

- approval of data writes;
- policy thresholds, the per-session and project volume rules, and the unqualified-write and
  opaque-code rules;
- the rows digest that binds approvals to rows;
- bounded reads: row/byte caps, the receive ceiling and the client-side deadline (a raw
  connection can `SET statement_timeout = 0`);
- `query` being read-only;
- the planner's checks: "expressions need a human" and the managed-schema scope of DDL;
- the undo tamper check, which lives in the undo engine;
- session hygiene, output escaping and credential scrubbing.

The database enforces even against the raw agent credential:

- no journal access;
- no DDL of any kind (the event-trigger guard) and no TRUNCATE;
- no writes outside managed tables and their capture closure;
- capture of every row the agent changes there;
- no role switching, no server-file functions, no extension creation (supautils included);
- when a risky capability appears: the cut-off, meaning NOLOGIN, all managed-table privileges
  revoked and sessions terminated.

## What only a human approval protects against

- **The code of approved functions, triggers, views and DO blocks.** An accepted SECURITY DEFINER
  function runs with the admin's rights, and so do the functions it calls and the data it reads
  (F-12, F-30). Triggers also run during undo, with the undo role's read access (F-22).
- **The content of approved inserts** (F-27).
- **Unqualified writes and opaque statements.** They are approved without a measured impact, so
  the approval binds only the SQL text.
- **Accepting a capability risk** (`acceptRisks`). This is a standing decision: the agent may use
  that capability from then on.

## What osevel does not protect against

This section is written to be copied into user-facing documentation.

osevel records, gates and can undo what an AI agent does through its MCP server. It does
not make an agent safe in every respect.

- **Your own database objects keep their own rights.** osevel stops the agent when it
  finds SECURITY DEFINER functions or triggers, foreign tables, or network or file capabilities
  the agent could use, until you remove them or accept them. Once you accept them, the agent can
  use them, and their effects outside the managed tables are neither journaled nor undoable.
  Accepting a SECURITY DEFINER function also accepts whatever it calls or reads.
- **Approvals are only as good as the review.** Approved functions, triggers, views and code
  blocks are the agent's code running with the rights you gave them, including later during undo.
  An approved insert is bound to its row count, not its content. Unqualified writes and code
  blocks are approved without a measured impact.
- **Undo is best effort.**
  - It restores what the agent changed when nobody else has touched the same values since.
  - It cannot tell that another writer later stored the same value (ABA).
  - It reports conflicts instead of overwriting.
  - Triggers that run during undo may read the change journal.
- **Not everything is a table row.** Large objects, `pg_notify` messages and consumed sequence
  values are not undone.
- **Credentials.** With the agent role's password, the policy, approvals, volume limits and read
  limits are gone. The database still prevents DDL, journal access and writes outside the managed
  tables, and still captures every row the agent changes.
- **Local shell access.** An agent with shell access as the same OS user can read local secrets
  unless osevel runs as another user or in a container.
- **Metadata.** For example, journal table statistics are visible to the agent.

## Not tested

- Volume-rule window edges (waiting 10 minutes).
- Capabilities granted through shared-object commands (`GRANT <role> TO <agent role>`), catalog
  edits by a superuser, or a disabled event trigger. All need admin rights.
- The exact commit-time window before NOLOGIN.
- INSTEAD OF triggers on views over managed tables. The agent has no grants on views.
- Data-driven behaviour of accepted definer functions, for example dynamic SQL read from a table
  the agent can write. This is the same class as F-30.
- Hosted Supabase, egress beyond loopback, and the CLI binary itself. Human steps use the package
  functions the CLI calls.
- Journal, approver and admin credential compromise.

## Release recommendation

There are no remaining fix-first items that the agent can exploit without human involvement.

Fix first:

1. **F-30.** Done: any schema change through the approval gate re-opens accepted definer items
   and cuts the agent off until they are re-accepted (see F-30 above).

Document as accepted limitations:

- F-22 (read-and-leak, already warned at undo time)
- F-27
- F-31
- F-08, F-12, F-13, F-14, F-15, F-18
- the proxy-only list above

## Test suite

`e2e/adversarial/` contains:

- `postgres-15|16|17.test.ts` and `supabase-15|17.test.ts`: the full suite per image (`suite.ts`).
- `claims/*.ts`: one file per claim. Later rounds are in `new-design.ts` (r2), `round3.ts` and
  `round4.ts`. `supabase.ts` installs into the image's real `postgres` database.
- `stdio-crash.test.ts`: runs the stdio server as a child process and needs `pnpm build`.
- `verdict.ts`: provides `attack()` and `knownBreak()`.
- Fixed findings keep their test as `attack()`, with `[was F-xx]` in the name.
- Setting `AR_ADV_LOG=<file>` records why each expected failure failed.

## Reviews of the other products

OsVault, OsApi, OsBox, OsMemory and OsBrain were built in stages in November 2026. After each
stage an independent reviewer attacked the code, and OsApi and OsBrain each ended with a red team
of the whole path.

- Every finding that was fixed has a regression test next to the code it concerns.
- The findings are listed by product and stage, with the severity where the review gave one.
- "Still open" lists what the reviews found and what was not fixed. These are also in
  [limitations.md](https://osevel.com/docs/reference/limitations/) and [security.md](https://osevel.com/docs/security/model/).
- These reviews used pretend services, a real cloud on a local stack and real browsers. They did
  not use real provider accounts.

### OsVault

**Core (two reviews, 29 findings, all fixed).** The ones that changed behaviour:

- **Masking leaked.** A program that printed `[vault:` itself could pull a value out in clear,
  and overlapping values left a remainder. Fixed: all matches are merged first, and only a real
  partial match is held back.
- **One key, two values.** The commitment fixed the key but not the ciphertext, so an editor
  could show members different values. Fixed: opening requires the box the log recorded.
- **Server-chosen salt.** A cloud handing everyone one salt could attack all passwords at once.
  Fixed: the salt mixes in the address on the device; Argon2id parameters are capped.
- **A removed manager kept access** through a token they had issued. Fixed: their tokens are
  revoked and their invites closed on removal.
- **Freshness could be faked** with a record dated far ahead. Fixed: record times may not go back
  or run ahead of the verifier's clock.
- **A cloud could start another log** under the same vault id. Fixed: the id is derived from the
  first record.

**Cloud store (13 findings, all fixed).**

- **A leaked invite link made a stranger a permanent reader.** Fixed: joining makes nobody a
  reader until a member compares a code and adds them; a wrong joiner can be turned away for
  good.
- **Time limits could be dodged by backdating.** Fixed: a record must be dated within five
  minutes of the cloud's clock.
- **A stolen session could lock the owner out** by swapping the password box. Fixed: a new box
  needs a proof signed with the account key; first set-up needs a recent sign-in.
- **Every append replayed the whole log,** and a stranger could force it. Fixed: the verified
  state is cached, with per-vault limits.

**Sign-in (12 findings, all fixed).** A session could fetch the recovery box and skip the wait;
older panels could still send the raw password; the salt answer told known addresses from
unknown ones; a sign-up with someone else's address signed that person in. Fixed: the recovery
box is released only by recovery itself, a password field that is not a proof is refused, every
address gets the same answer, and confirming an address no longer signs in.

**Vaults in the panel (12 findings, then 5).**

- **Serious: the cloud could list someone else's vault to a victim,** whose browser would save
  secrets into it for the attacker to read. Fixed with pins: a vault is trusted only through a
  pin signed with the person's own account key. The cloud stores pins but cannot make one.
- Also fixed: the browser remembers the last verified head per vault (rollback), full checks of
  a wrap before opening, hidden characters refused in vault names.

**Sharing (7 findings).** With a leaked link and a dishonest cloud, the code check needed a step
of its own; added. Two smaller findings were left for later.

**Recovery (8 findings) and new account keys (7 findings).**

- **Critical: a malformed token could skip the waiting step of a reset.** Fixed: the token is
  taken exactly as the sign-in library takes it; two or empty tokens are refused. (Password
  resets by email no longer wait at all, by a later decision; the Vault recovery wait stays.)
- A stolen session alone could overwrite the key boxes at the end of a recovery. Fixed: ending a
  recovery needs the proofs and the code.
- A key change only re-wrapped the same environment keys, which the old keys still opened.
  Fixed: environments get new keys on a swap.

**Linking a computer (8 findings).**

- **Critical: the cloud could search for a matching code.** It saw the browser's nonce before it
  was bound to the computer's keys. Fixed: the address the computer prints carries its
  commitment, and the browser refuses a claim answered with another.
- Another member could link your computer and hand it keys of their choosing. Fixed: a computer
  accepts only links made by its own account.

**Platforms (9 findings, the real ones fixed).** A key store that could not be read counted as
"no keys yet" and could be replaced. Fixed: only `vault connect` makes keys; `vault list` fails
instead.

**Runs (11 findings).** The encryption path held up against a dishonest cloud. Fixed: a timeout
ends the command's whole process group; a value cut short when the command stops is masked too;
on Windows, names are compared without case; without `--env` a run uses only `development`; a
masker failure always withholds the output.

**Locked keys (one critical finding).**

- **Critical: the command could open its parent's inspector** (`kill -USR1`) and read every
  value. Fixed: the process that holds values restarts itself without the inspector, preloads
  or `NODE_OPTIONS`.
- Also fixed: answer headers and compressed answers are masked; absolute request targets are
  refused; a stand-in is replaced once per request and only where a credential goes; tunnels are
  checked against the computer's own addresses after the name is resolved.

**The service mode.** No path was found for a locked key to reach the user's side. Fixed: link
take-over and lost-token cases, idle connections and unbounded lines, a cap on runs, local
tunnels. From the OsApi red team: the service's link could be dropped with the user's local
token, and an agent could make the service look absent through `PATH` or `OSEVEL_SOCKET`. Fixed:
only `sudo … vault forget --service` drops the link, and the service is found by absolute paths
with the socket's owner checked.

**Still open.** A hostile panel page can take the password. A browser that has never opened a
vault cannot notice a rolled-back log. An agent that changes the person's shell profile, or runs
its own copy of the CLI, can start a link with keys it holds; the panel cannot yet show that a
link's keys are held by the service. A value split between stdout and stderr is not masked.

### OsApi

Six independent reviews and a red team of the whole path. No way was found to get a dangerous
call through in enforce mode with the Osevel service.

**The run proxy (9 findings).**

- Records could be erased by a flood and broke their chain when runs overlapped. Fixed: one
  shared writer, a lock, ten files kept, a per-minute cap for forwarded calls.
- Up to 32 MiB was buffered per call without a limit on parallel calls. Fixed: about 1 MiB is
  read, 32 calls at once.
- The guard saw headers that are removed before forwarding. Fixed: it sees the forwarded headers.
- The held answer promised an approval that did not exist yet. Fixed.

**The catalogue (20 findings, the safety ones fixed).** Unlisted reads that return secrets
(Supabase JWT secret, Vercel bypass secrets, a Neon OAuth client); changes that turn protection
off (Supabase auth settings, Vercel protection, Render IP allow lists); broad MCP write prefixes
(`create_*`, `update_*`). Fixed: these are listed as dangerous, and prefixes were replaced by
exact names so that future tools are held.

**The policy (5 findings, all fixed).** The production-deploys preset missed some deployment
operations and code pushes; an ask for one environment did not beat an allow without one; the
commands silently changed the user's own policy while the service was installed; an unreadable
file dropped the person's asks. Fixed: asking always wins, the commands say which policy they
changed, and an unreadable file makes everything ask.

**The scan (8 findings, all fixed).** A large folder was cut silently and reported clean; some
key spellings and CLI locations were missed. No key leaked.

**The panel page (6 findings).** No secret or body reached the panel. Fixed: reasons could carry
request text or local paths (not sent now); rules of several computers were merged unlabelled.

**Red team of the whole path (daemon mode).** No way was found to run a held call without
approval. Fixed:

- The production-deploys preset missed commits through the git data API, branch moves and
  merges.
- A run could fill everyone's waiting list. Fixed: calls without a locked key are refused, ten
  held per run.
- A flood of reads could keep a held delete out of the records. Fixed: decisions are never
  capped.
- Extra messages could ride along on an approved MCP call. Fixed.
- **Root commands ran through the user's `PATH`,** which an agent can change. Fixed:
  `daemon install` writes a root-owned launcher, `/opt/osevel/bin/osevel`, and every root run
  refuses a node binary or package that anyone but root can change.

**Still open.** An agent that rewrites the shell profile can fake `sudo` itself in that shell;
the panel's passkey does not depend on the shell. The company proxy chosen for a run is not
checked against local addresses (keys do not leak: the provider's certificate is checked).
Without the Osevel service, enforcement is not a control against the agent.

### OsBox

**Core.** The review found no way around acceptances or names. Fixed: secrets inside spec
values, lockfile fields, a registry prefix, the first tool list being unsigned, JSON numbers and
duplicate keys.

**On the computer and in the panel.**

- **Without the Osevel service, a program running as the user could get a server accepted,**
  because the box key and the link file are the user's files. The first description overstated
  this ("an agent cannot accept"). Reduced: a link file that does not verify is refused instead
  of meaning "not linked"; the code window is started by absolute paths; a removed list pin holds
  everything; installs are pinned file by file. The boundary came with the service mode; without
  it, acceptances are stated as advisory.

**The service mode.**

- **Critical: `remove` took any text as a name,** so `../..` deleted the service's whole store.
  Fixed: names must be server names in the box.
- **High: a reinstall could replace an accepted command's copy between the check and the
  start.** Fixed: installs are content-addressed and never overwritten.
- **High: the service recorded first tool lists sent by the user's side as accepted.** Fixed: the
  service makes the pin itself and holds every item until the person accepts in the panel.
- **High: shared installs would have been unreadable** under the service's umask. Fixed.
- Also fixed: with the service installed, a missing token is an error instead of a fall back to
  the user's folder.

**Sealed requests.** The review confirmed that the cloud cannot read a box or forge an
acceptance.

- **Replay:** the cloud could have answered a new request with an old sealed answer. Fixed: a
  fresh nonce inside the sealed request.
- **Forged requests:** anyone could seal a request that looked like a computer's. Fixed: the
  computer signs what it asks; the panel verifies before showing anything.
- Sizes are padded; labels come from inside the box, not from the cloud.

**The sandbox (macOS, probes run under the generated profile).**

- **High: native code and system services.** A server could copy a library into its temporary
  folder and load it, and every system service was reachable. Fixed: native code loads only from
  the system, the runtime and the server's own install; system services are a short list.
- Folders holding every home or the system are refused in specs; a declared path that resolves
  to the home folder or above is refused at start.
- The allowlist proxy refuses loopback and private addresses unless declared (no DNS rebinding).
- **Linux:** bubblewrap could only share the whole network. Fixed by failing closed: a sandboxed
  server with hosts is refused there.

**Still open.** Without the service (always on Windows), acceptances are advisory. No revocation
of an old acceptance. The tools' config files and the gateway are the user's. A file's existence
and size can be learned inside the sandbox. No sandbox on Windows.

### OsMemory

**Core and the computer.**

- **High: parallel calls broke a scope for good.** Fixed: one writer at a time, in the process
  and across processes.
- **High: a note could close the untrusted-data block.** Fixed: angle brackets are escaped.
- Unicode tricks (soft hyphens, look-alike letters) passed the checks. Fixed: invisible
  characters and words mixing alphabets are held.
- Keys split by spaces or escaped passed the secret scan. Fixed: also looked for with spaces
  removed and escapes undone (best effort).

**The panel.**

- **High: the cloud could hand over a key it made itself.** Fixed: the maker signs the key; the
  panel and the computers use a scope key only with such a signature.
- **High: an agent chose its records' time** and could date notes into the past, around the
  day's limit. Fixed: a record's time is moved up to the one before it; one dated more than 10
  minutes ahead is refused.

**The service.**

- **High: the OsVault comparison was a yes/no oracle.** Fixed by bounding guesses: after 5
  matches a day the service takes no notes on that computer until the next day; each match is
  logged for the person.
- **High: linking a folder had no person's step in the service.** Reduced: a folder whose own
  memory has notes is no longer pointed at another project.

**Import.**

- **High: the service import could be used to guess OsVault values** with nothing written.
  Fixed: matches count toward the day's 5; the caller is not told how many matched.
- **High: links and private keys.** A repository's `CLAUDE.md` linked to `~/.ssh/…` would have
  been read. Fixed: files are opened without following a link and must lie inside the project; a
  file with any secret in it is left out whole.

**Team memory.**

- **High: notes were lost when someone left.** Fixed.
- **High: notes flipped between kept and waiting** as people joined or left. Fixed: a note is
  kept only by a decision.
- One member could block another's computers, or move everyone to a new, empty memory. Fixed.

**Still open.** Paraphrased instructions pass the checks. An agent of the same user can read any
project's notes by starting a session in its folder. A new reader can be served a log cut short.
A member who left keeps what they read. An agent's tool and computer labels are not proven.

### OsBrain

**The core (8 findings).** No way was found to let more through than a product decided. Fixed:
agent rules could be dodged by case, spaces or zero-width marks; `DO`/`CALL` code was classed as
an everyday change and slipped past the production preset; unknown OsApi classes became reads;
`railway.*` did not match `railway`.

**The ledger (9 findings).** No path was found where OsApi became looser. Fixed: a schema change
held by a rule could be auto-approved after its impact grew (now judged again); a line cut by a
crash stopped the ledger for good; GraphQL field names could reach the ledger; the executor kept
the policy decision when OsBrain failed (now it waits for a person).

**Red team of the whole path (8 findings, all fixed).**

- **High: a rule on one OsApi operation was dodged by batching it with another** in one GraphQL
  or MCP call. Fixed: every operation of a call is judged, and the strictest stands.
- A flood of refusals or changes could push held moves and answers out of the files kept. Fixed:
  above 120 a minute per product they are counted in a summary line; held moves always get their
  own line.
- The production preset never applied to databases. Fixed: the database's environment label is
  passed (`prod`, `prd` and `live` count as `production`).
- Watch mode recorded "refused" for a call that was sent. Fixed.
- Proofs held the signed statement, whose text can carry request data. Fixed: the statement's
  digest and the signatures only.
- A held decision could not be tied to its answer. Fixed.
- The page and the hourly check re-hashed the whole ledger every time. Fixed.
- Lines that could not be written were forgotten on restart. Fixed.

**Still open.** OsApi and OsBox moves are recorded under the agent name `agent`, so rules for a
named agent match database moves only. OsVault makes no per-use decision to judge. Without the
Osevel service, the rules and the ledger are in the user's own folder, which the agent can write.
