
safeshell
Intercepts the command before the shell runs it. No telemetry.
The problem
It is not a problem of knowing what a command does — it is a problem of context. rm -rf ~/project is harmless in development and catastrophic if you are on the production server you access over SSH. Same command, same muscle memory, radically different consequences depending on where you are. Existing security tools either add friction in all cases or require you to remember to activate "careful" mode. safeshell infers the context.
The data
No dataset: systems tool. The input is the process state at execution time — current directory, environment variables, git state, session type (local vs SSH, development vs production env).
Approach
- Pre-execution hook in bash, zsh and fish: intercepts the command before it reaches the shell, without modifying PATH or wrapping binaries
- Real-time context analysis: are there uncommitted changes? Are you on SSH? Is NODE_ENV "production"? Is the directory under git?
- Three configurable response levels per rule: warn (visible log, command runs), confirm (waits for explicit yes/no), block (command does not run)
- Declarative rule file configuration — no code changes, no recompilation
- Zero telemetry: no network calls, no external logs, nothing — the binary opens no sockets
Tools
Result
In daily use for months. The three rules that have saved me the most times: confirm rm -rf when HOME is in the path, block git push --force on any branch that is not a personal branch, confirm git reset --hard when there are unstaged changes. Without any of them I would have deleted things.
Next steps
The current configuration is a static rule file. The most useful extension would be a plugin system that allows rules with arbitrary logic in Lua or Wasm without recompiling the binary — for rules that depend on syscalls or the state of external services.