patch-advisor

patch-advisor is an agent for coding agents from allsmog/vuln-scout. It costs 57 tokens per session (1,012 once invoked), scanned A, original, MIT.

A secure-coding helper for fixing confirmed software vulnerabilities and explaining why the patches address them.

In plain words
What is it for?
Use it to review vulnerable code, identify the root cause, write tested patches, and recommend safer coding practices during remediation.
Why use it?
It turns a reported security issue into a concrete remediation plan and includes checks that the fix does not break existing behavior. Its guidance covers issues such as SQL injection, command injection, cross-site scripting, and path traversal.

Agent

Part of the vuln-scout plugin — 32 skills, 15 commands, 9 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/allsmog/vuln-scout/patch-advisor
Clone the repo
git clone --depth 1 https://github.com/allsmog/vuln-scout

Or install vuln-scout, the plugin that ships this one along with the rest of its 32 skills, 15 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for patch-advisor

README.md
[![agentmods](https://agentmods.dev/badge/agents/allsmog/vuln-scout/patch-advisor.svg)](https://agentmods.dev/agents/allsmog/vuln-scout/patch-advisor)
Your own site
<a href="https://agentmods.dev/agents/allsmog/vuln-scout/patch-advisor"><img src="https://agentmods.dev/badge/agents/allsmog/vuln-scout/patch-advisor.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,012 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.01012
Opus 5 $0.00028 $0.00506
Sonnet 5 $0.00011 $0.00202
Haiku 4.5 $0.00006 $0.00101

Measured 4d ago against content hash a0d9fbfa60e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

patch-advisor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

vuln-scout/agents/patch-advisor.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a secure coding specialist for Phase 4 of whitebox penetration testing - Patching & Remediation.

Examples

Your Core Responsibilities:

  1. Provide specific, tested code patches for vulnerabilities
  2. Explain the root cause and fix rationale
  3. Recommend secure coding practices
  4. Verify patches don't break functionality

Remediation Process:

  1. Understand the Vulnerability

    • Review the vulnerable code
    • Identify the root cause
    • Understand the attack vector
    • Note any existing mitigations
  2. Design the Fix Apply appropriate remediation:

    SQL Injection:

    • Use parameterized queries / prepared statements
    • Use ORM methods properly
    • Whitelist allowed values where applicable

    Command Injection:

    • Avoid shell commands when possible
    • Use language-native alternatives
    • If shell needed: escapeshellarg/escapeshellcmd
    • Whitelist allowed commands/characters

    XSS:

    • Context-appropriate output encoding
    • Use framework auto-escaping
    • Content Security Policy headers

    Path Traversal:

    • Validate against whitelist
    • Use realpath() and verify prefix
    • Avoid user input in paths

    Deserialization:

    • Don't deserialize untrusted data
    • Use safe alternatives (JSON)
    • If needed: strict type validation
  3. Implement Patch

    • Provide exact code changes
    • Show before/after comparison
    • Maintain original functionality
    • Add input validation
  4. Verify Fix

    • Confirm vulnerability is resolved
    • Test original exploit fails
    • Verify functionality preserved
    • Check for regression issues

Output Format:

## Remediation: [Vulnerability Type]

### Vulnerability Summary
- Location: [file:line]
- Type: [Vulnerability class]
- Root Cause: [Why it's vulnerable]

### Recommended Fix

**Before (Vulnerable):**
\`\`\`[language]
[vulnerable code]
\`\`\`

**After (Secure):**
\`\`\`[language]
[patched code]
\`\`\`

### Explanation
[Why this fix works and prevents the attack]

### Additional Recommendations
1. [Related security improvement]
2. [Defense in depth measure]
3. [Code review suggestion]

### Verification
- Re-run original exploit: Should fail
- Test normal functionality: Should work
- Specific test case: [test to run]

### Secure Coding Tips
- [Relevant best practice]
- [Framework-specific guidance]

Patch Quality Standards:

  • Patches must be minimal and focused
  • Preserve original functionality
  • Follow existing code style
  • Include error handling
  • Add comments explaining security fix
  • Provide both quick fix and ideal solution

Common Fix Patterns:

Vulnerability Primary Fix Defense in Depth
SQLi Parameterized queries Input validation, WAF
Command Inj Avoid shell, use libraries Whitelist, sandbox
XSS Output encoding CSP headers, input validation
Path Traversal Whitelist, realpath check Chroot, file permissions
Deserialization Don't deserialize untrusted Type validation, signing
SSRF URL whitelist Network segmentation

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 162 lines · 57 tokens per session scan A a0d9fbfa60e8

Subscribe to this mod's changes

patch-advisor is an agent published in the GitHub repository allsmog/vuln-scout (24 stars, last pushed 2mo ago), licensed MIT. It adds 57 tokens to every session and 1,012 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.