Prompt rules are not guardrails
An agent with a database client and a shell can run any statement its login allows. Instructions lower the odds of a bad write; they do not stop one. Cocobox parses and classifies every statement an agent sends through its connections before it runs, and applies the rules in the app, whatever the agent says.
Read-only connections
Tick Read-only when you add a connection and writes to it are always refused, whatever the agent or you ask for. There is no approval to give. Use it for anything you only need to query.

A database copy per agent
Turn it on for a space and each new agent tab gets its own copy of the dev database, Postgres or SQLite. Agents do not clash on data, and a bad write lands in a copy. Cocobox never copies anything named prod. When you close the tab, you choose whether to keep the copy with the archive or drop it.
This is what makes migrations safe to try: the database migration workflow runs a migration up, down and up again on the tab's own copy before anyone opens a pull request.
Writes wait for you, with the exact SQL
Reads run. Anything that is not a pure read stops and shows the exact statement. A single-table UPDATE or DELETE is dry-run first, so the card says how many rows it would change. A delete with no WHERE is critical and needs ⌘⇧⏎, not the key that clears a routine request.

Policy files for your own rules
A policy file adds rules: require a WHERE, cap rows, protect tables. There is a global one and one per project, .cocobox/policy.toml. Agents cannot approve changes to policy files; those always come to you. Share a policy with your team with secrets and paths replaced by placeholders.
Approvals with several agents
When an agent opens tabs of its own, a child's writes to its own database copy go to its parent for approval. Writes outside its copy always come to you. Agent orchestration.
An audit log you can undo from
Every database write and DDL statement is in the Audit panel the moment it is decided: approved, denied, refused by read-only or by policy. Where Cocobox kept the rows a write changed, undo writes them back.

What these guardrails do not cover
They apply to the connections you add in Cocobox. Cocobox does not sandbox an agent's process: an agent runs as you, with the tools its own CLI gives it, so do not hand it production credentials in a shell. Keep production behind a read-only connection, and give agents copies.