# Collaborating safely

> Revisions, confirmations and undo. How agents and people edit the same posts without stepping on each other.

## Revisions prevent overwrites

Every read and write returns a `revision`. Update, edit and restore calls must send the revision they're based on.

If anyone, a person in the dashboard or another agent, saved the item since then, the call fails with a revision conflict that names who changed it. The agent should re-read the item and apply its change again, instead of overwriting their work.

```text
→ get_post { "id": "launch-notes" }
← { "id": "clx…", "revision": "2026-10-13T09:12:44.120Z", "content": "# Launch notes\n\nWe shipped…" }

→ edit_post {
    "id": "clx…",
    "revision": "2026-10-13T09:12:44.120Z",
    "edits": [{ "find": "We shipped", "replace": "Today we shipped" }]
  }
← { "id": "clx…", "slug": "launch-notes", "status": "draft", "revision": "2026-10-13T09:15:02.871Z" }
```

## Confirming risky changes

When a post or page is **published**, these changes are refused unless the call passes `confirm: true`:

| Change | Why it's guarded |
| --- | --- |
| Unpublishing (`status` set to `draft` or `scheduled`) | Takes a live page off the blog |
| Changing the `slug` | Breaks existing links and search rankings |
| Emptying the body, or cutting its text below half | Usually a mistaken rewrite. The shrink check applies when the current text is at least 200 characters |
| `tags: []` on a post that has tags | Drops it from every tag page |

The refusal names every guarded change at once, and nothing is saved:

```text
This post is published at /launch-notes. This change would unpublish it
(status "draft") and change its slug from "launch-notes" to "launch",
breaking existing links. Nothing was saved. Ask the user to confirm, then
retry with confirm: true.
```

The agent should ask its user, and retry with `confirm: true` only after they approve. It must never set `confirm` on its own. Drafts aren't guarded, and changes that hit no guard need no flag. The guards apply to every role, since they exist to catch mistakes, not to enforce permissions.

## Undo with revisions

Every change to an existing post or page keeps the version it replaced. If an agent makes a mistake, it should not rebuild the old state by hand:

1. `list_post_revisions { "id": "…" }` to find the version from before the change. `replacedAt`, `source`, `status` and the content preview help pick it.
2. `restore_post_revision { "id": "…", "revisionId": "…", "revision": "<current revision>" }`.

A restore saves the current state first, so it can be undone the same way. People can do the same from **History** in the editor. See [Revision history](/help/revision-history).

## Rules that don't change

Agents can read and write content, but some things stay with people. These are deliberate:

- **Deletes go to the trash.** `trash_post` and `trash_page` move an item to the trash, where it stays recoverable. Trashing a published item needs `confirm: true`. Only people delete trashed items for good, from the dashboard. No tool deletes tags, media, sites or staff.
- **One item per call.** No bulk or "apply to all" tools. An agent that changes many items makes one call each, so every change is checked against permissions and revisions.
- **Publishing is visible.** Publishing through MCP refreshes the live blog and fires [webhooks](/docs/webhooks), just like the dashboard.

## Good habits for agents

The server sends these instructions to every client:

- Leave publishing to people unless they asked you to publish.
- Prefer `edit_*` for small changes over rewriting the whole body.
- Pass back the `revision` from your latest read. On a conflict, re-read and reapply.
- Ask before risky changes, and tell people when you restored something.
