fix-security

fix-security is a command for Claude Code from sinewaveai/agent-security-scanner-mcp. It costs 0 tokens per session (422 once invoked), scanned A, original, MIT.

A command that reviews the current code file for security warnings from an Agent Security extension and applies fixes.

In plain words
What is it for?
Use it to fix reported vulnerabilities by applying safer database queries, output handling, process execution, and secret storage.
Why use it?
It removes the need to manually interpret common findings such as SQL injection, cross-site scripting, command injection, and hardcoded secrets.

Command for Claude Code

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 commands/sinewaveai/agent-security-scanner-mcp/fix-security
Clone the repo
git clone --depth 1 https://github.com/sinewaveai/agent-security-scanner-mcp

Made for: Claude Code.

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 fix-security

README.md
[![agentmods](https://agentmods.dev/badge/commands/sinewaveai/agent-security-scanner-mcp/fix-security.svg)](https://agentmods.dev/commands/sinewaveai/agent-security-scanner-mcp/fix-security)
Your own site
<a href="https://agentmods.dev/commands/sinewaveai/agent-security-scanner-mcp/fix-security"><img src="https://agentmods.dev/badge/commands/sinewaveai/agent-security-scanner-mcp/fix-security.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 422 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.00000 $0.00422
Opus 5 $0.00000 $0.00211
Sonnet 5 $0.00000 $0.00084
Haiku 4.5 $0.00000 $0.00042

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

Security

Grade A, and why

fix-security 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.

.claude/commands/fix-security.md · 49 lines

What it actually says

Fix Security Issues

Analyze the current file for security vulnerabilities detected by the Agent Security extension and automatically apply fixes.

Instructions

  1. First, get all diagnostics for the current file using the IDE diagnostics tool
  2. Filter for diagnostics where source is "Agent Security"
  3. For each security issue found, analyze the code and apply the appropriate fix based on the rule ID

Fix Strategies by Rule Type

SQL Injection (sql-injection, sqli)

  • Convert string concatenation to parameterized queries
  • Replace f-strings/template literals with placeholders
  • Use prepared statements

XSS (innerHTML, outerHTML, dangerouslySetInnerHTML)

  • Replace .innerHTML with .textContent for plain text
  • Add DOMPurify.sanitize() wrapper for HTML content
  • Use safe DOM methods like createElement/appendChild

Command Injection (exec, subprocess, shell=True)

  • Replace exec() with execFile() or spawn()
  • Change shell=True to shell=False
  • Split command strings into argument arrays

Hardcoded Secrets (password, api_key, secret)

  • Replace hardcoded values with environment variables
  • Use process.env.VAR_NAME (JS) or os.environ.get('VAR_NAME') (Python)

Weak Cryptography (md5, sha1)

  • Replace MD5/SHA1 with SHA-256 or stronger
  • Use hashlib.sha256() (Python) or crypto.createHash('sha256') (JS)

Insecure Deserialization (pickle, yaml.load)

  • Replace pickle.load with json.load
  • Replace yaml.load() with yaml.safe_load()

SSL/TLS Issues (verify=False, rejectUnauthorized)

  • Set verify=True or remove the insecure option
  • Enable certificate verification

Task

Read the current file, identify all security issues from the Agent Security extension diagnostics, and apply fixes directly to the code. After fixing, briefly explain what was changed.

$ARGUMENTS

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 · 49 lines · 0 tokens per session scan A 375d86633933

Subscribe to this mod's changes

fix-security is a command published in the GitHub repository sinewaveai/agent-security-scanner-mcp (121 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 422 tokens. 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.