Skip to main content
Glama

Detect adversarial injection

detect_injection

Screen untrusted input for prompt/tool injection, exfiltration, and obfuscation before an agent consumes it. Returns a verdict (clean|suspicious|attack), probability, bits-at-risk (upper bound on adversarial capture per the Adversarial Landauer bound), matched canon patterns, and a recommended action (allow|sanitize|reject|escalate). Backed by Aristotle-verified theorems T-IB-02/T-IB-06/T-IB-01.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe untrusted text/data to screen.
agentIdNoOptional: for MCP-01 envelope cross-check.
contextNoOptional: the agent's role/system prompt; helps calibrate.
certaintyNoOperating point. Default standard.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
signalsNo
verdictYes
backedByNo
bitsAtRiskYes
probabilityYes
operatingPointNo
matchedPatternsNo
recommendedActionYes
explainabilityTokenNo

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description fully covers behavior: it states the tool returns a verdict, probability, bits-at-risk, matched canon patterns, and recommended action. It also references Aristotle-verified theorems, adding authoritative context. No destructive behavior is implied, consistent with a screening tool.

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 two sentences: first states the purpose, second lists return values. It is extremely concise and front-loaded, with no wasted words.

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

Completeness5/5

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

Given the tool has an output schema (context signal) and full schema description coverage, the description is sufficient. It explains what the tool does, when to use it, and what it returns, without needing to repeat output schema details.

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

Parameters4/5

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

Schema coverage is 100% with parameter descriptions, but the tool description adds value by explaining the domain (screen for injection types) and the return fields, which implicitly clarify the 'input' and 'certainty' parameters. The description enhances meaning beyond the schema alone.

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 title and description clearly state the tool's purpose: screening untrusted input for prompt/tool injection, exfiltration, and obfuscation. The verb 'Screen' and resource 'untrusted input' are specific, and the description distinguishes it from potential sibling tools by detailing the types of attacks detected.

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?

The description explicitly states to use this tool 'before an agent consumes' untrusted input, providing clear context. However, it lacks explicit when-not-to-use instructions or alternatives, which is acceptable given no sibling tools exist.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.2/5.0
Disambiguation5/5

The two tools target completely distinct aspects: one screens untrusted input for injection patterns, while the other analyzes agent traces for policy violations. There is no overlap in their purpose or output, making misselection unlikely.

Naming Consistency5/5

Both tools follow a consistent 'detect_' + noun phrase naming convention (detect_injection, detect_trace_tool_policy). The pattern is clear and predictable, and there is no mixing of styles.

Tool Count4/5

With only two tools, the set is slightly under the typical 3-15 range, but it feels appropriately scoped for a specialized security detector. Each tool covers a distinct and essential part of the domain, so the small count is justified.

Completeness4/5

The two tools cover the primary detection needs: input screening and trace analysis. Minor gaps exist (e.g., no explicit tool for sanitization or for analyzing output exfiltration), but the core injection-detection workflows are well covered with no dead ends.