█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

CC Safety Net

एक प्री-एक्ज़ीक्यूशन गार्ड, जो कोडिंग एजेंट्स को विनाशकारी कमांड चलाने या सीक्रेट्स पढ़ने से रोकता है

Guardrails & Securityओपन सोर्स
ताज़ा
v2.4.12
अपडेट किया गया
29 सित॰ 2026
भाषा
TypeScript
लाइसेंस
MIT
$npx -y cc-safety-net@latest install

नया क्या है

v2.4.1229 सित॰ 2026

v2.4.12 made a refused working directory explain which directory and why instead of a generic failed-closed message, and removed false denials for agents working in a scratch directory under the temp root.

संक्षेप में

CC Safety Net क्या है?

CC Safety Net एक प्री-एक्ज़ीक्यूशन गार्ड, जो कोडिंग एजेंट्स को विनाशकारी कमांड चलाने या सीक्रेट्स पढ़ने से रोकता है. यह Evaluation & Production Ops टूल्स की Guardrails & Security श्रेणी में आता है; ओपन सोर्स है, TypeScript में लिखा गया है और MIT लाइसेंस के तहत है। शुरू करने के लिए: अपने coding CLIs में इंस्टॉल करें.

अपडेट किया गया Markdown वर्शन ↗

सारांश

CC Safety Net (Coding CLI Safety Net) AI कोडिंग एजेंट और शेल के बीच बैठता है। टूल कॉल चलने से पहले, यह विश्लेषण करता है कि कमांड असल में क्या करती है, और अगर वह काम को नष्ट करेगी तो उसे अस्वीकार कर देता है — `git reset --hard`, `git push --force`, खतरनाक लक्ष्यों पर `rm -rf`, `find -delete`, PowerShell `Remove-Item` — या SSH keys, `.env` फ़ाइलों, `~/.aws` और उन credential फ़ाइलों जैसे सीक्रेट्स को छूती है जो coding CLIs रखते हैं। चूँकि यह स्ट्रिंग मिलान के बजाय कमांड को पार्स करता है, इसलिए इसे `bash -c` या `python -c` में लपेटने या flags का क्रम बदलने से यह छिपता नहीं, और टूटी हुई config फ़ाइल से कुछ भी ब्लॉक नहीं होता।

यह Amp Code, Antigravity CLI, Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot CLI, Grok Build, Hermes Agent, Kimi Code, OpenClaw, OpenCode और Pi में hook के रूप में इंस्टॉल होता है, और Windows, macOS व Linux पर चलता है (प्रोजेक्ट नोट करता है कि कुछ CLIs के लिए Windows सपोर्ट सर्वोत्तम प्रयास के आधार पर है और अभी टेस्ट नहीं किया गया है)। तीन सेफ़्टी प्रीसेट सख्ती तय करते हैं: सामान्य कोडिंग के लिए Standard, Strict जो उन dynamic या पार्स न हो सकने वाली कमांड्स को भी ब्लॉक करता है जिन्हें analyser सत्यापित नहीं कर सकता, और Paranoid जो इसके अलावा प्रोजेक्ट के भीतर `rm -rf` और interpreter one-liners को भी ब्लॉक करता है।

नीति को स्थानीय web GUI में संपादित किया जा सकता है, rulebooks से इसे बढ़ाया जा सकता है (Terraform, AWS, gcloud और Azure के आधिकारिक packs, या आपकी अपनी JSON फ़ाइल), जो केवल ब्लॉक जोड़ सकते हैं, और `.cc-safety-net/` फ़ोल्डर commit करके इसे टीम के साथ साझा किया जा सकता है। प्रोजेक्ट अपने दायरे को लेकर साफ़ है: यह tool call चलने से पहले उसे अस्वीकार करता है, लेकिन यह filesystem permissions सेट नहीं करता, network egress पर नज़र नहीं रखता या किसी process को contain नहीं करता — इसके docs इसके लिए OS permissions या sandbox की ओर इशारा करते हैं। यह TypeScript में लिखा गया है और MIT license के तहत जारी है।

यह क्या करता है

  • सेमांटिक कमांड विश्लेषण, जो `bash -c` या `python -c` के भीतर नेस्टेड होने पर भी विनाशकारी Git और filesystem ऑपरेशन्स को ब्लॉक करता है
A Claude Code terminal where a Bash call to git reset --hard is rejected with 'Error: BLOCKED by Safety Net', a reason suggesting git stash first, and the agent asking the user for explicit confirmation
What the agent sees when it tries `git reset --hard`: the call is denied with a reason, and the agent has to ask you instead.CC Safety Net repository ↗
  • SSH keys, `.env` फ़ाइलों, `~/.aws` और CLI credential फ़ाइलों के लिए सीक्रेट सुरक्षा, जो शेल और एजेंट के read, edit, write और search टूल्स दोनों पर लागू होती है
  • Standard, Strict और Paranoid प्रीसेट, साथ ही हर नियम के लिए toggles और एक स्थानीय web GUI में allow/deny paths
  • सिर्फ़ जोड़ने वाले (add-only) rulebooks, जिनमें आधिकारिक Terraform, AWS, gcloud और Azure packs शामिल हैं
  • Diagnostics — `status`, `doctor`, `explain` ट्रेस और कमांड फ़ैसलों का स्थानीय audit log
  • एक Node.js library API (`checkCommand`), जिससे आप hook के बिना अपने कोड से allow/deny फ़ैसला पा सकते हैं

शुरू करें

CC Safety Net को Node.js 18 या उससे ऊपर चाहिए। एक कमांड इसे मशीन पर मिलने वाले coding CLIs में इंस्टॉल कर देती है; इसके बाद diagnostics कमांड्स पुष्टि करते हैं कि क्या लागू (enforce) हो रहा है।

अपने coding CLIs में इंस्टॉल करें

`@latest` qualifier बनाए रखें — सिर्फ़ `cc-safety-net` spec npx cache से पुरानी कॉपी चला सकता है। `npm install -g cc-safety-net` `ccsn` alias भी इंस्टॉल करता है।

bashbash
npx -y cc-safety-net@latest install

इंस्टॉलेशन की जाँच करें

`status` बताता है कि क्या लागू है, `doctor` एक self-test चलाता है, और `explain` दिखाता है कि कमांड का विश्लेषण चरण-दर-चरण कैसे होता है। `doctor`, `explain` और `logs` `--json` स्वीकार करते हैं।

bashbash
npx cc-safety-net status
npx cc-safety-net doctor
npx cc-safety-net explain "git reset --hard"

ब्लॉक की समीक्षा करें और policy ट्यून करें

`logs` स्थानीय audit trail से दर्ज की गई denials दिखाता है (allowed कमांड भी शामिल करने के लिए `--all` जोड़ें)। GUI का Policy पेज preset सेट करता है और अलग-अलग नियमों को toggle करता है; `/` या `~` को मिटाने वाले नियम बंद नहीं किए जा सकते।

bashbash
npx cc-safety-net logs
npx cc-safety-net gui
The CC Safety Net web GUI overview page showing the hook active in Amp Code, Cursor and OpenCode, seven-day charts of blocked and analyzed commands, and a protection status panel with the Standard preset and secret protection on
The local GUI opened by `npx cc-safety-net gui`, with Activity, Policy, Rules and Integrations pages in the sidebar.CC Safety Net repository ↗

Rulebooks जोड़ें और इसे अपडेट रखें

Rulebooks केवल ब्लॉक जोड़ सकते हैं, built-in सुरक्षा हटा नहीं सकते। `update` हर इंस्टॉल किए गए integration को अपग्रेड करता है।

bashbash
npx -y cc-safety-net rule add --only terraform aws --global
npx -y cc-safety-net@latest update

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • कोडिंग एजेंट को कम permission prompts के साथ चलने दें, और फिर भी यह रोकें कि वह commit न हुए काम को मिटा दे या force-push करे
  • एजेंट के shell और file टूल्स के ज़रिए SSH keys, `.env` फ़ाइलों और cloud credentials को उसकी पहुँच से बाहर रखें
  • `.cc-safety-net/` को repository में commit करके एक ही सेफ़्टी policy को पूरी टीम और cloud sessions में साझा करें
  • `checkCommand` library API से अपने खुद के agent harness में कमांड्स पर gate लगाएँ

How CC Safety Net compares

CC Safety Net alongside other open-source guardrails & security tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
SkillSpector★ 28.6kइंस्टॉल करने से पहले कोई agent skill दुर्भावनापूर्ण पैटर्न के लिए स्कैन करें
Presidio★ 12.2kटेक्स्ट, इमेज और स्ट्रक्चर्ड डेटा में PII की पहचान करें और उसे हटाएं
Failproof AI★ 10.5kएक policy API, जो Claude Code, Codex, Cursor और नौ अन्य agent harnesses से जुड़कर हर event पर agent को block, warn या steer करता है
Guardrails AI★ 7.7kPython में कंपोज़ेबल गार्ड्स से LLM के इनपुट और आउटपुट वैलिडेट करें
NeMo Guardrails★ 7.6kLLM चैट ऐप्स में programmable rails जोड़ें, ताकि वे सुरक्षित रहें और विषय पर बनी रहें
BLA (Blind LLM Agents)★ 7.5kआपके रिलीज़ किए गए build को इतना मज़बूत बनाएं कि AI reverse-engineering agents का बजट खत्म हो जाए और वे नकली चीज़ों के पीछे भागें
dcg (Destructive Command Guard)★ 6.4kएक Rust pre-tool hook जो coding agent के चलाने से पहले destructive shell और git commands को ब्लॉक करता है
CC Safety Net★ 2.2kएक प्री-एक्ज़ीक्यूशन गार्ड, जो कोडिंग एजेंट्स को विनाशकारी कमांड चलाने या सीक्रेट्स पढ़ने से रोकता है