Diogenes Agent Guardrails & Sandbox MCP

v1.1.0
io.github.stand-out-of-my-sun/diogenes-agent-guardrails-mcp Checked 4 days ago Published 12 days ago

Autonomous agent guardrails, bash sandboxing, MCP rugpull diffing & prompt firewalls.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

verify_agent_command_safety Autonomous Agent Pre-Execution Command & Prompt Injection Gate

Evaluates untrusted agent prompts, bash commands, and tool arguments to block prompt injection, destructive shell commands, and private-key exfiltration. Use when screening a general shell command or user prompt before autonomous agent execution; for statically validating SQL database queries at the AST level, use validate_sql_query_ast instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'payload' ('action_type' defaults to 'bash_command'), supports '?demo=true' or L402 (20 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
payload *stringRaw command string, script snippet, or untrusted prompt to inspect for safety violations.
action_typestringExecution context of the payload; defaults to 'bash_command' when omitted.

validate_sql_query_ast AST-Level Read-Only SQL Query & Injection Safety Validator

Performs static AST syntax tree parsing on SQL statements to verify strictly read-only SELECT clauses and reject mutations, stacked queries, or comment bypasses. Use when verifying that an agent-authored SQL statement is strictly read-only before running it on a database; for screening non-SQL bash commands or general agent prompts, use verify_agent_command_safety instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'sql_statement' ('dialect' defaults to 'postgres'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
sql_statement *stringSQL statement string to statically parse and audit for read-only SELECT compliance (e.g. 'SELECT id, email FROM users WHERE active = 1').
dialectstringSQL dialect ruleset used for AST token inspection; defaults to 'postgres' when omitted.

execute_python_sandbox AST-Audited Ephemeral Python Code Execution Sandbox

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.

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

audit_mcp_server_manifest External MCP Server Manifest & Tool-Poisoning Security Auditor

Scans an external MCP server's initial tools/list manifest to detect tool-name shadowing (read_file, bash) and hidden prompt-injection directives in descriptions. Use when vetting a newly discovered third-party MCP server before mounting it into an agent session; for comparing a previously pinned MCP baseline against a live mid-session tools/list response, use detect_mcp_schema_rugpull instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'manifest_json' ('audit_profile' defaults to 'strict'), supports '?demo=true' or L402 (25 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
manifest_json *stringJSON string or object containing the external MCP server's tools array to audit.
audit_profilestringSensitivity level for flagging system-tool name shadowing; defaults to 'strict' when omitted.

detect_mcp_schema_rugpull Mid-Session MCP tools/list Rug-Pull & Schema Mutation Detector

Computes structural diffs between a pinned baseline MCP tools/list snapshot and a live server response to catch mid-session description or schema tampering. Use when verifying that a connected MCP server has not mutated its tool definitions mid-session; for performing a first-time static security audit on a single MCP manifest, use audit_mcp_server_manifest instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'baseline_tools_json' ('current_tools_json' defaults to 'standard'), supports '?demo=true' or L402 (20 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
baseline_tools_json *stringJSON-serialized baseline tools/list array captured when the MCP server was first trusted.
current_tools_jsonstringJSON-serialized live tools/list array to compare against the baseline; defaults to '[]' when omitted.
diff_modestringComparison strictness across descriptions and inputSchema; defaults to 'full_structural' when omitted.

validate_mcp_sampling_request Inbound MCP sampling/createMessage Reverse-Injection Firewall

Audits inbound MCP sampling/createMessage callbacks from connected servers to block cross-server context snooping (includeContext='allServers') and token quota hijacking. Use when filtering a connected MCP server's request to sample the host LLM; for scrubbing text returned from a standard synchronous tools/call response, use sanitize_tool_output_stream instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'sampling_request_json' ('max_tokens_ceiling' defaults to '512'), supports '?demo=true' or L402 (20 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
sampling_request_json *stringJSON string or object representing the inbound MCP sampling/createMessage payload.
max_tokens_ceilingstringMaximum completion token quota allowed for server callbacks; defaults to '2048' when omitted.

sanitize_tool_output_stream Indirect Prompt-Injection, Invisible Unicode & Beacon Output Scrubber

Sanitizes untrusted external tool or web-scrape outputs by stripping invisible Unicode Tag characters (U+E0000), neutralizing Markdown tracking image beacons, and defusing indirect prompt overrides. Use when cleaning raw third-party tool outputs or scraped web text before inserting it into the LLM context window; for redacting personal identifiable information (emails, SSNs, keys) from outbound text, use redact_sensitive_pii instead. Read-only edge call (32 KB, 60 RPM): accepts 'raw_tool_output' (with enum defaults), uses '?demo=true' or L402 (15 sats); HTTP 400 if invalid.

ParameterTypeDescription
raw_tool_output *stringUntrusted text returned by an external tool, webhook, or web scraper.
wrap_tagstringXML isolation wrapper applied around the sanitized text; defaults to 'tool_data' when omitted.

redact_sensitive_pii Zero-PII & Secret Credential Redaction Engine

Redacts emails, phone numbers, SSNs, credit cards, API keys, and crypto private keys from text before logging or external transmission. Use when stripping personal data or secret credentials from prompts, logs, or outbound messages; for neutralizing indirect prompt injections and invisible Unicode in inbound tool responses, use sanitize_tool_output_stream instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'text' ('redaction_style' defaults to 'typed_token'), supports '?demo=true' or L402 (25 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
text *stringInput text containing potential PII or secret keys to redact.
redaction_stylestringPlaceholder format used for redacted spans; defaults to 'typed_token' when omitted.

detect_agent_action_loop Autonomous Agent Action-Trace Loop & Token-Burn Circuit Breaker

Analyzes an agent's recent tool-call trace to detect identical retry spins, A/B state oscillation, and runaway token burn. Use when monitoring autonomous agent execution loops to decide whether to continue or trip a token-burn breaker; for inspecting a single command payload for security threats before execution, use verify_agent_command_safety instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'action_trace_json' ('sensitivity' defaults to 'strict_2_repeats'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
action_trace_json *stringJSON-serialized array of recent agent actions (e.g. '[{"tool":"search","status":"err"}]').
sensitivitystringCycle detection threshold; defaults to 'standard_3_repeats' when omitted.

verify_a2a_agent_card A2A /.well-known/agent.json Identity & Capability Card Verifier

Verifies a remote agent's A2A /.well-known/agent.json discovery card, checking JWS/DID signature binding, endpoint HTTPS enforcement, and capability spoofing. Use when authenticating a peer autonomous agent before delegating subtasks or exchanging payments over A2A; for auditing an MCP tool server's tools/list manifest rather than a peer agent's A2A card, use audit_mcp_server_manifest instead. Read-only edge call (32 KB, 60 RPM): accepts 'agent_card_json' ('trust_policy' defaults to 'require_https_and_did'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
agent_card_json *stringJSON string or object of the peer agent's /.well-known/agent.json descriptor.
trust_policystringVerification policy for DID/DNS binding; defaults to 'require_https_and_did' when omitted.

audit_outbound_egress_url Outbound Agent URL SSRF, Metadata & Secret Exfiltration Firewall

Static validation firewall for outbound network destination URIs against cloud metadata IP addresses (169.254.169.254), RFC 1918 private IP blocks, and query-string secret exfiltration before agent dispatch. Use when validating a user-supplied or tool-supplied URI destination before network dispatch; for auditing local shell commands or general prompts, use verify_agent_command_safety instead. Read-only edge call (32 KB, 60 RPM): accepts 'destination_uri' ('egress_policy' defaults to 'block_private_and_metadata'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
destination_uri *stringOutbound HTTP/HTTPS destination URI to inspect before fetching (e.g. 'https://api.example.com/v1/webhook').
egress_policystringNetwork egress policy; defaults to 'block_private_and_metadata' when omitted.

audit_response_factuality Draft Agent Response Groundedness & Hallucination Auditor

Cross-references factual claims, numbers, and citations in a draft agent response against retrieved source passages to flag unsupported hallucinations before delivery. Use when verifying that a generated answer is 100% grounded in source evidence before returning it to the user; for scrubbing inbound tool outputs for prompt-injection and invisible Unicode, use sanitize_tool_output_stream instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'claim' ('context' defaults to 'standard'), supports '?demo=true' or L402 (25 sats), and returns HTTP 400 if invalid.

ParameterTypeDescription
claim *stringDraft agent response or factual statement to verify for hallucinations.
context *stringAuthoritative source text or retrieved RAG passages that the claim must be grounded in.
strictnessstringEntailment threshold required for numbers and dates; defaults to 'exact_entailment' when omitted.