agentleFS
jacksonwilliamsvajacksonwilliamsva/kiro-skills-library/skills/security-guidance/SKILL.md

security-guidance

Skill2 starsChanged 7 months agoMITView on GitHub

Security pattern awareness for code edits. Use when writing or reviewing code that touches security-sensitive patterns — shell commands, eval, innerHTML, GitHub Actions workflows, deserialization, or user-controlled input. Automatically checks for common vulnerability patterns and suggests safer alternatives.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When writing or reviewing code, check for these security patterns and apply the corresponding guidance.

    line 6
  2. Very specific:

    When editing .github/workflows/*.yml or *.yaml:

    line 12
  3. Very specific:

    Command injection: Never use untrusted input directly in run: commands

    line 14
  4. Distinctive:

    Use environment variables instead of inline expressions:

    line 15
  5. Very specific:

    When code uses child_process.exec, exec(), execSync(), os.system, or subprocess.call(shell=True):

    line 29
  6. Very specific:

    Prefer execFile / subprocess.run([...]) with argument arrays over shell string interpolation

    line 31
  7. Distinctive:

    Never interpolate user input into shell strings

    line 32
  8. Distinctive:

    If shell features are truly needed, validate and escape all inputs

    line 33
  9. Very specific:

    When code uses eval(), new Function(), or equivalent:

    line 37
  10. Distinctive:

    Only use these if you truly need dynamic code evaluation and input is guaranteed safe

    line 41
  11. Very specific:

    When code uses dangerouslySetInnerHTML, .innerHTML =, or document.write():

    line 45
  12. Very specific:

    When code uses pickle, yaml.load() (without SafeLoader), or Marshal.load:

    line 53
  13. Very specific:

    Use yaml.safe_load() instead of yaml.load()

    line 56
  14. Distinctive:

    Only use unsafe deserialization when the source is fully trusted

    line 57
  15. Distinctive:

    When you encounter any of these patterns while writing or editing code, pause and note the security concern inline

    line 61
  16. Distinctive:

    If the unsafe pattern is genuinely needed, add a comment explaining why it's safe in this context

    line 63
  17. Distinctive:

    Do not block work — flag, suggest, and move on

    line 64
  18. Distinctive:

    When you hear (or think) any of these, push back:

    line 68

“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.

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

When writing or reviewing code, check for these security patterns and apply the corresponding guidance. Flag issues inline as you encounter them — do not wait until the end.

Security Patterns

GitHub Actions Workflows

When editing .github/workflows/*.yml or *.yaml:

  • Command injection: Never use untrusted input directly in run: commands
  • Use environment variables instead of inline expressions:
    # UNSAFE
    run: echo "${{ github.event.issue.title }}"
    
    # SAFE
    env:
      TITLE: ${{ github.event.issue.title }}
    run: echo "$TITLE"
  • Risky inputs: github.event.issue.body, github.event.pull_request.title, github.event.pull_request.body, github.event.comment.body, github.event.review.body, github.event.commits.*.message, github.event.head_commit.message, github.head_ref

Shell Command Injection

When code uses child_process.exec, exec(), execSync(), os.system, or subprocess.call(shell=True):

  • Prefer execFile / subprocess.run([...]) with argument arrays over shell string interpolation
  • Never interpolate user input into shell strings
  • If shell features are truly needed, validate and escape all inputs

Code Evaluation

When code uses eval(), new Function(), or equivalent:

  • eval() executes arbitrary code — use JSON.parse() for data parsing
  • new Function() with dynamic strings enables code injection
  • Only use these if you truly need dynamic code evaluation and input is guaranteed safe

XSS Vectors

When code uses dangerouslySetInnerHTML, .innerHTML =, or document.write():

  • dangerouslySetInnerHTML: sanitize with DOMPurify or equivalent before rendering
  • .innerHTML: use textContent for plain text, or sanitize HTML content
  • document.write(): use createElement() / appendChild() instead

Deserialization

When code uses pickle, yaml.load() (without SafeLoader), or Marshal.load:

  • pickle with untrusted data enables arbitrary code execution — use JSON or safe serialization
  • Use yaml.safe_load() instead of yaml.load()
  • Only use unsafe deserialization when the source is fully trusted

Behaviour

  • When you encounter any of these patterns while writing or editing code, pause and note the security concern inline
  • Suggest the safer alternative
  • If the unsafe pattern is genuinely needed, add a comment explaining why it's safe in this context
  • Do not block work — flag, suggest, and move on

Anti-Rationalization Table

When you hear (or think) any of these, push back:

RationalizationReality
"It's an internal tool"Internal tools get compromised. Attackers move laterally.
"We'll add security later"Security debt compounds. Retrofitting auth is 10x harder than building it in.
"The input is trusted"All input is untrusted until validated. Trust boundaries shift.
"It's behind a VPN"VPNs get breached. Defense in depth means every layer validates.
"Nobody would exploit this"Automated scanners don't care about your threat model. Secure by default.
"The framework handles it"Frameworks provide tools, not guarantees. Verify the framework's security is configured correctly.

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.