shell-safety
Skill5 starsChanged 46 days agoMITView on GitHub
use this when writing, reviewing, or running shell or bash — including agent tool commands, CI steps, one-liners, and scripts — classify Always / Ask first / Never before the command runs.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
- buriedsignals/spotlighttheir own version, first seen Aug 26, 2026
- sentineldesk/agenttheir own version, first seen Aug 24, 2026
- chenyinrusi/dsh-engineering-skillstheir own version, first seen Aug 16, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- buriedsignals/spotlight★ 59same name
- aprameyak/coding-skills★ 1same name
- chenyinrusi/dsh-engineering-skills★ 1same name
- sentineldesk/agent★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- maintainers/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- buying-researcherSkill
- cursor-cloud-agents-whenSkill
- debug-anthropicSkill
- debug-pocockSkill
- debugSkill
- discover-the-ideaSkill
- docs-google-styleSkill
- golang-safetySkill
- golang-securitySkill
- golang-testingSkill
- grok-acpSkill
- host-config-pyinfraSkill
- lang-cppSkill
- lang-csharpSkill
- lang-cSkill
- lang-dartSkill
- lang-dockerSkill
- lang-goSkill
- lang-javaSkill
- lang-js-tsSkill
- lang-kotlinSkill
- lang-luaSkill
- lang-makefileSkill
- lang-phpSkill
- lang-powershellSkill
- lang-protobufSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-shellSkill
- lang-sqlSkill
- lang-swiftSkill
- lang-terraformSkill
- language-routerSkill
- lang-web-markupSkill
- modern-pythonSkill
- pr-reviewSkill
- sdlc-artifactsSkill
- sdlc-onboardingSkill
- security-hardeningSkill
- tddSkill
- tracker-sdlcSkill
- ui-craftSkill
- ux-designSkill
- verify-before-doneSkill
- yagniSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
If this skill applies, use it.
- Distinctive: line 87
Stop. Classify. Ask or never — do not run.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shell safety
First-party Always / Ask first / Never for tester and security. Compatible with security-hardening: LLM output is untrusted; encode for the shell sink; the system prompt is not a boundary.
If this skill applies, use it; do not rationalize past the gate. No
scripts/ in this skill dir.
konstruktoid bash-secure is reference only — do not install or copy that pack.
Iron law
No shell command runs until it is classified Always, Ask first, or Never.
Model-chosen commands, generated scripts, and $(...) from untrusted text are client input.
Always
| Rule | Why |
| Read the command before it runs | You cannot classify what you have not read |
set -euo pipefail and IFS=$'\n\t' on scripts | Fail closed on error, unset, and pipe fail |
Quote "$var" and "$@" | Word-split and glob are injection |
Arrays, then "${args[@]}" | Do not build command strings |
${path:?} before rm / mv / chmod on a variable path | Empty path becomes / or cwd |
[[ ]] tests; printf not echo for untrusted text | [ and echo are footguns |
mktemp plus trap cleanup | Predictable temps; no /tmp/foo races |
cd -- "$dir" || exit | Failed cd must not continue |
| ShellCheck on committed scripts (tester) | Static catch before CI |
| Allowlist / encode before model text reaches a shell | Same as security-hardening encode-for-sink |
| Workspace-scoped paths; non-interactive flags | Agents must not hang or roam |
Ask first
| Topic | Why it is a stop |
| Elevated shell, setuid, new capabilities | Privilege is a trust-boundary widen |
| Recursive force-remove / wipe outside the repo or this task's temp dir | Blast radius |
| Pipe remote content into a shell; unpinned vendor installers | INTAKE: clone, do not run installers |
| Force-push, history rewrite, deleting shared remote branches | Irreversible git |
Writes under home, /etc, or credential dirs | Secrets and host config |
| New network egress or piping remote content | New trust |
Disabling strict mode (set +e and kin) for a whole script | Fail-open |
| Running an opaque script you have not read | Same as untrusted client input |
Record the decision. Do not self-except.
Never
| Never | Why |
Dynamic shell evaluation of user or model text (eval / -c / source of untrusted input) | Injection; security-hardening Never |
| Pipe unpinned remote script into a shell | Supply chain |
| Recursive force-remove of filesystem root or unguarded variable paths; unquoted destructive globs | Host wipe |
| Secrets in scripts, git, or command lines that will be logged | History is forever |
Copy scripts/ into a skill dir | INTAKE quarantine |
| Extra hosts / Windows outside the workspace without operator approval | Host lock |
| Personal finance, mail, or password-manager via shell | Out of agent scope |
| Bind all interfaces or public mesh from a one-liner | Network becomes the client |
| World-writable mode bits on secrets | Data-class fail |
Host and personal-account locks are Never, not Ask first.
Roles
| Role | Owns | Does not own |
| security | This gate at Spec and Review when shell touches a boundary; skill intake | Writing tester CI yaml |
| tester | ShellCheck hooks when .sh appears | Skipping security because CI is green |
| builder | Classifying commands before they run | Self-excepting “just this once” |
| manager | After-act | Blessing a ship that skipped the gate |
Workers do not bypass security (SDLC roles). A green ShellCheck is not a security clear.
Red flags
- “The model said the command is safe”
- “I’ll pipe remote content into a shell just this once”
- “Elevated shell is faster than asking”
- “Empty path is fine”
- “The extra host is convenient”
Stop. Classify. Ask or never — do not run.
Upstream pin
Intent: obra/superpowers using-superpowers @ b36e0829c6d0140e93cfef2ca599b1b07d4a7797. Body is first-party. See SOURCES.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

