Skip to content
    ↑↓ select↵ openesc close
    English中文
    casonadams

    Secret Redactor

    v0.5.1Model Providers
    opencode-secret-redactor

    OpenCode plugin that redacts secrets from LLM context and restores them for tool execution

    GitHub stars

    3

    Monthly installs

    182

    67 in 7 days

    Composite scoreSCORE

    31.5

    Multi-signal model

    Last commit

    4 months ago

    2026-04-04

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-secret-redactor@0.5.1"]
    }

    opencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    An OpenCode plugin that prevents secrets from leaking into LLM context. Secrets detected in tool output are replaced with 🔒label🔓 tokens before the model sees them, then transparently restored when a tool needs the real value for execution.

    Detected secret types

    AWS keys, GitHub/GitLab tokens, OpenAI/Anthropic keys, Google Cloud credentials, Stripe keys, Slack tokens, JWTs, private keys, database connection strings, and many more. See src/patterns.ts for the full list.

    Setup

    Add the plugin to your opencode.json:

    {
      "plugin": ["opencode-secret-redactor@0.5.1"]
    }
    

    The plugin hooks into tool execution automatically -- no further configuration is required.

    How it works

    1. After bash or read tool output, the plugin scans for secrets using pattern matching and stores any matches in an in-memory vault.
    2. The output sent to the LLM contains only redacted placeholders.
    3. Before bash, write, or edit tool execution, placeholders in the tool arguments are replaced with the original values so commands run correctly.

    License

    MIT