frmoretto/hardstop

27 stars · Last commit 2026-04-18

Don't let AI destroy your hard work! HardStop is a rock-solid protection for AI-generated commands. Pre-execution safety validation for Claude Code, Claude Cowork. Catches dangerous commands before they run: whether from AI mistakes, hallucinations, prompt injection, or misunderstood instructions. Seatbelts for the agentic AI era.

README preview

# 🛑 Hardstop

[![npm version](https://img.shields.io/npm/v/hardstop.svg)](https://www.npmjs.com/package/hardstop)
[![npm downloads](https://img.shields.io/npm/dm/hardstop.svg)](https://www.npmjs.com/package/hardstop)
[![GitHub stars](https://img.shields.io/github/stars/frmoretto/hardstop?style=social)](https://github.com/frmoretto/hardstop/stargazers)
[![license](https://img.shields.io/npm/l/hardstop.svg)](LICENSE)
[![node](https://img.shields.io/node/v/hardstop.svg)](https://www.npmjs.com/package/hardstop)
[![Tests](https://github.com/frmoretto/hardstop/workflows/Tests/badge.svg)](https://github.com/frmoretto/hardstop/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/frmoretto/hardstop/branch/main/graph/badge.svg)](https://codecov.io/gh/frmoretto/hardstop)
[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![Platform](https://img.shields.io/badge/platform-macOS_%7C_Linux_%7C_Windows-lightgrey)](https://github.com/frmoretto/hardstop)
[![SLSA Provenance](https://img.shields.io/badge/SLSA-Build_Provenance-green?logo=sigstore)](https://github.com/frmoretto/hardstop/attestations)

> 👉 **[⭐ Star on GitHub](https://github.com/frmoretto/hardstop)** if Hardstop keeps you safe!

Pre-execution safety validation for AI coding agents. Validates every shell command against 428 security patterns before execution — blocking destructive operations, credential theft, infrastructure teardown, and prompt injection. Fail-closed: blocks by default when uncertain.

**Ecosystem:** The detection patterns are published separately as [hardstop-patterns](https://www.npmjs.com/package/hardstop-patterns) ([GitHub](https://github.com/frmoretto/hardstop-patterns)) — reusable in any Node.js tool.

[Installation](#-installation) • [How It Works](#%EF%B8%8F-how-it-works) • [Commands](#%EF%B8%8F-controls) • [Report Issue](https://github.com/frmoretto/hardstop/issues)

View full repository on GitHub →