Skip to main content
Glama

python_ast_sandbox_escape_detector

Audits Python ASTs to detect sandbox escape vectors, including dangerous builtins, subclass gadget chains, importlib misuse, and bytecode compilation tricks.

Instructions

Audits Python ASTs for dangerous builtins, __subclasses__ gadget chains, importlib, and bytecode compilation tricks used in sandbox escapes. (0.045 USDC on Base L2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesInput parameters or JSON string payload for the tool execution
paymentSignatureNoBase L2 USDC micropayment signature or transaction hash for x402 settlement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. The verb 'Audits' and the analysis-focused wording convey a read-only, non-destructive operation, and the cost note '(0.045 USDC on Base L2)' adds a payment constraint. However, it does not disclose potential side effects like external data transmission, failure modes, or whether results are persisted. Basic safety is implied but not detailed.

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 a single, focused sentence that front-loads the core action and target, then lists the audited threat categories, and appends the cost. No filler, no repetition of schema fields. Every clause earns its place.

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?

The tool is a specialized security analyzer with no output schema and no annotations, so the description must compensate. It does not specify what the tool returns (verdict, list of found issues, score, etc.), nor the exact input format for 'payload' (raw source code, serialized AST, JSON). The payment mechanism is also ambiguous: the description mentions a price but does not explain whether paymentSignature is required or how settlement works. These gaps leave an agent unsure how to invoke the tool correctly or interpret results.

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?

The schema already documents both parameters (payload and paymentSignature) with 100% coverage, giving a baseline of 3. The description adds meaningful context by specifying that the payload is a Python AST and that the tool examines it for specific escape vectors. This goes beyond the generic schema description ('Input parameters or JSON string payload'), clarifying the tool's expected input domain.

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 names a specific verb ('Audits') and resource ('Python ASTs') and enumerates concrete threat patterns (dangerous builtins, __subclasses__ chains, importlib, bytecode tricks). This clearly distinguishes it from siblings like validate_code_syntax, diff_ast_trees, and safe_eval_math_expression, which address syntax validity, AST diffing, and safe expression evaluation respectively.

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 purpose strongly implies when to use the tool: when a Python AST needs security auditing for sandbox escapes. However, there is no explicit mention of when not to use it or which sibling alternatives to prefer. The guidance is thus implied rather than stated, meeting the 'implied usage' level but not going further.

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

Deploy Server

Other Tools