airlock_read_file
Read local UTF-8 text files up to 1 MB and replace detected secrets or PII with reversible session placeholders before returning sanitized text; the original file stays unchanged.
Instructions
Read a local UTF-8 text file and replace secrets and PII with reversible <ENTITY_N> placeholders.
Purpose & Behavior:
Reads up to 1 MB of text from `path`, runs two-stage secret/PII detection (deterministic regex plus
contextual NER), stores raw values in the local in-memory session vault, and returns sanitized text
containing session-consistent placeholders such as `<API_KEY_1>`, `<AUTH_TOKEN_1>`, or `<PERSON_1>`.
Does not modify the file on disk.
When to Use:
- Use this instead of native file-read or `cat` commands for `.env`, configuration, log, or source files
that may contain credentials or PII.
- Pair with `airlock_write_file` to update the file on disk with real secrets automatically restored.
- For in-memory strings rather than files, use `airlock_dehydrate` or `airlock_scrub_text`.
Returns:
A JSON-serializable object with `{"path": str, "sanitized_text": str, "redacted_count": int,
"latency_ms": float, "tokens": list[str]}`. Raises a tool error if the file is missing, binary,
exceeds 1 MB, or violates workspace or system-directory guardrails.
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": {
"path": "<path>"
},
"name": "airlock_read_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative or absolute filesystem path to the UTF-8 text file to read (max 1 MB). Sensitive system directories (.ssh, .aws, .gnupg, .kube, /etc) and binary files are blocked. |