Skip to main content
Glama

airlock_dehydrate

Replace secrets and contextual PII in raw text with reversible <ENTITY_N> placeholders, saving each detected value in a local vault for later rehydration.

Instructions

Convert raw text containing secrets and contextual PII into reversible <ENTITY_N> placeholders.

Purpose & Behavior:
Runs both deterministic pattern matching (API keys, JWTs, URI passwords, cards, SSNs, emails, IPs) and
contextual ONNX GLiNER entity recognition (person names, organizations, locations) on `text`. Every
detected span is stored in the local session vault and replaced with a deterministic placeholder such as
`<PERSON_1>` or `<API_KEY_1>`.

When to Use:
- Use `airlock_dehydrate` when you need full-coverage PII plus secret redaction on raw text and plan to
  restore original values later via `airlock_rehydrate`.
- Choose `airlock_scrub_text(text, use_ner=False)` instead for sub-millisecond credential/regex scrubbing
  of code or logs without loading the neural NER model.
- Choose `airlock_read_file` instead when reading directly from a local file path.

Returns:
A JSON-serializable object with `{"sanitized_text": str, "redacted_count": int, "latency_ms": float,
"tokens": list[str]}`.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "airlock_dehydrate"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesRaw input text containing credentials, connection strings, or natural-language PII (names, emails, phones, IPs, SSNs, credit cards) to convert into <ENTITY_N> vault placeholders.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.6
    • addedInput schema / properties / text / description
      Added value: +"Raw input text containing credentials, connection strings, or natural-language PII (names, emails, phones, IPs, SSNs, credit cards) to convert into <ENTITY_N> vault placeholders."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the real side effect that explains readOnlyHint=false: every detected span is written into the local session vault, and placeholders are deterministic (e.g. <PERSON_1>), which is essential for the later rehydrate call to work. It does not address the mild tension with idempotentHint=false (what changes across repeated calls) or the cost/first-load behavior of the ONNX model, so it stops short of full disclosure.

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 a one-line summary, then organized under Purpose & Behavior, When to Use, and Returns headings that make it easy to scan. The entity-type enumeration is slightly dense but each section carries decision-relevant information; nothing is padded.

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 single-parameter tool with no output schema, the description supplies the return shape (sanitized_text, redacted_count, latency_ms, tokens), the vault-storage side effect, the reversibility path via airlock_rehydrate, and the cheaper alternatives. An agent has everything needed to decide, call, and interpret the result.

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?

With a single parameter at 100% schema description coverage, the schema already explains that text holds credentials, connection strings, and natural-language PII. The description's mention of detected span types and placeholder format adds context for interpreting the output but no new semantics for the parameter itself, so the baseline 3 applies.

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 (convert raw text into reversible placeholders) and immediately scopes the mechanism: deterministic regex patterns plus contextual ONNX GLiNER NER. It explicitly contrasts itself with airlock_scrub_text and airlock_read_file, so an agent can distinguish it from siblings without opening their schemas.

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?

A dedicated 'When to Use' block gives the positive condition (full-coverage PII plus secrets when you plan to restore later via airlock_rehydrate) and two named alternatives with the exact conditions that select them: airlock_scrub_text(text, use_ner=False) for sub-millisecond regex-only scrubbing, and airlock_read_file for file paths. This is explicit when/when-not/alternatives routing.

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