injection-guard
PLUGINPrompt-injection firewall for tool output.
by moneya · v0.1.1
What it does
Prompt-injection firewall for tool output. A tool_execution middleware scans results from web, browser, file-reading and mail tools for instructions addressed to the model, redacts the matched spans, strips zero-width and bidi characters, HTML comments carrying instructions, CSS-hidden text and oversized base64 blobs, then wraps what remains in a labelled untrusted- data envelope.
Fully local and deterministic: seven weighted signal families with a default threshold of six, so one strong signal or two medium signals trip it; no network calls, no API calls, and no model in the decision path. Ships a read-only injection_guard_stats tool and a /guard command, and appends one audit line per block carrying signal names and scores only — never the offending text.
Embedded envelope markers are defused before wrapping, so a payload cannot close the untrusted block early. For tools listed in file_reader_tools the destructive family is exempt, because redacting a local migration or deploy script would corrupt it if the model rewrote the file; instruction-override and concealment still fire on reads.
Disclosure — it rewrites tool results before the model reads them, which is the purpose of the plugin and does change the content the model receives; detection is pattern-based, so a novel phrasing that avoids every rule will pass, and the guard covers the tool path only, not text a user pastes into chat.
Tools it adds
The tools an agent gets once this plugin is installed.
- injection_guard_stats
Review notes
What an owner reads and accepts before the install is approved.
- Ulpi has not reviewed this version: it is listed in the public plugin catalog, and the install still fetches it at its pinned commit, checks its shape and scans it before you approve