Inspiration

A report in Atlassian Community describes a title-only update through the MCP connector that silently deleted the body of every page it touched. The poster asked for a pre-flight check and an automatic snapshot. Page history is the only recovery Confluence offers, and it only helps if someone notices. In our research on 30 November 2026 (web searches, including Marketplace results) we found nothing native and no app that restores a page automatically, right after a damaging edit. MCP gateways exist, but they filter calls outside Atlassian. We did not install or test other apps, so this is what a search showed, not a survey.

What it does

  • Scores every page update it can see against the previous version, whatever made it. Edits in the editor and writes through the REST API were checked live. Edit Guard's own MCP tools were called from Claude Code. So was Atlassian's own MCP server: Claude Code replaced a test page's body with an empty paragraph through updateConfluenceContent, and Edit Guard (automatic restore on) put the page back 4.8 seconds later and mentioned the user in a page comment.
  • Flags damaging edits with a byline item on the page ("Edit Guard: 1 risky edit"), a review list for the space and one list for all spaces. Each shows what was lost, with the titles of removed sections and a short excerpt, and offers Restore, Compare versions and Dismiss. The lists show only pages the viewer can open.
  • Flags real losses, not tidying. On Normal: half of the text, one section with 35% of the text, two sections with a quarter of the text, every table, every image of a page that had two or more, a code block with content, or three headings, tables, images or macros, with two links counting as one. Strict is tighter (30% of the text, one section with 15%, or two items). A table turned into a list, headings turned into bold text or renamed, a few dead links pruned or a page's one screenshot dropped is not flagged. A rewrite with the same amount of text still passes.
  • Starts in flag-only mode, where a wiped page is flagged and the editor always gets a page comment saying Edit Guard did not put it back because automatic restore is off. Once an admin turns automatic restore on (site default, one space, or the demo button), a wiped page is put back within seconds, as a new version, with "Keep the edit instead" if the wipe was intended. Nothing is overwritten. Messages name both versions ("Put back version 11 as version 13") so they match the page history.
  • A wipe is a specific thing: at least 90% of a page's text gone and at most a tenth of its images, tables and macros with content kept. Empty panels or tables left behind do not hide a wipe. A page replaced by a short note (5 to 300 characters) or by a macro that shows content from elsewhere is flagged and commented on, not restored, and after 3 restores of a page in an hour Edit Guard stops restoring it and says so.
  • Tells the editor: after an automatic restore it adds one page comment that mentions the editor, so Confluence notifies them. The comment gives counts only, never the removed text, and gains one line when someone restores, keeps or dismisses the edit. Admins can also have flags commented on, or switch comments off.
  • Records who restored, kept or dismissed an edit and when, and who changed the settings, and shows it in the byline, the review list and the settings pages.
  • Lets a space admin add four demo pages to a space with one button, created as that admin; the same button turns automatic restore on for that space.
  • Exposes seven MCP tools that make agents better editors, not only gated ones. get-page returns an outline of the page's sections. edit-section rewrites one section, append-to-page adds to the end of the page or of a section, and replace-text replaces a phrase in the page text, never inside tags, macro parameters or code blocks. The agent sends only what changes, and Edit Guard builds the new page from the version it read, so a whole-body rewrite, the thing that wipes pages, is never needed. safe-update-page replaces a whole body when a change really is that big, and list-flagged-edits and restore-page let an agent see and undo flagged edits.
  • Every write tool checks the whole page before writing and refuses a destructive change, saying what would be lost; edit-section also refuses to drop macros of the section the agent may not have seen.
  • The agent proposes, a person decides. An agent can confirm a refused change with confirm_destructive and a reason. Nothing is written: Edit Guard stores the change as a proposal and tells the agent proposed. On the page, the space page and the all-spaces page, a person sees "An AI agent proposes a change", who ran the agent, the reason marked "not checked", what it would remove, which sections it would leave and what the page would say, and clicks Approve or Decline. Approve writes the change as that person, only if the page is still at the version the agent read; Decline writes nothing. A page comment mentions the person who ran the agent and gets one line when the proposal ends. Readers never see an empty page, and it works the same on a flag-only install.
  • Settings for automatic restore, page comments and sensitivity: a site default for Confluence admins (checked on the server), and per-space settings with "Use the site default".

How we built it

Forge, TypeScript and UI Kit. A product trigger on avi:confluence:updated:page and avi:confluence:snapshotted:page reads the new and previous version through the Confluence REST API v2 and passes the two storage-format bodies to a scorer. The scorer compares the share of text removed and the counts of images, tables, macros, headings and links, and returns ignore, flag or wipe. A table counts as lost only when the page has fewer tables and the missing table's words are mostly gone from the new version (or it had none), matched after the rest of the page's text, so a table rewritten as a list keeps its words, a table whose cells are edited is never lost, and a deleted one is. A wipe is restored with the version-restore endpoint, and a footer comment posted as the app mentions the editor; the app updates its own comment when a person decides. Incident records live in Forge storage and expire after 90 days. The byline item, the space page and the all-spaces page are UI Kit modules that act as the signed-in user; every row and every action checks, as that user, that they can view the page. The MCP tools are Forge actions exposed through a rovo:mcp module and run as the person who signs in, so an agent never gets more access than that person has.

The edit tools parse the page's storage format with the same lexer the scorer uses, find sections by heading (top level and layout cells only; headings inside tables and macros stay part of their section), splice in the agent's part, and refuse anything that is not well-formed, so a stray tag cannot swallow the rest of the page. All four write tools share one write path: version check, damage score of the whole page, refusal, or a proposal once the agent confirms with a reason. A proposal keeps the proposed body in Forge storage in chunks with a hash checked on read, for at most 7 days; Approve writes it with the same kind of write marker as a restore, so the trigger knows it as Edit Guard's own and does not score it. The same scorer runs in the trigger and in that write path, so what the app flags after the fact is what the tools refuse beforehand. The scorer is covered by fixture tests that include the failure from the community report (a body replaced by an empty paragraph), and the platform behavior behind the design was checked on a live Confluence site where we could. The repository records what was checked and what was not.

Edit Guard runs on Atlassian: no external egress, no remote. Confluence keeps the versions. The app keeps an incident record per flagged edit, with a short excerpt and the section titles of what was removed, for up to 90 days, cleared once someone resolves the edit. A pending agent proposal keeps the proposed body and a short preview of its text, shown only to people who can view the page, cleared when it is decided; the body is deleted after 7 days and the record after 14. Its records are in Forge's key-value store, which Atlassian documents as data residency enabled. Other people's removed text is never sent to agents; a refusal shows an agent an excerpt of what its own change would remove.

Challenges we ran into

  • There is no marker for agent writes. In our checks, the page-update event for an API write had the same fields as a person's publish in the editor; only the account differed. An agent writing as a user should therefore look like that user, and the write through Atlassian's MCP server did: a version by the user's account with an empty version message. We designed around that: Edit Guard judges the damage, not the author, and the docs say so.
  • The app's own restores come back as events. The self-generated flag was false even for the app's own writes, so it could not be used to prevent a loop. A version message alone is not enough either, since anyone can type it. Before each of its writes Edit Guard stores a short-lived marker for the version it is about to create, with the message and the expected author, and skips a version only when the marker matches. A wipe published with a copied "Restored by Edit Guard" message was scored and restored in a live check.
  • Restores race with later edits. A restore only happens while the damaged version is still the latest, and a claim in storage makes sure two deliveries of the same event restore once. If someone edited in between, the flag stays and the panel offers Compare instead.
  • Live docs arrive late. An editor edit to a live doc produces an autosave version about 30 seconds later, and the event for it reached the app about 10 minutes after that. We subscribe to the snapshot event and say plainly that live-doc damage from the editor is caught late.
  • Restricted pages are invisible to the app. If a page is restricted and the app is not on the list, there is no event and no read. We documented the limit and the fix (add Edit Guard to the restrictions) instead of pretending to cover it.
  • A gate alone does not make a better tool. If the only write tool takes a whole page body, every agent edit is a whole-page rewrite, and that is how pages get wiped. So the edit tools take one section, one phrase or one addition, and Edit Guard builds the page. That meant editing real storage safely: layouts, expand and panel macros, tables with headings in them, code blocks whose text must never be touched.
  • An agent could approve its own wipe. Our first version let an agent that gave a reason write past the check, never restored. That is self-approval. The second wrote the change and then put the page back until someone kept it: readers saw an empty page for about 5 seconds, watchers got two notifications, and on a flag-only install the change simply stayed. Now a confirmed change is a proposal: stored, not written, until a person approves it, and applied only to the version the agent read. One proposal per page waits at a time.
  • Installing should not change pages. Automatic restore used to be on everywhere from the first minute. A new install now only flags; an admin turns restore on for the site, a space, or with the demo button.
  • One leftover element hid a wipe. An empty info panel or an empty table left on a wiped page used to keep the edit below the wipe line. Now only content counts as kept, matched to what was there before, so a new panel or image cannot stand in for the old page.
  • Auto-restore cannot tell a mistake from a deliberate removal. If someone deletes sensitive text on purpose, Edit Guard puts it back. The fix is Keep the edit instead, then deleting the older versions from page history; the docs say so.
  • Noisy flags become noisy comments. Once each flag posted a comment that mentions the editor, a false alarm stopped being a quiet row in a list and became a notification to a colleague. We cut the noise in two places: the scorer no longer counts a table whose words survive, a few dead links or a page's one image, and it now looks for whole sections deleted instead; and comments default to automatic restores only, with comments on flags an opt-in per space.
  • Some damage is out of reach. Deleting, trashing or moving a page is not a page update, so Edit Guard does not see it. A short note, a kept diagram or a tenth of the text left behind keeps a wipe at flag, so it is reported, not restored. Content hidden inside a third-party macro is not interpreted, and someone who also deletes the old versions leaves nothing to restore.

Accomplishments that we are proud of

  • In recorded checks on a live site, a wiped page was restored 2.4 to 4.8 seconds after the damaging write, and the restored body was byte-identical to the version it came from.
  • The failure the community report describes, a page body emptied through Atlassian's MCP server, checked live: Claude Code, connected to Atlassian's MCP server, emptied the runbook page; Edit Guard restored it in 4.8 seconds and told the user in a page comment.
  • An agent using Edit Guard's own tools changed one section of the runbook and left every byte outside that section as it was.
  • The restore never triggers the guard again, tested live with a restore to an empty version.
  • On the development install, an agent calling Edit Guard from Claude Code asked to replace the runbook (version 27) with "Retired." and was refused with the proposal hint. Confirmed with a reason, the call returned proposed and no new version was written. list-flagged-edits showed the proposal with status proposed and the reason as quoted text. The byline read "Edit Guard: 3 risky edits, 1 proposed change", and the card showed "An AI agent proposes a change", "Nothing has been changed on the page", the reason marked "(not checked)", the removed sections, "It would leave no sections.", Approve and Decline. Approve wrote version 28, "Applied an AI agent's change, approved by Tinkers through Edit Guard", which Edit Guard did not restore (checked after 25 seconds), and the page comment gained "Update: approved by @user, now version 28." Since 6.5.0, the identical confirmed call sent again returns proposed with the same proposal id and stores nothing else (checked live); a different destructive change while one waits answers review-pending. Decline from the space page wrote nothing and recorded who declined and when.
  • The demo is one button on the space page: four pages, and automatic restore on for that space. The MCP part is optional and documented step by step.

What we learned

  • Confluence page-update events carry the page id, the version and the editor, but not the body or the version message, so every decision needs a second read. Version history means the app never needs a copy of a page, only a short excerpt of what an edit removed.
  • A publish with no change still creates a version and an event, so the scorer has to treat "same content" as a normal case.
  • Tool names reach MCP clients with the environment as a suffix on a development install, which is easy to miss when writing instructions.
  • "Judge the damage, not the author" is a weaker claim than "detect AI edits", and it is the one we can keep.

What's next

  • Jira: issue descriptions and comments, with the same scorer idea.
  • Warnings for restricted pages that Edit Guard cannot see.
  • Tuning the thresholds with real usage data from more sites.

Built With

Share this project:

Updates

Submission history