Skip to main content
Glama
x0base

mcp-security-toolkit

prompt_injection_audit

Statically analyze system prompts for prompt-injection vulnerabilities: identify untrusted placeholders, missing delimiters, dangerous instructions, and precedence inversion.

Instructions

Statically analyze a system prompt / template for prompt-injection surface.

Reports:

  • placeholders (jinja {{x}}, fstring {x}, dollar ${x}, percent %(x)s) with a trust classification (untrusted / trusted / unknown)

  • missing-delimiter findings: untrusted placeholders not wrapped in XML tags / triple-backticks / triple-quotes / [START]..[END] etc.

  • dangerous-instruction patterns (ignore previous instructions, role overrides, trust-boundary violations, system-prompt leakage hints, special-token sequences)

  • precedence-inversion: untrusted content placed near the end with no instruction reinforcement after it

Pure function. No LLM call, no I/O, no chaining.

Args: prompt: The system prompt or template text.

Returns: Structured AuditReport.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
Behavior5/5

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

The description explicitly states behavioral traits: 'Pure function. No LLM call, no I/O, no chaining.' This goes beyond what annotations (none) provide, giving full transparency about side effects and resource usage.

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?

The description is well-structured with a clear purpose statement and a bullet list of findings. It is not overly verbose, though the bulleted details could be slightly more compact. Still, each sentence provides value.

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?

The description covers the tool's findings comprehensively but provides minimal detail about the output ('Structured AuditReport') and does not explain how results are structured or what to do with them. Given no output schema, this is a moderate gap.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by defining the 'prompt' parameter as 'The system prompt or template text.' This adds crucial semantic meaning beyond the bare input schema.

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?

The description clearly states the tool's purpose: 'Statically analyze a system prompt / template for prompt-injection surface.' It lists specific findings (placeholders, missing delimiters, dangerous patterns, precedence inversion), distinguishing it from sibling audit tools like mcp_server_audit or agent_tool_risk_audit.

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

Usage Guidelines3/5

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

The description implies when to use (analyze prompts for injection vulnerabilities) but does not explicitly state when not to use or how it compares to alternatives. It lacks guidance on context (e.g., before deployment, during code review).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/x0base/mcp-security-toolkit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server