--- name: snapshot-backups description: "Use when backing up a Cognigy project before changing an existing AI Agent, rolling a project back to a previous state, undoing agent changes, or working with Cognigy Snapshots — create, restore, list, delete." --- # Snapshot Backups and Rollback Use `manage_snapshots` to take a restorable backup of a Cognigy project and to roll it back. A Snapshot is an immutable copy of a **whole project**. ## Read this before offering a backup - A snapshot covers the **entire project** — every AI Agent, Flow, Connection, LLM, Lexicon, Extension, Function, Playbook, Goal, Snippet and Locale in it. Restoring reverts **all** of them, not just the agent you are working on. - A snapshot does **NOT** contain: - Endpoints (and their API keys) - Knowledge AI — stores, sources, chunks, connectors - Intent Trainer learning sentences - Analytics data, contact profiles, logs - Other snapshots and packages - So for an agent that uses knowledge, a snapshot is **not a complete backup**. Say this in one line when you offer it, rather than letting the user believe otherwise. - Restoring is **irreversible** and deletes resources before recreating them. - Snapshots cannot be renamed or edited after creation. ## Supported workflow ### Back up before changing an existing agent The server enforces this **once per project**, so you do not have to remember it. The **first** attempt to change an existing agent in a given project — `update_ai_agent`, `create_tool`, `update_tool`, a mutating `manage_flow_nodes`, or `delete_resource` — is **held**: it changes nothing and returns `error: "backup_not_offered"`. When you see that error: 1. Do **not** report the change as done. Nothing happened. 2. Ask the user, in one short line, whether they want a restorable backup first. If the agent uses knowledge, add that Knowledge AI is not covered. 3. If they accept: - `manage_snapshots { operation: "create", projectId: "", label: "pre-persona-update" }` - Wait for `created: true`. 4. If they decline: - `manage_snapshots { operation: "decline", projectId: "" }` 5. **Retry the held call.** It now goes through, and nothing else is held **for that project**. Because the gate is per project, a later change to a **different** project can be held again in the same session — that is correct behaviour, not a malfunction. An answer given for one project says nothing about another, so ask again for the new one. (When the server cannot tell which project a call targets, it falls back to holding once for the session as a whole.) The gate does not fire for an agent or project created in this same session — there is no prior state to roll back to — and never for read-only operations. If you do not have the `projectId`, read it from `get_resource { resourceType: "agent", id: "" }`, which returns it. If `create` returns `error: "snapshot_limit_reached"`, follow *At the snapshot limit* below. If it returns `error: "task_status_unknown"`, the outcome is unknown: poll `read_task` before saying anything, and do NOT create a second backup. If it returns `pending: true`, the backup does **not** exist yet — poll `read_task` until it is done before changing anything, and note that a pending create does not satisfy the gate. `label` is a short reason, not a name. The plugin builds the name itself as `[AI Backup] v