agentleFS
ihgalisihgalis/agentic-ai-tweaks/skills/script-security-review/SKILL.md

script-security-review

Skill0 starsChanged 6 months agoMITView on GitHub

Use whenever creating, rewriting, or materially changing scripts, shell commands, cron jobs, backup/restore tooling, deployment helpers, or automation. Forces a focused security review before the work is considered complete.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill before finishing any new or materially changed script or automation.

    line 9
  2. Distinctive:

    Check operational safety: fail-closed behavior, cleanup on every exit path, dry-run/help behavior, logging without secrets, clear errors, …

    line 15
  3. Distinctive:

    Prefer arrays over string-built commands.

    line 21
  4. Distinctive:

    Use set -Eeuo pipefail for scripts where it fits the repo's style.

    line 23
  5. Distinctive:

    Create temp files/dirs with mktemp.

    line 25
  6. Distinctive:

    Use -- before path operands when supported.

    line 27
  7. Distinctive:

    Avoid eval, untrusted source, command strings passed through sh -c, and unpinned network execution.

    line 28
  8. Distinctive:

    Do not log secrets, tokens, passphrases, or full sensitive paths unless Andre explicitly asks.

    line 29
  9. Distinctive:

    When the user asked for security analysis, lead with findings by severity:

    line 33
  10. Distinctive:

    If no issue remains, say that clearly and list residual risks or assumptions.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Script Security Review

Use this skill before finishing any new or materially changed script or automation.

Required Workflow

  1. Identify trust boundaries: user arguments, environment variables, config files, filenames, archive contents, network input, command output, cron/systemd context, and inherited permissions.
  2. Review dangerous behaviors: command injection, shell expansion, unsafe eval/source, globbing surprises, word splitting, path traversal, symlink/hardlink attacks, unsafe temp files, plaintext secret exposure, weak permissions, recursive deletion, archive extraction, network downloads, and privilege escalation.
  3. Check operational safety: fail-closed behavior, cleanup on every exit path, dry-run/help behavior, logging without secrets, clear errors, dependency checks, idempotency, and rollback/recovery where practical.
  4. Fix concrete issues before declaring the script done.
  5. Reevaluate the changed code and report whether each mitigation succeeded.

Shell/Bash Baseline

  • Prefer arrays over string-built commands.
  • Quote variable expansions unless intentional word splitting is required and explained.
  • Use set -Eeuo pipefail for scripts where it fits the repo's style.
  • Set restrictive permissions for secret-bearing files and staging dirs.
  • Create temp files/dirs with mktemp; clean them with a trap.
  • Validate paths before deletion or archive extraction; reject empty, root, home, or broad paths unless explicitly intended.
  • Use -- before path operands when supported.
  • Avoid eval, untrusted source, command strings passed through sh -c, and unpinned network execution.
  • Do not log secrets, tokens, passphrases, or full sensitive paths unless Andre explicitly asks.

Report Format

When the user asked for security analysis, lead with findings by severity:

  • Critical/High/Medium/Low: issue, impact, and affected file/line.
  • Fix: what changed.
  • Recheck: why the mitigation now holds.

If no issue remains, say that clearly and list residual risks or assumptions.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.