What this artifact is for
The quick orientation layer before you go deeper upstream.
Summary
Redact sensitive data (API keys, tokens, passwords) from tool results before LLM sees them
Seed description: Redact sensitive data (API keys, tokens, passwords) from tool results before LLM sees them
Category: Extensions
Best for: Not yet synthesized.
How to read this page
Workflow tags: none captured
Integrations: none captured
Caveats: No caveats captured yet
Maturity: No maturity signals captured
Source excerpt
More of the actual upstream surface so you can skim here before deciding to open the repo.
Preview source: captured upstream text ↗
Quick topics
Skim bullets
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
/**
* Filter or transform tool results before the LLM sees them.
* Redacts sensitive data like API keys, tokens, passwords, etc.
*/
export default function (pi: ExtensionAPI) {
const sensitivePatterns = [
{ pattern: /\b(sk-[a-zA-Z0-9]{20,})\b/g, replacement: "[OPENAI_KEY_REDACTED]" }, // sk-abc123...
{ pattern: /\b(ghp_[a-zA-Z0-9]{36,})\b/g, replacement: "[GITHUB_TOKEN_REDACTED]" }, // ghp_xxxx...
{ pattern: /\b(gho_[a-zA-Z0-9]{36,})\b/g, replacement: "[GITHUB_OAUTH_REDACTED]" }, // gho_xxxx...
{ pattern: /\b(xox[baprs]-[a-zA-Z0-9-]{10,})\b/g, replacement: "[SLACK_TOKEN_REDACTED]" }, // xoxb-xxx, xoxp-xxx
{ pattern: /\b(AKIA[A-Z0-9]{16})\b/g, replacement: "[AWS_KEY_REDACTED]" }, // AKIAIOSFODNN7EXAMPLE
{
pattern: /\b(api[_-]?key|apikey)\s*[=:]\s*['"]?([a-zA-Z0-9_-]{20,})['"]?/gi,
replacement: "$1=[REDACTED]",
}, // api_key=xxx, apiKey: "xxx"
{
pattern: /\b(secret|token|password|passwd|pwd)\s*[=:]\s*['"]?([^\s'"]{8,})['"]?/gi,
replacement: "$1=[REDACTED]",
}, // password=xxx, secret: "xxx"
{ pattern: /\b(bearer)\s+([a-zA-Z0-9._-]{20,})\b/gi, replacement: "Bearer [REDACTED]" }, // Bearer eyJhbGc...
{ pattern: /(mongodb(\+srv)?:\/\/[^:]+:)[^@]+(@)/gi, replacement: "$1[REDACTED]$3" }, // mongodb://user:pass@host
{ pattern: /(postgres(ql)?:\/\/[^:]+:)[^@]+(@)/gi, replacement: "$1[REDACTED]$3" }, // postgresql://user:pass@host
{ pattern: /(mysql:\/\/[^:]+:)[^@]+(@)/gi, replacement: "$1[REDACTED]$3" }, // mysql://user:pass@host
{ pattern: /(redis:\/\/[^:]+:)[^@]+(@)/gi, replacement: "$1[REDACTED]$3" }, // redis://user:pass@host
{
pattern:Sources and provenance
Everything on this page should be traceable back to the list seed or an upstream surface.
Discovery reason: Listed in the awesome-pi-agent README
Discovered from: michalvavra-agents
Claim confidence: medium
Surface capture kind: blob-code