Skip to main content
Glama

Output Sanitizer — Final Gate

dcl_evaluate_output_sanitizer

Sanitizes raw AI responses by redacting secrets, PII, private keys, and unsafe code fragments. Run this as the final checkpoint before delivering output to users or downstream systems.

Instructions

FINAL-GATE Output Sanitizer ($0.02). Post-processing checkpoint that strips secrets/credentials, PII, crypto material (seed phrases, private keys, wallet addresses), internal network details (private IPs, MAC addresses, .internal/.local/.corp hostnames), and unsafe shell/SQL/path-traversal fragments from a raw model response — plus a narrow, high-precision safety net for direct self-harm-instruction-seeking and targeted-harassment phrasing (not a general toxicity classifier). Returns a single sanitized_output with every match replaced by [REDACTED]; use that instead of the original whenever verdict is NO_COMMIT. Run this as the LAST gate before a response reaches its destination — after dcl_evaluate_jailbreak_crypto/other input-side checks have already run, and immediately before dcl_commit seals the final decision. Internally re-uses the same detection tables as dcl_evaluate_secrets/dcl_evaluate_pii for the secrets/PII categories, so results stay consistent with those tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesIdentifier of the agent that produced the response.
responseYesThe raw LLM/agent response to sanitize before it is delivered to a user, downstream agent, or external system.
payment_idNoOptional payment identifier returned by a previous call when payment is required

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tx_hashYesHash of this record in the tamper-evident audit chain.
verdictYesCOMMIT if the response was clean, otherwise NO_COMMIT.
findingsYesAll matches found, with position/severity/category detail. Empty list if verdict is COMMIT.
timestampYesUnix timestamp when this record was sealed.
confidenceYesConfidence score of the verdict, from 0.0 to 1.0.
input_hashYesHash of the sanitized text (raw content is never stored).
risk_scoreYes0.0-1.0 composite severity score.
violationsYesDistinct finding types matched (e.g. ['api_key', 'internal_ip']). Empty list if verdict is COMMIT.
chain_indexYesSequential index of this record in the audit chain.
redaction_countYesTotal number of items redacted.
sanitized_outputNoInput text with every match replaced by [REDACTED]. Null if verdict is COMMIT.
Behavior4/5

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

Annotations are sparse (readOnlyHint=false, destructiveHint=false). The description adds valuable behavior: cost ($0.02), consistent internal reuse of detection tables, return of sanitized_output with [REDACTED], and the narrow safety-net scope. However, it does not clarify whether the trait readOnlyHint=false implies any side effects or payment behavior beyond the optional payment_id, leaving a small gap.

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?

One dense paragraph, front-loaded with the core purpose, then specific categories, output format, and usage ordering. Every sentence adds unique information with no fluff or redundancy, perfectly sized for the tool's complexity.

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?

The description covers purpose, usage sequence, relationship to sibling tools, cost, output structure, and the consistency mechanism with other evaluators. Given the presence of an output schema and annotations, this is fully complete for an agent to select and invoke the tool correctly.

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?

Schema description coverage is 100% and each parameter (response, agent_id, payment_id) has its own clear description. The tool description does not introduce new parameter-specific meanings beyond emphasizing the 'raw model response' for `response`, which is already captured in the schema. Baseline 3 is appropriate.

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 states a specific verb ('strips') and resource ('raw model response'), enumerates exact categories (secrets, PII, crypto material, internal network details, unsafe fragments), and clearly differentiates from siblings by framing itself as the 'FINAL-GATE' and referencing input-side checks and dcl_commit.

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?

Explicitly says when to use: 'Run this as the LAST gate before a response reaches its destination', after input-side checks and immediately before dcl_commit. It also names the alternative tools (dcl_evaluate_jailbreak_crypto, dcl_evaluate_secrets, dcl_evaluate_pii) and provides a substitution rule for NO_COMMIT verdicts.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Fronesis-Labs/dcl-webhook'

If you have feedback or need assistance with the MCP directory API, please join our Discord server