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

Diogenes Agent Guardrails & Command Sandbox MCP

sql_injection_ast_guard

Audits LLM-generated SQL by inspecting its AST to block tautology-based SQL injection, UNION data leaks, and destructive DROP/TRUNCATE statements before execution.

Instructions

Statically validates LLM-generated SQL queries via AST inspection to block SQLi tautologies, UNION leaks, and DROP/TRUNCATE.

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": {
      "sql_query": "<sql_query>"
    },
    "name": "sql_injection_ast_guard"
  }
}

Input Schema

NameRequiredDescriptionDefault
sql_queryYesSQL query to audit

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

A3.6/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 mechanism (static, AST-based) and the failure classes it intercepts, but omits critical operational behavior: what happens when a query is flagged (reject, error, or boolean), whether the check is deterministic, and any dialect or configuration dependency.

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?

One dense, well-front-loaded sentence with no filler; the verb and mechanism lead, and every clause carries information. Slightly jargon-heavy but structurally efficient.

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?

No output schema exists, so the description should hint at the return shape (e.g., pass/fail plus reason). It instead stops at the detection categories, leaving an agent unable to predict the result of a flagged query — a meaningful gap for a guardrail 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?

The single parameter is fully documented in the schema ('SQL query to audit'), so the baseline is 3. The description adds the 'LLM-generated' provenance context but no format, dialect, or size constraints beyond what the schema already provides.

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 precise verb (statically validates), resource (LLM-generated SQL queries), mechanism (AST inspection), and the specific threat classes it targets (SQLi tautologies, UNION leaks, DROP/TRUNCATE). This distinguishes it from guardrail-style siblings like guardrail_verify or tool_output_firewall without opening any schema.

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?

'LLM-generated SQL queries' and 'statically' imply the use case: pre-execution auditing of generated SQL. However, there is no explicit when-to-use/when-not guidance, no prerequisites, and no named alternative among the sibling guardrail tools, leaving the trigger condition to inference.

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