Skip to main content

organum-backup

Encrypted, restorable snapshots of the places agent state lives — a careful wrapper around restic and your own rclone remote.

Status: 0.4.0 (macOS on Apple Silicon). Install via pip install organum-backup or pip install "organum[backup]".

Part of the organum family, shipped as its own package: organum's core stays standard-library-only and read-only; this tool downloads nothing by itself but drives restic and rclone, reads one Keychain item, and writes when you restore.

Why it exists

Agents keep their memory, session stores and working state in places git does not protect — ignored folders, SQLite files, app data. On 2026-11-21 one mistaken git sparse-checkout in a working repository deleted some fifty ignored folders of agent state. Nothing on the machine had a copy newer than two months. That morning's snapshot from this tool restored them into a separate folder, and the workspace reopened the same evening.

Bring your own remote (no bundled OAuth client)

organum-backup ships no OAuth client, no cloud credentials, and no bundled binaries. Install restic (v0.19+) and rclone yourself (e.g. brew install restic rclone), then point your profile's repository at either:

  1. A local path ("kind": "local", "location": "/Volumes/BackupDrive/organum-backup"), or
  2. Any rclone remote you configure ("kind": "rclone", "location": "my-remote:PersonalBackup"): S3, Backblaze B2, Cloudflare R2, SFTP, Google Drive (with your own OAuth client in rclone config), or any other backend rclone supports.

Store a printable ASCII repository password in macOS Keychain (non-ASCII items are rejected because macOS security -w hex-encodes them, breaking standalone restic compatibility):

PASS="$(python3 -c 'import secrets; print(secrets.token_urlsafe(32))')"
security add-generic-password -s organum.backup -a personal-files -w "$PASS"
# Write $PASS down in your offline password manager / recovery kit before clearing your shell!

Initialize and run your first backup:

organum-backup doctor --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf
organum-backup init   --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf --execute
organum-backup backup --profile /abs/path/to/profile.json --rclone-config /abs/path/to/rclone.conf --execute

What it does

  • backup — a restic snapshot of the folders you list, to a restic repository on a local path or on any rclone remote you configured.
  • source_capture (optional) — before each backup, a private stable copy of live files that cannot be read safely in place: SQLite databases through the online-backup API (committed WAL content included, quick_check verified, companion -wal/-shm/-journal races tolerated), ordinary files as bounded stable copies.
  • snapshots, ls, restore — list snapshots; look inside one (ls --snapshot ID --path /a/folder lists that folder's own entries); restore a whole snapshot, or one folder of it with --path, into a new folder. On a new machine, where the profile's capture plan is not present, restore --recovery takes no target: it restores into a new folder under <profile folder>/recovery/ (private, made by the tool) and the receipt names that folder.
  • rollback-check — read-only: one sheet of what an older version (v0.3.1) would not know if you went back to it — both state files, whether the last success is bound to a saved receipt, how far the old state is behind, lock files, the capture marker, the two LaunchAgent files. Exit 0 means no line asks for a look, 2 that one does (attention) or that the sheet could not be made (blocked).
  • launchd-template — prints the LaunchAgent plist (organum.backup.<profile>.<device>, Disabled=true, installed organum-backup absolute entry point, private log paths) without writing anything.
  • schedule-plan — read-only: inspects LaunchAgent files (plus launchctl print with --ask-launchd and ps with --ask-processes) and prints the exact ordered commands to install or switch cleanly.
  • run-if-due — a schedule decision for launchd: daily time, defer on battery, catch up. After three failed backups the schedule halts (status: halted, exit 2) until you run resume --execute.
  • organum-backup-desk — a loopback-only bilingual (English / Korean) web desk for the same actions. GET / contains no session secret; startup prints a single-use terminal code (valid 120s, max 5 tries) exchanged via POST /bootstrap for an in-memory session secret. Exits automatically after 15 minutes idle (held while a job runs). Real execution is off by default (pass --allow-execute to enable).

Threat model

  • What organum-backup protects against:
    • Accidental local deletion, repo corruption, or silent SQLite WAL loss (including git sparse-checkout or tool bugs wiping ignored folders).
    • Browser-side cross-site attacks against organum-backup-desk (loopback-only bind, strict Host/Origin/ Sec-Fetch-Site, CSP default-src 'none', zero innerHTML, no secret in GET /, single-use terminal bootstrap code, memory-only session, 15-minute idle exit).
    • Other user accounts on the same Mac (private 0700 state/staging/log/recovery folders; terminal code is never written to disk or logs; Keychain password passes only via subprocess environment, never argv or receipts).
    • Overwriting live files during restore (--overwrite never, target must not exist and must not overlap sources, profile, state, or Keychain).
  • What it does NOT protect against:
    • A process running under the same macOS user account that can read your terminal, memory, or login Keychain — such a process can already read the backup password and modify your files directly, and the desk does not claim otherwise.
    • Loss of the encryption password (there is no backdoor or key escrow).
    • Host-wide atomic snapshots across unrelated apps (each SQLite DB is a verified online backup; ordinary files are bounded stable copies captured sequentially).

Restore with restic alone (no vendor lock-in)

Your snapshots are standard restic repositories. Even without organum-backup installed, you can restore directly on any machine with restic (and rclone if remote):

export RESTIC_PASSWORD="$(security find-generic-password -s organum.backup -a personal-files -w)"
# Local repository:
restic -r /path/to/repo/personal-files/mac-primary snapshots
restic -r /path/to/repo/personal-files/mac-primary restore latest --target /path/to/new-empty-folder
# Or rclone remote:
restic -o rclone.args="serve restic --stdio --config /path/to/rclone.conf" \
  -r rclone:my-remote:PersonalBackup/personal-files/mac-primary restore latest --target /path/to/new-empty-folder

Design choices worth knowing

  • The repository password goes from the macOS Keychain to the engine's environment only — never to argv, logs, receipts or the browser.
  • Engines run without a shell, in a fixed minimal environment, against a strictly validated profile (exact keys, duplicate keys refused, symlinked paths refused).
  • Nothing is deleted automatically. Retention is recorded, not enforced.
  • One run at a time, by a flock on a file that is never removed; the engine inherits it.
  • Success is evidence, not an exit code: one final JSON summary and a full snapshot id.
  • Every real backup, init, restore, resume, and halt (once) leaves an immutable receipt in <profile folder>/.organum-backup-state/receipts/<repository key>/.

Develop

PYTHONPATH=src python3 -m unittest discover -s tests      # Python >= 3.11
node tests/test_ui.cjs && node tests/test_bridge_ui.cjs    # Node, synthetic DOM
PYTHONPATH=src python3 tools/reproduce_wal.py              # 442 WAL databases at a file limit of 256

One opt-in test drives a real restic binary against a throwaway local repository (no Keychain, no rclone, no network):

ORGANUM_BACKUP_RESTIC=/path/to/restic PYTHONPATH=src python3 -m unittest discover -s tests -p 'test_real_restic.py'

Origin and credits

Built in the Yeoul village as "personal backup" (v0.1.1 – v0.3.1); this repository starts from v0.3.1 as received. See CREDITS.md and records/.

MIT License.

Metadata

Release files for organum-backup 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for organum-backup 0.4.0
File Size Uploaded Provenance Actions
organum_backup-0.4.0.tar.gz 120.4 kB Without provenance Details for organum_backup-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for organum-backup 0.4.0
File Interpreter ABI Platform Actions
organum_backup-0.4.0-py3-none-any.whl Python 3 none any Details for organum_backup-0.4.0-py3-none-any.whl

Total release size: 193.7 kB

Release files / organum_backup-0.4.0.tar.gz

Download URL organum_backup-0.4.0.tar.gz
Size 120.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7cf119d2a4d68ce6b49f3e9186289eab634ba8e027e8ef500ee1f21fed31b54d
BLAKE2b-256 checksum
How to use checksums
84651902d65664aa7965c5e23413c85ad8df38d4b90679dc17065f61172f6c79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / organum_backup-0.4.0-py3-none-any.whl

Download URL organum_backup-0.4.0-py3-none-any.whl
Size 73.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
626c87ea9497e2f1bd30cfe1efbf98b8a59db742ff3d89c153efa61c54d2aefa
BLAKE2b-256 checksum
How to use checksums
073611d9f2064255eb1a28946e4246f683e692f730932faca79aa307e6703ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for organum-backup 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page