AGENT SKILL

suggest-fixes

Suggest concrete code fixes for SkillGuard security findings — generate remediation patches

License 许可
MIT
最近更新
2026-04-04
Stars
★ 1
Forks
0

01 前言 Front Matter

description
Suggest concrete code fixes for SkillGuard security findings — generate remediation patches
allowed-tools
[ "Bash", "Read", "Glob", "Grep", "Edit", "Write" ]

03 SKILL.md 正文

Suggest Fixes for SkillGuard Findings

Reads SkillGuard scan findings and generates concrete code fixes. Can either suggest fixes or directly apply them with user approval.

Usage

  1. Generate a JSON report:

    npx skillguard <target> --json report.json
    
  2. Ask to fix the findings. Read the report and the source files to generate patches.

Fix Strategies by Dimension

Prompt Injection

  • Remove injection phrases from prompts
  • Use structured prompt templates instead of string concatenation
  • Remove zero-width characters with text sanitization

Permission Escalation

  • Remove dangerouslyDisableSandbox — run in sandbox
  • Replace sudo with user-level operations
  • Change chmod 777 to chmod 755 or 644
  • Add allowed-tools to SKILL.md frontmatter

Data Exfiltration

  • Isolate env var reads from network requests
  • Add URL allowlists for outbound HTTP
  • Remove direct .env file reading — use injected env vars

Destructive Operations

  • Add path allowlist validation before rm -rf
  • Replace git push --force with --force-with-lease
  • Add confirmation prompts before destructive ops

Supply Chain

  • Pin dependency versions: package@1.2.3 instead of package
  • Replace curl | bash with download-then-review-then-execute
  • Add @sha256: digests to Docker FROM statements

Code Security

  • Replace shell=True with shell=False and argument lists
  • Replace eval() with JSON.parse() or safe alternatives
  • Use parameterized SQL queries instead of f-strings

Credential Leaks

  • Move hardcoded secrets to environment variables
  • Add .env to .gitignore
  • Replace hardcoded API keys with process.env.KEY_NAME

Least Privilege

  • Add allowed-tools frontmatter listing only needed tools
  • Split skills with shell+network+write into focused sub-skills

License Compliance

  • Check dependency license compatibility
  • Add license declarations to SKILL.md frontmatter

Resource Abuse

  • Add maxIterations or timeout to loops
  • Set reasonable retry limits with exponential backoff
  • Add recursion depth limits

Workflow

  1. Read the JSON report to identify findings
  2. Read each affected source file
  3. For each finding, propose a minimal, targeted fix
  4. Apply fixes with Edit tool (with user approval)
  5. Re-run npx skillguard <target> to verify the fix reduced the risk score

04 同仓库更多 Skills