Skip to main content
Glama
Diogenes Agent Guardrails & Command Sandbox MCP

Diogenes Agent Guardrails & Command Sandbox MCP

mcp_sampling_guard

Audits MCP sampling/createMessage requests to block systemPrompt hijacking and recursive quota drain before they reach agent workflows.

Instructions

Audits inbound MCP sampling/createMessage requests to block systemPrompt hijacking and recursive quota drain.

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": {
      "sampling_request": "<sampling_request>"
    },
    "name": "mcp_sampling_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
sampling_requestYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the detection targets (systemPrompt hijacking, recursive quota drain), but says nothing about what happens on a match, whether the request is blocked or rewritten, or whether the call has side effects — all material for a security guard.

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 front-loaded sentence with zero filler; the purpose and threat model land immediately. It is arguably too terse for a guard with an opaque nested payload, but there is no wasted language.

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

Completeness2/5

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

No output schema, no annotations, and an undocumented nested object parameter. The description never explains the return contract (allow/deny verdict, modified request, reason codes), which an agent must know to act on the result of a security check.

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?

There is one nested object parameter at 0% schema description coverage, so the schema does not explain it. The description partially compensates by identifying the payload as an MCP sampling/createMessage request, but it does not state the expected shape, required fields, or whether the raw request is passed through verbatim.

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?

The description gives a specific verb ('audits') and a precise resource ('inbound MCP sampling/createMessage requests'), plus the threat classes it targets. That is enough for an agent to distinguish it from generic siblings like guardrail_verify or tool_output_firewall, though it never names a sibling explicitly.

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?

Usage is implied by the object of the audit: this is the tool to invoke on an inbound sampling/createMessage request. There is no explicit when-to-use statement, no when-not, and no routing guidance relative to guardrail_verify, so the agent must infer placement in the request pipeline.

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