feat(guard): integrate optional piguard sidecar for prompt-injection guard#50
Merged
Merged
Conversation
…guard Add a pluggable prompt-injection guard subsystem backed by danger.ScanInjection locally and an optional go-prompt-injection-guard sidecar (HTTP/Unix). Covered surfaces: - memory (legacy facts, memory tool writes, Extended Memory atoms/recall) - system_prompt (IDENTITY.md, --system, AGENTS.md) - mcp_descriptions - skills (load, save, patch suggestions) - telegram (captions, transcripts) - tool_outputs (warning-only) Includes config/env/CLI wiring, tests, and doc updates.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | 01e6a03 | Commit Preview URL Branch Preview URL |
Jul 13 2026, 12:20 PM |
- Add piguard (daemon) and piguard-gateway (HTTP bridge) services to all odek docker-compose profiles. - Mount a read-only ./piguard/models volume for the one-time-exported ONNX model and add docker/piguard/download-model.sh to populate it. - Wire bundled config.restricted.json and config.godmode.json to point the guard at http://piguard-gateway:8080/detect. - Document setup, optional surfaces, and how to disable the sidecar in docker/README.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a pluggable prompt-injection guard subsystem. The built-in local rule scan (
danger.ScanInjection) always runs first; an optionalgo-prompt-injection-guardsidecar provides a second opinion when configured.Covered surfaces
memory— legacy facts,memorytool writes, Extended Memory atoms/recall/user modelsystem_prompt—IDENTITY.md,--system, project-levelAGENTS.mdmcp_descriptions— MCP server tool descriptionsskills— skill bodies at load time and skill save/patch suggestionstelegram— photo captions and voice transcriptstool_outputs— external tool outputs (warning-only)Configuration
Top-level
guardsection in~/.odek/config.json/ODEK_GUARD_*env vars /--guard-*CLI flags. The entire section is rejected from project-level./odek.jsonfor security.Docker setup
The compose stack now includes a PIGuard sidecar:
piguard— the daemon that loads the ONNX model.piguard-gateway— an HTTP bridge so odek uses its existing HTTP-based guard client.docker/piguard/download-model.sh— one-time model export script (~735 MB).config.*.jsonfiles point the guard athttp://piguard-gateway:8080/detect.Run
./piguard/download-model.shbefore starting an odek profile with the guard enabled.Tests & docs
go test ./... -count=1passes.docs/CONFIG.md,docs/MEMORY.md,docs/EXTENDED_MEMORY.md,docs/SECURITY.md,docs/CLI.md, anddocker/README.md.docs/PLAN-piguard-integration.md.