Skip to main content
Glama

scan_prompt_injection

Read-onlyIdempotent

Inspect untrusted GitHub text, PR diffs, READMEs, or tool output for prompt-injection and secret-exfiltration patterns before an AI agent acts, returning an ALLOW/WARN/BLOCK verdict and risk score.

Instructions

Scan untrusted GitHub issue text, PR diffs, READMEs, or tool output for indirect prompt-injection, instruction override, and secret-exfiltration patterns before an AI agent acts on it. Returns a deterministic ALLOW/WARN/BLOCK verdict, risk score (0-100), and matched rule IDs without modifying any external state.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "scan_prompt_injection"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesRaw untrusted text or markdown content to inspect for prompt-injection patterns.
sourceNoOptional human-readable source identifier (for example, a GitHub issue URL or file path) echoed in the report.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description still adds real value by disclosing the verdict tiers (ALLOW/WARN/BLOCK), the 0-100 risk score, matched rule IDs, and determinism. Credit is capped because it doesn't explain scoring thresholds, limits on input size, or how verdicts are calibrated.

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

Conciseness5/5

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

Two sentences, front-loaded with the action and the content types, followed by the return contract. Every clause carries information and nothing is padded.

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

Completeness4/5

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

With no output schema, the description carries the burden of describing the return values, and it does so (verdict, risk score, rule IDs). Parameters are fully covered by the schema. Only the absence of any input-size or rate-limit notes keeps it from being fully complete for a scanning tool.

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 both parameters are already documented, which sets the baseline at 3. The description adds only marginal meaning beyond the schema, mainly broadening the kind of content that counts as untrusted input; it gives no extra detail on the optional source field beyond what the schema says.

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

Purpose5/5

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

States a specific verb and resource ("Scan untrusted GitHub issue text, PR diffs, READMEs, or tool output") plus the exact threat classes it looks for (indirect prompt-injection, instruction override, secret exfiltration). This is far more specific than a name restatement and clearly separates it from an unrelated sibling like get_clean_bounties.

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

Usage Guidelines4/5

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

Gives clear situational guidance: run it on untrusted content "before an AI agent acts on it," which defines the trigger condition precisely. It does not name alternatives or state when not to use it, but the intended context is unambiguous.

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

Deploy Server

Other Tools