All plugins

blastradius

Reads a destructive shell command before it runs and reports what it would actually delete: how many files, how many git can restore, how many it cannot, the total size, and which of them look valuable, then lets policy decide whether to show the report, block the call, or demand a one-shot blast_allow. Covers rm and rm -rf, git clean, git reset --hard, truncate -s 0, > file and : > truncating redirects, and mv overwrite, including nested bash -c, subshells, and chained commands with cd tracking; anything it cannot resolve is reported as unmeasured instead of guessed. Snapshots and verified restore exist as a separate step (blast_snapshot, blast_restore); restore skips files edited after the snapshot unless overwrite_conflicts is set. Disclosure - no network; reads file metadata, directory listings, and the output of read-only git calls (git ls-files, git check-ignore, git rev-parse); writes snapshot copies under HERMES_HOME/plugin-data/; strict policy blocks the tool call while balanced and relaxed report and continue; local terminal backend only; no telemetry. Disclosure — no network and no telemetry; on every terminal call it reads file metadata, directory listings and the output of read-only git calls (git ls-files, git check-ignore, git rev-parse); it writes snapshot copies under the Hermes plugin data dir (or BLASTRADIUS_SNAPSHOT_DIR), and blast_restore with confirm writes snapshotted files back to their original paths, skipping files edited since unless overwrite_conflicts is set; its blocks add to Hermes approval and never replace it, and the agent can relax them through blast_policy or a one-shot blast_allow (BLASTRADIUS_ALLOW=1 turns them off); local terminal backend only.

valenciayuna1DesktopUpdated 21 days ago

About

Reads a destructive shell command before it runs and reports what it would actually delete: how many files, how many git can restore, how many it cannot, the total size, and which of them look valuable, then lets policy decide whether to show the report, block the call, or demand a one-shot blast_allow. Covers rm and rm -rf, git clean, git reset --hard, truncate -s 0, > file and : > truncating redirects, and mv overwrite, including nested bash -c, subshells, and chained commands with cd tracking; anything it cannot resolve is reported as unmeasured instead of guessed. Snapshots and verified restore exist as a separate step (blast_snapshot, blast_restore); restore skips files edited after the snapshot unless overwrite_conflicts is set. Disclosure - no network; reads file metadata, directory listings, and the output of read-only git calls (git ls-files, git check-ignore, git rev-parse); writes snapshot copies under HERMES_HOME/plugin-data/; strict policy blocks the tool call while balanced and relaxed report and continue; local terminal backend only; no telemetry. Disclosure — no network and no telemetry; on every terminal call it reads file metadata, directory listings and the output of read-only git calls (git ls-files, git check-ignore, git rev-parse); it writes snapshot copies under the Hermes plugin data dir (or BLASTRADIUS_SNAPSHOT_DIR), and blast_restore with confirm writes snapshotted files back to their original paths, skipping files edited since unless overwrite_conflicts is set; its blocks add to Hermes approval and never replace it, and the agent can relax them through blast_policy or a one-shot blast_allow (BLASTRADIUS_ALLOW=1 turns them off); local terminal backend only.

Blast Radius 2.0

Know what breaks before your agent does, and keep a way back.

A Hermes Agent plugin that measures a destructive command's real target, copies it into a
checksummed snapshot before it runs, and restores it afterwards when something goes wrong.

BlastRadius 2.0 demo

43 files measured → snapshot verified → command runs → files restored, checksums checked.
Full 35s MP4: demo/blastradius-demo.mp4 ·
text transcript: demo/DEMO-OUTPUT.txt

hermes plugins install https://github.com/valenciayuna/hermes-plugin-blastradius
hermes plugins enable blastradius

Requirements: Python 3.10+ and a Hermes build with the plugin hook API (pre_tool_call,
register_tool, register_command). No third-party Python packages; the tests run on the
standard library alone. git is used for tracked/untracked analysis when the target is a repo.


Why it exists

Hermes already asks "allow this command?" and can ask a model "is this dangerous?". Neither
answers the useful question: what dies if I say yes? A risk opinion is formed from the
command text; it never opens the target.

Blast Radius opens it. It expands the paths, walks them, and splits the result into files git
can restore and files it cannot. git clean -fd, an uncommitted .env, a local database: all
untracked, all invisible to a guess about the command string.


What it does

1. Impact report

BLASTRADIUS // IMPACT REPORT

Command: "rm -rf ."

Impact:
  43 file(s) affected
  7 tracked by git
  36 untracked (2 ignored)
  29.4 KB affected

Potentially valuable data:
  ".env"
  "data/app.db"
  "migrations/0007_draft.sql"

Recovery:
  Git-tracked files may be recoverable from the repository.
  Untracked files are not recoverable from Git.

Risk level: HIGH

2. Recursive parsing

A wrapped command is not a blind spot anymore. The parser splits on &&, ||, ;, | and
newlines while respecting quotes, unwraps bash -c / sh -lc strings and ( … ) / { …; }
groups, and follows cd inside the chain so later relative paths resolve from the right place.

bash -c "cd build && rm -rf ."     # measures build/, not nothing
sh -c 'bash -c "rm -rf data"'      # nested wrapper, still measured

Still reported as unmeasured instead of guessed: command substitution ($(…), backticks),
unresolved variables, ssh, eval/source, and dynamic xargs. When only part of a chain can
be seen, the report says so. balanced and relaxed block with a partial measurement
warning rather than passing quietly, and strict blocks outright.

Recursion depth is capped at 3 wrappers.

3. Verified snapshots

Before the command runs, every affected regular file is copied outside the target tree with a
SHA-256 each, then re-read to confirm the copy matches.

  • stored under ~/.hermes/plugin-data/blastradius/snapshots/<id>/ (0700 dirs, 0600 files)
  • symlinks are recorded but not followed
  • the store is outside the target, so the destructive command cannot eat it
  • rebuildable directories (node_modules, .venv, venv, __pycache__, .git, dist,
    build, .next, caches) are not copied: they are counted in the report and listed as
    not snapshotted (excluded). --include overrides this per snapshot.
  • free space is checked first; a failed snapshot is reported as failed and blocks under strict

4. Restore with conflict detection

/blast restore last            # plan only
/blast restore last confirm    # apply, then verify

Refuses to restore from a snapshot that fails its own verification.

A file that changed after the snapshot is a conflict, and conflicts are skipped, not written
over: the newer file is usually the work you were doing. The plan and the result both report the
count and the first ten paths. Replacing them is possible but has to be asked for:

{"snapshot_id": "last", "confirm": true, "overwrite_conflicts": true}

Every restore is logged to recovery.log and marks the snapshot as recently used.

Snapshots of paths outside the git root (for example rm -rf /tmp/build run inside a repo) are
stored under an abs/ prefix with the absolute path, and restore puts them back where they came
from.

5. Retention

Defaults keep the store bounded without asking: 14 days, 20 snapshots, 2048 MB.
Pruning runs automatically before a snapshot is created, oldest first, and never touches a
snapshot that is pinned or was restored in the last 24 hours.

/blast prune            # plan
/blast prune confirm    # apply
/blast pin <id>         # exempt from retention
/blast unpin <id>

Limits are overridable per environment: BLASTRADIUS_SNAP_MAX_AGE_DAYS,
BLASTRADIUS_SNAP_MAX_COUNT, BLASTRADIUS_SNAP_MAX_TOTAL_MB.

6. Risk policies

PolicyBehaviour
relaxedreport the impact, block high-impact changes or any partially measured call
balanced (default)block when untracked data would not be recoverable from git, or when part of the command is invisible
strictblock every measured destructive call until a verified snapshot exists; blast_allow creates one and withholds the grant if it fails
/blast policy            # show
/blast policy strict     # set
BLASTRADIUS_POLICY=relaxed hermes ...

7. What counts as destructive

shapemeasured as
rm, rm -rf, rmdirthe files under each target, globs expanded the way the shell would
git clean -f, git reset --hardthe untracked or reset files it would take
truncate -s 0 file, : > file, > filethe file it empties
mv a b where b existsthe destination it overwrites

2> file and >> file are not truncation and are ignored, a > inside quotes is text rather than a
redirect, and anything that cannot be resolved (> $(mktemp), > build/*.log, find . -delete, a
path built by a variable) is reported as unmeasured instead of being counted as zero files.

Tools and commands

InterfaceWhat it does
blast_radius(command, cwd?)measure impact without running anything
blast_snapshot(command, cwd?, include_excluded?)back up the targets and verify the copies
blast_snapshots()list snapshots with size, verification, pin state, exclusions
blast_restore(snapshot_id?, confirm?)plan or apply a restore
blast_allow(command, ttl_s?)permit exactly one future execution (spent on use)
blast_policy(policy?)read or set the risk policy
blast_prune(confirm?)apply retention limits
blast_pin(snapshot_id?, pinned?)pin or unpin a snapshot
/blast <command>shorthand impact report
/blast snapshot <cmd> · snapshots · restore [id] [confirm] · prune [confirm] · pin/unpin [id] · policy [name]the same actions from chat

BLASTRADIUS_ALLOW=1 remains the operator's blanket override for a session.


Security model

The agent is treated as careless, not adversarial. A command typo, a wrong path or a
misunderstood instruction is the threat this plugin defends against; an attacker who already
runs commands as your user is not.

What that means in practice:

  • A snapshot is a plain copy in your home directory. Anyone who can read your files can read the
    snapshot (it is 0600, but same-user processes are not isolated from each other), and anything
    with write access to ~/.hermes/plugin-data can tamper with it. Verification catches
    corruption of a stored copy, not a determined attacker with your permissions.
  • Snapshots do not survive a compromised machine, disk failure, or rm -rf ~.
  • The hook does not bypass Hermes approval; it only adds a measured block before it.
  • The parser is heuristic. Every case it cannot follow is reported as unmeasured, and the plugin
    never approves a command on its own.

Install and verify

git clone https://github.com/valenciayuna/hermes-plugin-blastradius
cd hermes-plugin-blastradius

python3 tests/blast_proof.py      # 80 checks, isolated temp repos
python3 tests/audit_parser.py     # 16 adversarial command shapes
python3 tests/audit_snapshot.py   # 12 snapshot, restore and policy checks
python3 tests/audit_integration.py  # 7 Hermes dispatcher checks
python3 demo/demo.py             # protect -> destroy -> restore transcript
hermes plugins validate .
hermes plugins doctor .

The suite builds a real git repository with generated files, tracked and untracked data, a
.env, a SQLite file, a draft migration and a build/ directory, then exercises measurement,
recursive parsing (nesting, quoting, cd, depth limit, unresolvable segments), the gate,
one-shot authorisation, snapshots, exclusion, restore, conflicts, corrupted snapshots, retention
by age/count/size, pinning, and all three policies. Nothing destructive touches the project
directory itself.


Honest limitations

  • Heuristic parsing. Wrappers and chains are followed up to depth 3; anything genuinely
    opaque is reported as unmeasured, never estimated.
  • No universal undo. Restore covers regular files that were in a snapshot. Database state,
    remote operations, blockchain transactions and external services are out of scope.
  • Race window. The filesystem can change between analysis and execution; there is no lock. A
    file created between snapshot and delete is not protected.
  • Excluded directories are not recoverable from the snapshot. They are listed in the report
    precisely so nobody assumes otherwise.
  • Hard links and special files are counted but not archived.
  • Snapshots cost disk. Retention keeps it bounded, but a large target still needs room; a
    snapshot that cannot complete blocks the command under strict.

Layout

__init__.py                 entry point: registers the hook, tools and /blast command
blastradius_core/
  paths.py                  data dirs, retention config, default excludes
  measure.py                shell-aware parsing, recursive expansion, impact report
  snapshot.py               create/verify/list/pin/prune, checksums, exclusion
  recovery.py               restore planning/apply, allow-grant store
  policy.py                 relaxed / balanced / strict
  hooks.py                  pre_tool_call, tool handlers, command dispatcher
tests/blast_proof.py        80 assertions, stdlib only
tests/audit_parser.py       16 adversarial parser checks
tests/audit_snapshot.py     12 snapshot, restore and policy checks
tests/audit_integration.py   7 dispatcher checks
docs/audit.md               what the audit found, including two fixed bugs
demo/demo.py                end-to-end demo, real deletes and real restores

MIT.

README from the reviewed commit 5cba657; it updates when the author re-pins.

More by valenciayuna

2 plugins by valenciayuna in the catalog.

valenciayunavisual-oracleMakes a UI claim measurable before an agent reports success: captures a page as a baseline, then pixel-diffs later renders and answers PASS, FAIL or REVIEW with independent change regions (bbox, pixel count, area, density), a diff image, an overlay and per-region crops. Waits for document.fonts.ready, an optional selector and two identical frames so a capture is settled, records the Chrome version and viewport that produced it, and refuses to guess when rendering never stabilises. An optional visual change contract declares expected changes and protected regions so a declared change can pass while an undeclared one fails; selectors name locations, not meaning. Masks accept rectangles or CSS selectors and are applied before capture, a selector matching nothing is an error, and masks may not cover more than half the viewport. Only public http and https are rendered: file://, data:, private ranges and the cloud metadata address are refused on the URL and on every request the page makes, redirects included, with localhost, 127.0.0.1 and ::1 allowed and VO_ALLOW_HOSTS for anything else. Disclosure - renders the URL you give it in a local Chrome over the DevTools protocol (no Selenium, Playwright or pip install), so the page's own network requests happen in that browser; reads the PNGs it produced and writes baselines, diffs, overlays, crops and report.json under HERMES_HOME/plugin-data/; runs no shell command of its own and no background service; the baseline is never updated automatically; image input must be a real PNG and a header claiming more than 8192 px on a side is refused before decompression; no telemetry. Disclosure — renders the http(s) URL you give it in a local headless Chrome over the DevTools protocol (no Selenium, Playwright or pip install), so the page's own network requests happen from your machine; refuses non-http(s) schemes and private, link-local and cloud-metadata addresses on the URL and on every request the page makes (localhost, 127.0.0.1 and ::1 allowed, more via VO_ALLOW_HOSTS); launches Chrome with --no-sandbox only when running as root, without user namespaces, or with VO_NO_SANDBOX=1; reads the PNGs you point it at and writes baselines, diffs, overlays, crops and report.json under HERMES_HOME/plugin-data/visual-oracle/; a failing or REVIEW check keeps the agent's turn open through the pre_verify hook; runs no shell command of its own and no background service; the baseline is never updated automatically; no telemetry.Communitytools

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section