redact_text
Scan text for secret patterns, replace matches with [REDACTED], and return category labels. Use to preview detections before writing records or to build custom masking logic.
Instructions
Redact secret-shaped text without writing a record.
Applies the public Nogra secret-pattern filter to caller-provided text and returns the redacted text plus
category labels for every detected secret-shaped match.
When to use:
- Preview which secret-pattern labels Nogra would detect in text before writing it to workspace substrate.
- Build caller-side masking or display logic from the same labels used by write-time annotations.
When NOT to use:
- Do not use this as destructive storage; write-tools annotate records and keep original text.
- Do not use this for provider handoff receipts; provider_handoff already redacts rendered prompts.
Examples:
>>> redact_text("token=sk_test_abcdefghij1234567890")
{"redacted": "token=[REDACTED]", "redactions": ["api-key-shape"]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to scan and return with secret-shaped matches replaced by [REDACTED]. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||