Approval gates
An approval gate stops an action until a person decides. It is enforced by the platform, not by asking the AI nicely: an agent that ignores its instructions still cannot get past it.
Four layers, one place to decide
Section titled “Four layers, one place to decide”-
A rule’s own approval flag. An automation action (an email, an outbound API call) can require approval, and some default to it.
-
An agent’s approval policy. The owner of an agent can have its proposed writes wait for approval. This is a setting on that one agent — an owner who forgets to set it gets no gate. Its delete entry also holds the direct deletes of an agent running on a Runner (below).
-
A workspace-declared gate over an action class. An admin says “deleting records needs approval”, in one place, for everything that isn’t a person at the keyboard. It applies whatever any individual agent’s own policy says.
-
A gate on one agent’s record writes. An admin says “this agent’s creates and updates need approval”, optionally for one database and named fields. See Gating an agent’s record writes.
All four land in the same Inbox, as the same kind of approval — there is one place to look, not a screen per mechanism.
Declaring a gate (workspace admins)
Section titled “Declaring a gate (workspace admins)”A gate is a policy: an action class (today delete_records), a scope, and a named
approver.
- Scope is workspace, space or database, and the most specific one wins — a database’s policy beats its space’s, which beats the workspace’s. You can gate one database tightly and leave the rest alone.
- The approver is a named person, notified when something is held. A policy can be switched off and on without deleting it.
- Admin-only, and API-only today.
POST /api/v1/workspaces/{ws}/action-gateswith{ action_class, space_id?, database_id?, approver_id }, thenPATCHto enable/disable or change the approver,DELETEto remove. There is no settings page for this yet. - An AI can read gates but never change them. The MCP
list_action_gatestool is read-only on purpose: an agent able to edit the gate meant to constrain agents would defeat it.
Gating an agent’s record writes
Section titled “Gating an agent’s record writes”A write gate holds one agent’s record create and/or update until a person approves it. Nothing is written while it waits.
Declaring one (workspace admins, a person at the keyboard).
POST /api/v1/workspaces/{ws}/agent-write-gates with
{ "agent_id": "<the agent's record id>", "operations": ["create", "update"], "database_id": "<optional>", "fields": ["status"] }operationsiscreate,updateor both, and needs at least one.database_idlimits the gate to one database; leave it out and the gate covers every database.fields(api names) limits the gate to a write that touches one of those fields; leave it out and any write is held. Naming fields needs adatabase_id, and a name the database does not have is refused with a422.PATCH .../agent-write-gates/{id}with{ "enabled": false }switches a gate off and on, andDELETEremoves it. Like the approvals below, declaring or changing a gate needs a signed-in admin: an API token or a connected AI is refused, even one that belongs to an admin.- API-only today; there is no settings page for it.
What the agent sees. A held write is not performed. The API answers 202 (not 200, because
nothing was written) with:
{ "pending_approval": true, "approval_id": "<id>", "message": "…" }Over MCP the write call answers the same pending_approval and approval_id. Do not retry it.
Approving applies exactly the values that were staged when the write was held, and nothing the
agent or the approver sends afterwards. Rejecting discards them. A batch create is held as one
approval covering every record in it; it is approved or rejected whole.
Who decides. The held write lands in the Inbox as an ordinary approval, addressed to the agent’s owner, who is also notified. The owner or any workspace admin can decide it, and only as a person in the app, as in Deciding. An approval whose agent no longer exists, or whose owner is no longer an active member, is not applied.
Where it applies. The gate is checked inside the record write, so it covers an agent acting
through REST, an MCP connection that belongs to the agent, an agent run, a board drop that carries
new values, and a button an agent presses. In a bulk update, the records whose update was held are
reported in held with their approval ids, and the rest are changed as normal.
Refused rather than held. Some changes cannot be shown to an approver as one set of values, so
for a gated agent they are refused with a 422 that says to make the change as an ordinary create
or update instead:
- duplicating a record (counts as a create),
- restoring a record version (counts as an update),
- a bulk update job (counts as an update),
- linking or unlinking records through a relation (counts as an update).
The refusal applies only where a gate on that agent would match the database and operation. An ungated agent, or a different database, is not affected.
What it does not cover.
- Only creates and updates. Deleting is the action-class gate.
- Only an agent that is a record in the Agents database, acting as that agent. A write by a person, or by an automation, is not held by this gate. A token that carries no agent is not either.
- A pack can declare gates (below), but a gate on an existing agent is never replaced by a pack update.
Declaring gates in a pack. An agent in a pack manifest can carry a write_gates list, each
entry { operations, database?, fields? } using database and field names. Installing the pack
creates those gates for an agent the install creates; an agent that already exists keeps whatever
gates it has. Naming a database the pack does not declare, or a field the database does not have,
fails the install instead of dropping the gate. A key left out means “no opinion”; [] means
“explicitly none”. Exporting a pack writes write_gates for an agent that has enabled gates.
Reading them. GET /api/v1/workspaces/{ws}/agent-write-gates (MCP list_agent_write_gates)
is read-only:
- an admin can read all gates, or one agent’s with
?agent_id=; - an agent’s owner, if a member, can read that agent’s gates only, and must pass
agent_id; - anyone else, and an agent id that does not exist or is not theirs, gets the same
404, so it does not reveal which; - an agent’s own token cannot read its own gates through its owner’s access.
When an agent’s write fires an outward action
Section titled “When an agent’s write fires an outward action”This applies to an agent running on a Runner, whose writes are made with a short-lived credential that belongs to that run. When such a write fires an automation rule, each action in the rule that reaches outside StoryOS is held in the Inbox as an ordinary approval, regardless of the rule’s own approval setting: send email, send a Slack message, send a webhook, call an API and post to social.
- An email whose recipients are all workspace members is not held by this rule. Every other outward action, and an email with even one outside recipient, is.
- The agent’s own approval policy also applies. The policy’s
email,webhookandoutwardentries hold the matching actions an agent’s write fires. A policy that listsemailholds an email to members only; a policy that lists onlywebhookdoes not. - The card says where it came from: Caused by agent “X” (run N, on the Runner’s name): …, and the approver decides it as in Deciding.
- Approving sends what was frozen at the moment it was held, not a later edit of the record.
- What is not covered. A write made with an ordinary personal access token, and a write by an agent that StoryOS runs itself, are not held by this rule; the rule’s own setting decides.
Destinations an admin fixed in advance
Section titled “Destinations an admin fixed in advance”Some outward paths have a destination an admin chose and the agent cannot change. These are not held when an agent’s write causes them; they run as configured, and the agent and the run are recorded so “what did that agent’s write send, and where” can be answered afterwards:
| Destination | Where the agent shows up |
|---|---|
| An outbound webhook subscription | The delivery body carries caused_by with source: "agent", agent_id, agent_name, run_id, runner_id and runner_name. |
| The Slack mirror of an @-mention, and the mention and watcher emails to members | The audit log holds an outward.slack_mention_mirror, outward.mention_email or outward.watcher_email event naming the agent and the run. |
| Write-back on a source whose admin turned approval off | The source’s run log records caused_by. On a source with approval on, the write-back is held and its card names the agent. |
| The Google Calendar an admin bound to a database | The audit log holds an outward.calendar_sync event naming the agent and the run. A pushed event carries no guest list today, so Google sends no invitations; a push whose body would carry guests is refused, whoever caused it. |
| An AI field’s recompute, which sends the record’s prompt values to the workspace’s configured AI | The audit log holds an outward.ai_field event naming the agent and the run. It is written before the call is made, so it exists whether or not the call succeeds. The new value is written without firing rules or waking an agent. |
| A comment an agent writes on a Linear-mirrored record, when write-back is on | The audit log holds an outward.linear_comment event once the comment is posted. An admin can ask for these to be held instead: see below. |
Holding an agent’s comment before it reaches Linear
Section titled “Holding an agent’s comment before it reaches Linear”When comment write-back is on, a comment an agent wrote on a mirrored record is posted to Linear,
signed with the agent’s name. An admin can set write_back.require_approval_for_agent_comments to
true so that such a comment waits for a person first. It is off by default, it is set through the
Linear integration’s configuration (POST /api/v1/workspaces/{ws}/integrations/linear, admin-only),
and there is no switch for it in the app yet.
- Nothing is posted while it waits. The Inbox shows an approval, Post a comment to Linear on
“
”: , with the card naming the agent and the run. A workspace admin decides it. - Approving posts it, signed with the agent’s name as before. Rejecting, or letting it expire, means it is never posted, and the comment itself gets a note saying so.
- A person’s comment is never held by this setting.
When an agent’s own policy holds its deletes
Section titled “When an agent’s own policy holds its deletes”This applies to an agent running on a Runner. If the
agent’s Approval policy lists delete, a delete it makes directly is not performed. It is
held in the Inbox as an ordinary approval. The API answers 202 with pending_approval: true and an
approval_id, and the MCP delete tools answer deleted: false and pending_approval: true. Do not
retry the call: a second one stages a second approval.
The delete tools it holds:
| What the agent tried | Held as |
|---|---|
| Delete a record, or delete records | One approval. A batch is held whole, and approved or rejected whole. |
| Unlink records through a relation | One approval for the links in that call. |
| Delete a comment, an attachment, a document, a source or a skill | One approval each. |
| Delete a space view | One approval. |
| Remove sample data | One approval for all the sample records the templates created. |
The card reads Caused by agent “X” (run N, on the Runner’s name): delete …, followed by what is being deleted. A personal document, view or skill is shown without its name, because personal content is private even from admins.
- Approving performs the delete once, as the member the agent acts as, and that member’s access is checked again at that moment. If they are no longer an active member, or no longer have access, it is not applied. The audit log names the agent and the run. A record goes to the trash as before, so it can be restored.
- Who decides. The card goes to the agent’s owner, who is notified; the owner or a workspace admin can decide it, as a person in the app (Deciding). The agent can never approve its own.
- Rejecting leaves the data.
- Either decision wakes the agent, with the reason
approval_decidedand the verdict.
What this does not hold.
- An agent whose policy does not list
deletedeletes as before: its role and scopes decide. - A person is never held by this, and neither is a delete made with an ordinary personal access token.
- An agent that StoryOS itself runs is not held by this rule either; its proposed actions go through its approval policy as before.
- Clearing your own preferences (pins, favourites, personal filters, watches, dismissed hints) is not held, because nothing shared is lost.
- A gate declared by an admin is checked first and wins. One delete is one approval, never two.
How the Inbox names an agent’s request
Section titled “How the Inbox names an agent’s request”An approval that an agent’s run caused is named for the agent. The Inbox row and the header of its card show the agent and the run, such as Sales assistant (run 42), instead of the name of whoever wrote the rule. An approval a person caused still shows that person.
The API carries the same thing as caused_by on the approval and on its Inbox notification:
agent_id, agent_name, run_id, run_number, runner_id, runner_name and a ready-made label.
It is null when a person caused the approval.
How the Inbox names a rule’s request
Section titled “How the Inbox names a rule’s request”An approval that an automation rule asked for says which rule, after the action: needs your approval to run Notify Finance. My Work’s Waiting list says the same.
What you see depends on what you may read. If you may read the automations of that rule’s database, you see the rule’s current name. If you may open the database but not its automations, the row says a rule in Tasks and names no rule. If you cannot open the database either, the row keeps its usual sentence with nothing added. An approval no rule wrote (an agent’s proposal, or a rule that has since been deleted) never carries a rule name.
The API carries this as rule_id, rule_name and rule_label on each approval in the approvals list
and in My Work’s waiting rows. A viewer who may read the rule gets all three. A viewer who may not gets
rule_id and rule_name as null, and rule_label as the neutral wording above. All three are null
when no rule is behind the approval, so rule_label set with rule_name null means “withheld”, and
all null means “no rule”.
What gets held
Section titled “What gets held”This section describes the action-class gate above.
Anything that isn’t a person using the app — an agent, an automation, an API token, an MCP client, Tyron. A person clicking in the web app is never held by a gate. Who counts as a person is decided at sign-in, never by a flag the caller sends.
The check runs inside the delete itself, so every way of reaching it is covered: the REST
endpoints, MCP’s delete_record / delete_records, Tyron, and a large bulk job all hit the same
gate. Over MCP a held delete answers honestly — deleted: false, pending_approval: true and the
approval’s id — never a success that didn’t happen.
Deleting a whole database or space doesn’t dodge it. A database delete is held as one approval
covering every live record in it. A space delete is refused (422) if any database inside it
would be gated, rather than half-deleting it; delete the gated database first, through the normal
hold-and-approve flow, then the space.
Deciding
Section titled “Deciding”An approval is a person’s decision. Approving or rejecting needs a signed-in person using the
app, in the Inbox; a request made with an API token or by a connected AI is refused with a
403, even if that token belongs to an admin. MCP has no approve or reject tool at all. Role
and named-approver rules are unchanged — this is an extra requirement on who is acting, not a
replacement for them.
A decision is final. Repeating the same decision (a double click) is harmless: it answers 200
with already_decided: true, changes nothing, and the app says Already approved or Already
rejected. The opposite decision — rejecting after approving, or the reverse — is refused
with a 409 and a reason, and so is any decision on an approval that has expired. Nothing is
changed. To undo what an approval allowed, change that thing directly.
The Agent rules page
Section titled “The Agent rules page”Settings → Agent rules (workspace admins only; it was called Governance before) shows what the server actually enforces, read-only. Nothing on it widens a scope or decides an approval.
- Agents. Each agent’s declared scope (read, read and change, or admin) and its own approval policy in plain words. An agent that declares no scope is shown as read-only, because that is what the server does. An enabled agent that can change records and holds nothing for approval is flagged; a switched-off agent is not. A banner appears only when every enabled agent that can change records has no approval policy and no workspace gate is in force.
- Gates in force. The workspace’s gate policies, in-force ones first. A policy on an action the server doesn’t enforce shows as “Does nothing”, with the server’s reason, never as protection.
- Approvals. How many are waiting and, of the latest 100, how many were approved, rejected or expired, with who decided, when, and why. These are counts of the latest 100, not totals.
- Recent agent actions. What agents and API tokens changed, newest first (25 at a time), each with the credential that did it and the member it ran as. Select one for the full chain: the member, the credential (live or revoked), what it could reach and may do, the agent, and the action. An action with no recorded credential says so on its row, in words: it was made before credentials were tracked, or through a sign-in session or an OAuth connection. A row is never drawn with a blank link.
- Always enforced. Only a person can approve or reject; an approval is decided once; an agent never has more access than its owner; and publishing to the outside is held for approval unless an admin turns that off.
What it cannot show. The scopes and approval policies on the page describe a run when StoryOS runs the agent. They do not describe an API token or a connected AI client, which act as the person who made them. There is no audit export yet, and an action made through a sign-in session, an OAuth connection or an automation, or before credentials were tracked, names no credential, because none was recorded.
Not built
Section titled “Not built”- Only the
delete_recordsclass can be declared as a policy, and the API enforces that: declaring any other name (saydelete_database) is refused with a422that lists the supported classes, because a policy nothing checks would show as enabled and protect nothing. A policy stored on an unsupported class before this was enforced is kept, listed withenforced: falseand aninert_reason, never reported as enabled, and can be disabled or deleted but not switched on. Other classes are named in the code but don’t have policies yet, and nothing in the product spends money, so there is no spend gate. - A web page for declaring gates.