Skip to main content
Glama

Diogenes Agent Guardrails & Sandbox MCP

AST-Audited Ephemeral Python Code Execution Sandbox

execute_python_sandbox
Read-onlyIdempotent

Audits Python source code for forbidden syscalls (os, subprocess, socket, open, eval) inside an AST-governed WebAssembly sandbox with no host filesystem access. Use when executing LLM-generated Python snippets safely; for checking shell commands without executing code, use verify_agent_command_safety instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'python_script' ('timeout_profile' defaults to 'fast_1s'), supports '?demo=true' or MPP (250 sats), and returns HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
python_scriptYesPython 3 source script to audit and execute strictly inside an isolated AST-governed, non-privileged WebAssembly sandbox with no host filesystem access.
timeout_profileNoExecution resource ceiling; defaults to 'standard_5s' when omitted.

Output Schema

NameRequiredDescriptionDefault
exit_codeYesProcess exit status (0 on clean execution, 1 on security block).
syntax_validYesTrue if the Python source parses without syntax errors.
simulated_stdoutYesCaptured standard output from the isolated execution.
ast_security_auditYesStatic syscall audit summary including flagged_calls and safety_verdict.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / code
      Removed value: -{
      -  "description": "Python 3 source code snippet to audit and execute in the isolated sandbox.",
      -  "type": "string"
      -}
    • addedInput schema / properties / python_script
      Added value: +{
      +  "description": "Python 3 source script to audit and execute strictly inside an isolated AST-governed, non-privileged WebAssembly sandbox with no host filesystem access.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "code"
      -]New value: +[
      +  "python_script"
      +]
  2. Added

TDQS

A4.1/5.0
Behavior3/5

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

Adds genuinely useful operational context beyond the annotations: 32 KB payload cap, 60 RPM rate limit, stateless edge call, no host filesystem, HTTP 400 on invalid input, demo/MPP payment path. However it never explains what the AST audit actually rejects at runtime (blocklist behavior, false-positive handling) or whether execution results include partial output on timeout. The readOnly/idempotent claims are consistent with the annotations but are simply restated, so the surplus value is mostly limits rather than semantics.

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?

Front-loaded with the core action and the sibling differentiation, with no filler sentences. The final sentence crams limits, defaults, payment modes, and error codes into one long clause, which costs some scannability.

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?

For a two-parameter tool with an output schema, the description covers what an agent needs to call it correctly: isolation guarantees, size/rate limits, default profile, payment/demo affordance, and failure signaling. Return-value explanation is correctly omitted since the output schema carries it.

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

Parameters2/5

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

The description says timeout_profile 'defaults to fast_1s', while the schema description says it 'defaults to standard_5s when omitted'. That is a direct conflict on the most consequential parameter, and an agent trusting the prose would mis-size execution ceilings. Otherwise the prose just restates python_script and the enum, both of which the 100% coverage schema already documents.

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 specific verb and resource (audit + execute Python source) plus the execution mechanism (AST-governed WebAssembly sandbox, no host filesystem). It explicitly contrasts itself with the sibling verify_agent_command_safety, so an agent can route between them without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a positive trigger (executing LLM-generated Python snippets safely) and a named alternative with the discriminating condition (checking shell commands without executing). The routing decision is fully determined by the description.

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.