Repository navigation
opencode-injection-guard@0.1.0
-
Initial release -- OpenCode plugin that detects prompt injection in tool call outputs using an LLM-as-judge. Intercepts
tool.execute.afterand replaces injected content with a warning before the main agent ever sees it:[BLOCKED BY INJECTION GUARD] Tool output contained potential prompt injection (confidence: 0.99). Original output was suppressed for security. -
Wildcard scan patterns -- configure which tool calls to scan using
tool:argsGlobpatterns. Only matched calls are scanned; everything else passes through with zero overhead:{ "scanPatterns": ["bash:*", "webfetch:*", "bash:*zele read*"] } -
Opt-in via config file -- the plugin is a no-op unless
.opencode/injection-guard.jsonexists orOPENCODE_INJECTION_GUARDenv var is set. -
Auto-detects best available model -- checks the OpenCode model registry at runtime and picks the first available cheap/fast model from the priority list. No extra API keys needed -- uses your existing configured providers. Priority:
openai/gpt-4.1-nano>openai/gpt-4.1-mini>openai/gpt-5.4-nano>openai/gpt-5.4-mini>anthropic/claude-haiku-4-5>google/gemini-2.5-flash> ... -
Config find-up -- config file is searched upward from the project directory, so a single config at a monorepo root covers all packages.
-
Sandboxed judge sessions -- judge sessions are created with all permissions denied and use
os.tmpdir()as cwd, so they cannot execute tools or appear in the project session list. -
Kimaki-aware -- when running inside Kimaki, the standalone
injectionGuardexport is a no-op. UseinjectionGuardInternalfor embedding in other hosts.