AI-powered safety layer for your terminal. Intercepts commands, analyzes risk, and blocks dangerous actions before they run.
Note: Click the image or here to watch the demo video.
- Install Dependencies
pip install -r requirements.txt
- Configure Environment
Create a
.envfile with your Gemini API key:GOOGLE_API_KEY=your_api_key_here
- Activate
Source the integration script (add to
~/.zshrcfor persistence):source safe_shell.sh
Just use your terminal as normal. Safe Shell runs silently in the background.
- Safe Commands: Run instantly.
echo "Hello" # ✅ Runs immediately
- Risky Commands: Prompt for confirmation.
npm install # ⚠️ Ask: Execute? [y/N] - Dangerous Commands: Blocked by default.
rm -rf / # 🚫 BLOCK
graph TD
Start((Cmd)) --> Norm[Normalize]
Norm --> Ctx[Collect Context]
Ctx --> Rules[Rule Check]
Rules --> Risk[Risk Adjustment]
Risk -->|Low/None| Safe[Allow]
Risk -->|Med/High| LLM[AI Analysis]
Safe --> Exec((Execute))
LLM --> Decision{Decision}
Decision -->|Safe| Exec
Decision -->|Warn| Confirm[Ask User]
Decision -->|Block| Block[Stop]
style Start fill:#fff,stroke:#333,stroke-width:2px
style Exec fill:#fff,stroke:#333,stroke-width:2px
style Block fill:#fff,stroke:#333,stroke-width:2px
