safety-guard
यह क्या करती है
यह AI agent आपके काम के लिए बॉडीगार्ड की तरह काम करता है। यह गलती से चलने वाले खतरनाक commands को रोकता है और AI के बदलाव सिर्फ़ आपके project के किसी खास हिस्से तक सीमित रख सकता है।
कब इस्तेमाल करें
- ✓जब आप ज़रूरी (production) systems पर काम कर रहे हों।
- ✓जब आप चाहते हों कि AI किसी सीमित क्षेत्र में अकेले काम करे।
- ✓ज़रूरी updates या data में बदलाव के दौरान।
Skill का लिंक
https://github.com/affaan-m/ECC/blob/main/skills/safety-guard/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे project को खतरनाक commands से बचाओ और edits को 'src/components/' folder तक सीमित रखो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह AI के commands चलाने से पहले उन्हें जाँचता है। अगर कोई command खतरनाक है (जैसे सब कुछ मिटा देना) या AI अनुमति वाले क्षेत्र के बाहर कुछ बदलने की कोशिश करता है, तो यह रुककर आपकी पुष्टि माँगता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Safety Guard — Prevent Destructive Operations
When to Use
- When working on production systems
- When agents are running autonomously (full-auto mode)
- When you want to restrict edits to a specific directory
- During sensitive operations (migrations, deploys, data changes)
How It Works
Three modes of protection:
Mode 1: Careful Mode
Intercepts destructive commands before execution and warns:
Watched patterns:
- rm -rf (especially /, ~, or project root)
- git push --force
- git reset --hard
- git checkout . (discard all changes)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish (accidental publishes)
- Any command with --no-verify
When detected: shows what the command does, asks for confirmation, suggests safer alternative.
Mode 2: Freeze Mode
Locks file edits to a specific directory tree:
/safety-guard freeze src/components/
Any Write/Edit outside src/components/ is blocked with an explanation. Useful when you want an agent to focus on one area without touching unrelated code.
Mode 3: Guard Mode (Careful + Freeze combined)
Both protections active. Maximum safety for autonomous agents.
/safety-guard guard --dir src/api/ --allow-read-all
Agents can read anything but only write to src/api/. Destructive commands are blocked everywhere.
Unlock
/safety-guard off
Implementation
Uses PreToolUse hooks to intercept Bash, Write, Edit, and MultiEdit tool calls. Checks the command/path against the active rules before allowing execution.
Integration
- Enable by default for
codex -a neversessions - Pair with observability risk scoring in ECC 2.0
- Logs all blocked actions to
~/.claude/safety-guard.log
अक्सर पूछे जाने वाले सवाल
यह किस तरह के खतरनाक commands को रोकता है?
यह ऐसे commands रोकता है जैसे 'सब कुछ मिटा दो' (rm -rf), version control systems में forcing pushes (git push --force), और database tables को हटाना (DROP TABLE)।
सुरक्षा बंद कैसे करूँ?
'/safety-guard off' टाइप करके आप यह सुरक्षा बंद कर सकते हैं।
क्या AI सब कुछ पढ़ सके लेकिन सिर्फ़ एक जगह लिखे, ऐसा हो सकता है?
हाँ, 'Guard Mode' यही करता है। आप एक folder बता सकते हैं जहाँ AI लिख सकता है, लेकिन वह project के बाकी हिस्सों में बदलाव नहीं कर पाएगा।
जानकारी
लेखक का मूल विवरण
Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both via PreToolUse hooks. Use when working on production systems, running agents autonomously, restricting edits to a directory, or during migrations, deploys, and data changes.
repo: affaan-m/ECC
लोकप्रियता
- GitHub स्टार
- 280k
- रैंकिंग में स्थान
- #397
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
accessibility
280kयह आपके एजेंट को ऐसे इंटरफ़ेस बनाने में मदद करता है जिन्हें हर कोई इस्तेमाल कर सके। यह पक्का करता है कि वेबसाइट और ऐप दिव्यांग लोगों के लिए भी अच्छे से काम करें, जैसे नेत्रहीन या जिन्हें चलने-फिरने में दिक्कत होती है।
agent-architecture-audit
280kयह आपके एजेंट को जाँचने देता है कि सब कुछ सही से चल रहा है। यह AI सिस्टम में समस्याएँ ढूँढकर ठीक करता है, ताकि वे उम्मीद के मुताबिक काम करें।
agent-eval
280kयह आपके एजेंट को अलग-अलग AI coding tools की तुलना करने में मदद करता है। यह मापता है कि किसी खास काम के लिए कौन सा टूल ज़्यादा तेज़, सस्ता और भरोसेमंद है।
agent-harness-construction
280kयह आपके एजेंट को काम कैसे करना है, यह बेहतर समझने में मदद करता है। यह उन tools और instructions को बेहतर बनाता है जिनका एजेंट इस्तेमाल करता है, ताकि उसकी सफलता की संभावना बढ़े।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।