Secret Redactor
OpenCode plugin that redacts secrets from LLM context and restores them for tool execution
6
+2 in 30 days
558
161 in 7 days
37.1
Multi-signal model
6 months ago
2026-04-04
Install and configure
opencode.jsonWrites 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"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-secret-redactor@0.5.1"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-secret-redactorOpenCode 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
- After
bashorreadtool output, the plugin scans for secrets using pattern matching and stores any matches in an in-memory vault. - The output sent to the LLM contains only redacted placeholders.
- Before
bash,write, oredittool execution, placeholders in the tool arguments are replaced with the original values so commands run correctly.
License
Similar plugins
Comment Judge
opencode-plugin-comment-judge
opencode plugin and Claude Code hook that has a model judge every comment an agent writes, and removes or rewrites the ones that do not earn their place
Litellm
@finger_xie/opencode-plugin-litellm
OpenCode plugin for connecting to LiteLLM through an OpenAI-compatible provider.
Comment Judge
@smykla-skalski/opencode-plugin-comment-judge
opencode plugin and Claude Code hook that has a model judge every comment an agent writes, and removes or rewrites the ones that do not earn their place