Skip to main content
Glama

prompt_injection_audit

Audits system prompts for injection vulnerabilities by detecting untrusted placeholders, missing delimiters, dangerous instructions, and precedence inversion. Static analysis, no LLM call.

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
Behavior4/5

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

The description explicitly states it is a pure function with no LLM call, no I/O, and no chaining, which is valuable transparency given no annotations. It also details the analysis types, though it lacks explanations of performance or size limits.

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?

The description is concise and well-structured: a one-sentence overview, bullet-point list of reports, and a final line for behavioral traits. Every part adds value with no redundancy.

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?

Given the tool has one parameter, no output schema, and no annotations, the description is mostly complete. It covers purpose, behavior, and return format (Structured AuditReport). Minor omissions like prompt length limits are acceptable.

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?

With 0% schema description coverage, the description must compensate. It provides a basic definition for the single parameter 'prompt: The system prompt or template text.' This is adequate but does not add format or length constraints.

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 for prompt-injection surface. It lists specific reports (placeholders, missing delimiters, dangerous patterns, precedence inversion), making it distinct from siblings like owasp_llm_classify.

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 usage for security analysis of prompts but does not explicitly state when to prefer this tool over siblings or provide exclusions. The context from sibling names gives some guidance, but direct advice is missing.

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/actions-marketplace-validations/x0base_mcp-security-toolkit'

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