Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

io.github.safelatch-dev/safelatch

Latest version: v0.3.1

Overview

Last scanned
3 Dec 2026
Published
3 Dec 2026
MCP server Transport: stdio Publisher: safelatch-dev
1 Stars
0 Forks
3 Versions
TypeScript Repo language

Scan summary

io.github.safelatch-dev/safelatch was last scanned on 3 Dec 2026 at version 0.3.1. Risk score 5 of 100 (low). No malicious behavior was detected.

  • Releases: 3 versions, all published within 3 days (1–3 Dec 2026).
  • Findings: 2 rules fired in version 0.3.1 (2 medium). The score describes this version only.
  • MCP server: Runs over stdio.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.1 LATEST 3 Dec 2026 2 rules fired
0.3.0 3 Dec 2026 2 rules fired
0.2.1 1 Dec 2026 1 rule fired

Rules fired in 0.3.1: 2

Findings

2 Medium

Findings for v0.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

Code decoded and executed

The code decodes or decrypts a string and executes code built from it, for example eval(atob(...)) or exec(base64.b64decode(...)). This is a common way to hide code from review. On its own it is not evidence of malicious behavior.

MEDIUM

Encoded string decodes to a command or instruction

MEDIUM
Checking access…

🔒 Create a free account to see all 2 findings with descriptions and instance counts

The score describes 0.3.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

SafeLatch (safelatch)

Snapshot and undo supported shell file changes. Audit local plugin and MCP configuration across Antigravity, Claude Code, and Cursor.

Host SafeLatch support
Antigravity Shell rewind, runtime guard, and offline audit
Claude Code Shell and structured edit snapshots, runtime guard, and offline audit
Cursor Shell snapshots and runtime guard, plus offline audit

Already using cc-safety-net? See how the two tools can coexist.

CI CodeQL License: MIT Zero Dependencies Node.js >= 20

English | 简体中文 | Tool Comparisons

Quickstart

1. Run the local audit without installing hooks. The first npm invocation may download the package.

npx -y safelatch@0.3.1 audit --workspace .

2. Install the Antigravity plugin for shell rewind and the runtime guard.

# Antigravity CLI
agy plugin install https://github.com/safelatch-dev/safelatch

# Antigravity Desktop / Node.js (also auto-migrates legacy `agy-guard` hooks)
npx -y safelatch@0.3.1 install

3. Optional: Register runtime snapshot & guard hooks for Claude Code or Cursor (preserves existing hooks such as cc-safety-net):

npx -y safelatch@0.3.1 install --host claude-code
npx -y safelatch@0.3.1 install --host cursor
# Or register Antigravity + Claude Code + Cursor together:
npx -y safelatch@0.3.1 install --host all

Use npx -y safelatch@0.3.1 uninstall --host <host> to remove only SafeLatch's hook entries. Claude Code (Bash, Write, Edit, MultiEdit, NotebookEdit) and Cursor (beforeShellExecution, beforeMCPExecution) share the local snapshot store (safelatch snapshots / diff / restore). Cursor handles approval in the selected permission mode and inspects local MCP launcher metadata when present; general MCP calls lack file targets for rewind.

Offline audit benchmark and reproduction instructions


What SafeLatch covers

Pure runtime command blockers (cc-safety-net) stop rm -rf, yet cannot recover files corrupted by shell tools once allowed. Native Antigravity /rewind rolls back structured edit_file calls, yet misses direct shell edits (google-antigravity#851). And plugin.json manifests do not declare which hooks, scripts, or remote MCP URLs a community plugin actually runs (arXiv:2609.23809).

The SafeLatch runtime uses zero runtime dependencies, zero network calls, and zero subprocess calls.

1. Offline security and capability audit (audit)

The scanner reads recognized plugin, hook, MCP, rule, and skill files locally. Unresolved script entries appear as coverage notes.

  • Multi-Host Targeted Discovery: Inspects Antigravity (~/.gemini/config, .agents/), Claude Code (~/.claude, CLAUDE_CONFIG_DIR, ~/.claude.json, .claude/, .mcp.json), and Cursor (~/.cursor, .cursor/, .cursorrules) config paths directly without walking editor extension caches.
  • Capabilities & Network X-Ray: Lists detected hook events, stdio MCP servers, configured MCP endpoints, and counts of rules and skills. URL credentials and query strings are redacted by default. The score summarizes static findings for the inspected files.
  • JSONC & Deep Wrapper Scanning: Parses JSONC comments/trailing commas cleanly and follows relative script imports (scripts/hook.mjs → dist/hook.mjs).
  • Low-Noise A004: Standard https:// MCP endpoints receive 0 score penalty while still appearing in your Capabilities X-Ray; only plaintext http:///ws://, raw IPs, ephemeral tunnels (ngrok, trycloudflare.com), and unpinned npx -y / @latest runners are flagged.
  • CI & GitHub Code Scanning (--sarif): The composite action supports optional SARIF upload. Private repositories need GitHub Code Security enabled to upload. Give each scan a distinct sarif-category when uploading multiple scans from one workflow.
- uses: safelatch-dev/safelatch@v0.3.1
  with:
    path: "."
    fail-on: "high"
    upload-sarif: "true" # requires security-events: write

CI and Git hook recipes cover GitHub Actions, GitLab CI, and staged-file checks before commit.

2. Shell-Aware Pre-Write Snapshot & CLI Rewind (snapshots / diff / restore)

Antigravity’s native /rewind misses shell edits. Before supported tool calls execute, SafeLatch attempts to snapshot recognized workspace files within local storage limits.

  • Captures Both Structured Edits & Shell Mutations:
    • Editor tools: write_file, edit_file, mcp_agy-fast_fast_apply_edits (both edited hunks AND verify shell targets).
    • Shell writes & deletes: output redirections (>, >>, 1>, &>, *>), GNU & macOS BSD sed -i, case-sensitive perl -i, tee, cp / Copy-Item, PowerShell Set-Content / Add-Content / Out-File, rm / Remove-Item / del, mv / Move-Item, git checkout / restore, and mcp_agy-fast_fast_run_checks batches.
  • New-file cleanup (existed: false). Restore removes the recorded file after verifying a safety backup. If a file path has become a directory, restore stops by default.
  • CLI-only restore. Preview with safelatch restore <id> --dry-run. Applying changes requires --yes. Use --force only after inspecting a backup or file-type conflict.
3. Cross-shell runtime guard (PreToolUse)
  • Targeted Self-Defense (G004, deny): Non-downgradable protection prevents runaway agents from running agy plugin disable safelatch, safelatch uninstall, or deleting/overwriting installed ~/.gemini/config/plugins/safelatch, ~/.safelatch/config.json, or .agents/safelatch.json files (including $GEMINI_HOME / $PLUGIN_ROOT / $PLUGIN_DATA token expansion).
  • Cross-Shell Parsing: Unwraps nested sh -c, bash -c, cmd /c, powershell -Command, Base64 -EncodedCommand, $() substitutions, and Windows PowerShell Remove-Item -Recurse -Force / irm ... | iex pipelines.
  • Preserves Antigravity's Native UX (passDecision: "ask"): In Antigravity's PreToolUse protocol, returning {} is treated as a hard deny. SafeLatch defaults unflagged calls to "decision": "ask" so your native "Always Allow" permission flow keeps working untouched (see Hook Protocol Notes).

Comparison

Capability Antigravity Sandbox + /rewind cc-safety-net Static Skill Scanners SafeLatch (v0.3.1)
Offline capability audit and SARIF 2.1.0 — — Partial Yes
Shell-aware file rewind (sed -i, >, tee, Set-Content) Misses shell (#851) — — Yes
Cross-shell (sh / cmd / PowerShell) + G004 self-defense Native hooks Yes — Yes
Preserves native Always Allow + Zero deps / Zero network Built-in Partial Varies Yes

See COMPARISONS.md for architecture trade-offs and guidance on running SafeLatch alongside cc-safety-net or Antigravity Strict Mode.


Non-Goals

  • Not a kernel sandbox: Complements OS containers and Antigravity Terminal Sandbox rather than replacing syscall isolation.
  • Not an LLM prompt-injection firewall: Deterministically checks static rule/skill markdown and gates concrete tool calls without calling any model or cloud API.
  • Never phones home: src/ and dist/ contain zero runtime dependencies and zero network/subprocess imports.

Rule & Configuration Reference

Rule ID Default Decision Scope
G001 deny (non-overridable by workspace) Recursive delete targeting /, ~, system dirs, drive root, or workspace root
G002 deny (non-overridable) Raw disk formatting (mkfs*, diskpart, format X:, dd of=/dev/*)
G003 deny (non-overridable) Shell fork bomb patterns
G004 deny (non-overridable) Self-tampering: agy plugin disable safelatch, safelatch uninstall, or mutating guard plugin/config files
G101 force_ask Destructive Git ops (reset --hard, clean -f, push --force without lease, checkout ., branch -D main)
G102 force_ask Remote download piped into shell/evaluator (curl \| sh, irm \| iex, process substitution)
G103 force_ask Command accesses credentials (.env, .ssh, .aws, .npmrc) or general .agents/hooks.json configs
G104 force_ask Overly permissive chmod -R 777 / a+rwx
G105 force_ask Scoped recursive delete inside workspace
G106 force_ask File write/edit targets sensitive file or path outside workspace/artifact roots
G107 force_ask Nested shell command exceeds the inspection depth
Rule ID Severity What It Detects
A001 critical Remote download piped into shell or eval inside hooks/scripts
A002 critical Obfuscated base64 / -EncodedCommand / atob execution
A003 high Hardcoded local credential or SSH key paths
A004 high / medium Plaintext remote http:///ws:// (high), raw IP or ephemeral tunnel (medium), or unpinned npx -y/@latest/uvx (medium). Standard https:// gets 0 penalty.
A005 high Hardcoded GitHub/OpenAI/AWS/Google/Slack/npm tokens or PEM keys
A006 high Prompt-injection overrides or hidden zero-width/bidi Unicode in rules/skills
A007 high Static PreToolUse hook hardcoding "decision": "allow" without checks
A008 medium / low Bundled native binaries (.exe/.dll/ELF/Mach-O) or >1 MB unreadable scripts
A009 info Missing LICENSE or repository provenance metadata on standalone plugins
# 1. Security & Capability X-Ray
safelatch audit [--path <file-or-dir>] [--workspace <dir>] [--json|--md|--sarif] [--fail-on <severity>]

# 2. Shell-Aware Snapshots & Rewind
safelatch snapshots [--workspace <dir>] [--json]
safelatch diff <snapshot-id> [--workspace <dir>]
safelatch restore <snapshot-id> [--file <rel>] [--dry-run] [--yes] [--force]

# 3. Guard Dry-Run & Plugin Management
safelatch check "<command>" [--json]
safelatch install [--config <dir>] [--skip-enable]
safelatch uninstall [--config <dir>]
safelatch status
  • Read-only MCP tools (safelatch_guard): safelatch_audit, safelatch_snapshots, safelatch_diff, safelatch_check (legacy agy_guard_* tool calls remain supported as aliases).
  • Config precedence: Defaults → Global ($PLUGIN_DATA/config.json or ~/.safelatch/config.json, fallback ~/.agy-guard/config.json) → Workspace (.agents/safelatch.json, fallback .agents/agy-guard.json). Workspace configs cannot set mode: "off", mode: "monitor", passDecision: "allow", or snapshot.enabled: false. Only an explicit global ask-only can downgrade G001–G004 to confirmation.

Security & License

  • See SECURITY.md for the security model, supply-chain SHA pinning policy, and private vulnerability disclosure.
  • Licensed under the MIT License.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • MCP Registry io.github.safelatch-dev/safelatch

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
npm

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229