upgrade-safe-run-state

upgrade-safe-run-state is a cursor rule for Cursor from paperclipai/paperclip. It costs 0 tokens per session (852 once invoked), scanned A, original, MIT.

A rule for saving and resuming agent run state across software releases and restarts. It requires each release to explain whether older saved state is carried forward, migrated or permanently refused.

In plain words
What is it for?
It guides changes to saved run, session, checkpoint, launch and provider identity data so upgrades handle in-flight work predictably.
Why use it?
A deployment can interrupt a run or leave saved data in a format the new release cannot understand. Named permanent failures are safer than repeatedly retrying an incompatible state.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit It guides changes to saved run, session, checkpoint, launch and provider identity data so upgrades handle in-flight work predictably.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/paperclipai/paperclip/upgrade-safe-run-state
About the project

Paperclip is a Node.js server and React application for coordinating AI agents as a business team, with goals, organizational roles, budgets, governance, and work tracking in one interface. It is used by people managing multiple agents or autonomous agent organizations across tools such as OpenClaw, Claude Code, Codex, and Cursor. The catalogue includes skills, agents, an MCP add-on, and an instruction for working with Paperclip.

paperclipai/paperclip · 118,214 stars · on GitHub · paperclip.ing

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/paperclipai/paperclip

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for upgrade-safe-run-state

README.md
[![agentmods](https://agentmods.dev/badge/rules/paperclipai/paperclip/upgrade-safe-run-state/github.svg)](https://agentmods.dev/rules/paperclipai/paperclip/upgrade-safe-run-state)
Your own site
<a href="https://agentmods.dev/rules/paperclipai/paperclip/upgrade-safe-run-state"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/upgrade-safe-run-state/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for upgrade-safe-run-state

Your own site · 80×15
<a href="https://agentmods.dev/rules/paperclipai/paperclip/upgrade-safe-run-state"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/upgrade-safe-run-state.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 852 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00852
Opus 5.5 $0.00000 $0.00341
Sonnet 5.5 $0.00000 $0.00170
Haiku 4.5 $0.00000 $0.00085

Measured 14d ago against content hash 744f78375839, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

upgrade-safe-run-state scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/upgrade-safe-run-state.mdc · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Upgrade-safe run state

Scope and purpose

This rule covers native runtime, recovery, session preparation, runner, ACPX engine, provider-pack, and sandbox image code, and the database schema for native run, checkpoint, session, and run identity state. Deploys and restarts happen while runs are saved or in flight, so state written by one release is routinely resumed by the next. Code here must treat that cutover as a normal path, not an edge case.

Persisted run identity includes:

  • launch configuration and protected launch arguments;
  • provider and runner pack identity, such as profile versions, command digests, and pack contract digests;
  • execution leases, owners, and runtime API listeners;
  • saved session, thread, and checkpoint schema;
  • workspace authority, paths, and sandbox confinement.

Required behavior

  • State the previous-release story. A change that adds, removes, or changes persisted run or session state, launch configuration, or pack identity must say in the PR how state saved by the previous release is handled: it carries forward, it is migrated, or it is refused.
  • Refuse permanently and by name. When saved identity is unknown or no longer accepted, map it to a permanent, named error code that recovery does not retry. Never report it as a generic retryable code such as native_session_interrupted. A retry cannot change saved identity; it repeats the refusal, and a replacement can destroy saved state.
  • Keep saved state on refusal. A permanent refusal leaves the saved session, checkpoint, and workspace intact and hands the run on with that named reason.
  • Fix the class. Prefer one admission or recovery rule that classifies release-incompatible state over adding single error codes to a list.
  • Test the cutover. Add an old-saved/new-resumed regression that saves state in the previous release's shape and resumes it with the new code. When a run can be in flight at the cutover (preparing, attaching, holding a lease or listener), add a case where the deploy or restart lands mid-run.
  • Apply remote confinement in tests. Remote-sandbox paths need a test that applies the provider's workspace confinement rules. A local test without them does not prove the remote path.

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed · -3 lines 744f78375839
  2. 22d ago First seen · 71 lines · 0 tokens per session scan A f249b2f5696c

Subscribe to this mod's changes

upgrade-safe-run-state is a cursor rule published in the GitHub repository paperclipai/paperclip (118,214 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 852 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-08.

Related

upgrade-safe-run-state compared with cursor rules from other repositories

upgrade-safe-run-state next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
upgrade-safe-run-statepaperclipai/paperclipCursor rule118kyesterdayMITA0Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor
angular-20angular/angularCursor rule102k4d agoMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prefer-direct-imports-over-module-mocksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
shared-plane-packagesprisma/ormCursor rule48ktodayApache-2.0A0Cursor