Reference-quality MCP gateway implementing the CSP Tool Safety Profile with authentication, authorization, credential brokering, preflight validation, sandboxing, and receipt emission
This is a reference implementation for a security-focused MCP gateway, not a production agent tool server. Tool definitions are present with schemas and descriptions, but many lack LLM-optimized clarity. 15 of 25 tools have descriptions under 100 chars (baseline 194 chars). Parameter descriptions are sparse or generic. Tools like 'tools/list' and 'tools/call' are meta-gateway operations, not domain tools. Security-focused tools (authenticate, evaluate_authorization, emit_receipt) have good descriptions but are infrastructure, not user-facing. Sandbox/demo tools (fs_delete, make_plan, make_allow) lack production-grade error handling and validation guidance. No tool declares permissions or scope requirements. Output schemas are not documented. Error handling is minimal, no recovery guidance or actionable error messages visible in definitions.
MUST 9: Immediately deny specified tools during incident response
Attempt to execute a ToolAction with risk classification and enforcement. In basic mode blocks CRITICAL patterns; in standard mode requires plan + Guardian ALLOW for HIGH/CRITICAL
Verify authentication token and extract principal claims. Stub implementation for reference/testing; production should use proper JWT verification
Configure token exchange (RFC 8693) for a downstream MCP server
Configure vault secret for a downstream MCP server
Re-enable tools after incident response
No output schemas documented. Tools return complex objects (receipts, verdicts, plans) but LLMs cannot see what fields to expect. Breaks tool chaining and forces agents to guess response structure.
Descriptions lack LLM-optimized clarity. 15 tools have descriptions under 100 chars (baseline 194). Generic descriptions like 'Emit tamper-evident receipt' do not explain WHEN to call or WHAT the agent should do with the result.
No permission/scope declarations. Tools like 'revoke_principal', 'activate_kill_switch', 'fs_delete' are destructive but do not declare required permissions (e.g., 'admin:incident', 'write:filesystem'). Agents cannot be configured with least-privilege access.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 49 | 2026-07-28+ | v2 |
Explicitly deny tools for a principal
MUST 9: Emit tamper-evident receipt of request and decision with cryptographic binding
Evaluate runtime authorization for a principal requesting a tool. Implements deny-by-default policy with risk level ceiling checks
Filter tools/list response by principal permissions. MUST 3: Identity-bound tool discovery with deny-by-default visibility
Real filesystem delete (sandboxed). Gated by basic/standard mode with plan + Guardian ALLOW for HIGH/CRITICAL deletes
MUST 5: Get credential for upstream MCP server. Never passthroughs raw client tokens; exchanges via RFC 8693 or retrieves from vault
Grant permission to tools for a principal with optional risk ceiling
Guardian issues a verdict (ALLOW/DENY/ESCALATE) bound to a plan. Emits tamper-evident verdict receipt with plan_hash binding
Create a minimal GuardianVerdictReceipt (ALLOW) bound to a plan
Create a minimal ToolPlanReceipt JSON for a delete scope with risk level
MUST 9: Quarantine a suspicious session during incident response
Reinstate a revoked principal
Release a session from quarantine
MUST 9: Revoke all tokens for a principal during incident response
Submit a ToolPlan for approval. Emits a tamper-evident plan receipt with steps, risk levels, and signature
Execute a tool with full enforcement flow: MUST 2 AuthN, MUST 4 AuthZ, MUST 7 Preflight, MUST 5 Credentials, MUST 9 Receipts
List available tools filtered by principal permissions. MUST 2: AuthN required. MUST 3: Identity-bound filtering
MUST 7: Preflight validation of tool arguments (payload size, path traversal, network allowlist)
Verify tamper-evident receipts in an episode: receipt hash correctness, parent_hash chain validity, and verdict-to-plan bindings
Sandbox/demo tools (fs_delete, make_plan, make_allow) lack validation guidance. No descriptions of constraints (path must be under sandbox root, risk must be HIGH|CRITICAL). LLMs will pass invalid values without clear error recovery paths.
No error handling guidance. Definitions do not explain what errors are retryable, user-fixable, or fatal. No recovery hints (e.g., 'If authentication fails, check token format'). Agents cannot self-correct on failures.