Skip to main content
Glama

vulnforge_inject_patch

Synthesizes and automatically injects defensive patches into vulnerable code, converting raw queries to parameterized statements, adding headers, sanitizing DOM sinks, and optionally verifying via canary sandbox.

Instructions

Synthesizes and automatically injects defensive patches into vulnerable code, converting raw queries to parameterized statements, adding headers, sanitizing DOM sinks, and optionally verifying via canary sandbox.

Input Schema

NameRequiredDescriptionDefault
filenameNoTarget filename (e.g. server.ts, db.ts)
vaultTypeNoVault type override (optional)
sourceCodeYesThe vulnerable source code to remediate
vaultFilePathNoFile path of vault configuration (optional)
verifyInSandboxNoWhen true, runs automated canary verification in isolated VM sandbox (default: true)
vaultConfigContentNoVault configuration or KMS manifest content to audit (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.19.0
    • addedInput schema / properties / vaultConfigContent
      Added value: +{
      +  "description": "Vault configuration or KMS manifest content to audit (optional)",
      +  "type": "string"
      +}
    • addedInput schema / properties / vaultFilePath
      Added value: +{
      +  "description": "File path of vault configuration (optional)",
      +  "type": "string"
      +}
    • addedInput schema / properties / vaultType
      Added value: +{
      +  "description": "Vault type override (optional)",
      +  "enum": [
      +    "hashicorp_vault",
      +    "aws_secrets_manager",
      +    "azure_key_vault",
      +    "gcp_secret_manager",
      +    "kubernetes_kms",
      +    "age_vault",
      +    "unknown"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / verifyInSandbox
      Added value: +{
      +  "description": "When true, runs automated canary verification in isolated VM sandbox (default: true)",
      +  "type": "boolean"
      +}
  2. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With zero annotations, the description carries the full disclosure burden. It conveys that this is a mutation ('automatically injects') and that sandbox verification runs in an isolated VM, but omits whether files are modified in place, whether the patched code is returned, reversibility of changes, or privilege requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence, front-loaded with the primary verb and resource, with each clause carrying distinct remediation information. Slightly run-on but no wasted sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate on the what, but incomplete for a mutation tool with five sibling auditors, no annotations, and no output schema. An agent still cannot tell what the call returns, whether it edits the target file, or how the vault parameters interact with the patch flow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all six parameters and the enum. The description adds nothing about the three vault-related parameters (vaultType, vaultFilePath, vaultConfigContent), whose purpose is non-obvious in a patch-injection tool, so it stays at the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Uses a concrete verb pair ('synthesizes and automatically injects defensive patches') tied to a specific resource ('vulnerable code') and enumerates the remediation classes it performs (parameterized statements, headers, DOM sink sanitization). This clearly distinguishes it from the audit_* siblings, though it does not explicitly differentiate itself from the adjacent vulnforge_verify_patch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No statement of when to use this versus the many audit_* tools or verify_patch, and no exclusions or prerequisites. The 'optionally verifying via canary sandbox' clause hints at overlap with verify_patch but never routes the agent between them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.