@@ -30,7 +30,7 @@ services:
3030 - ./workspace:/workspace
3131 - ./config.restricted.json:/home/odek/.odek/config.json:ro
3232 restart : " no"
33- depends_on : [searxng, llama-embeddings]
33+ depends_on : [searxng, llama-embeddings, piguard-gateway ]
3434
3535 # ── Godmode (all permissions) — non-interactive, disposable container ──
3636 odek-godmode :
@@ -50,7 +50,7 @@ services:
5050 - ./workspace:/workspace
5151 - ./config.godmode.json:/home/odek/.odek/config.json:ro
5252 restart : " no"
53- depends_on : [searxng, llama-embeddings]
53+ depends_on : [searxng, llama-embeddings, piguard-gateway ]
5454
5555 # ── Telegram bot — Restricted (approvals via inline keyboards) ──
5656 # State (sessions, skills, telegram.pid) lives in the local ./.odek folder —
@@ -74,7 +74,7 @@ services:
7474 - ./.odek:/home/odek/.odek
7575 - ./config.restricted.json:/home/odek/.odek/config.json:ro
7676 restart : unless-stopped
77- depends_on : [searxng, llama-embeddings]
77+ depends_on : [searxng, llama-embeddings, piguard-gateway ]
7878
7979 # ── Telegram bot — Godmode (no prompts; unrestricted) ──
8080 # Same ./.odek state folder; config.godmode.json is layered on top of
@@ -93,7 +93,7 @@ services:
9393 - ./.odek:/home/odek/.odek
9494 - ./config.godmode.json:/home/odek/.odek/config.json:ro
9595 restart : unless-stopped
96- depends_on : [searxng, llama-embeddings]
96+ depends_on : [searxng, llama-embeddings, piguard-gateway ]
9797
9898 # ── llama.cpp embeddings — local backend for the shared "embedding" block ──
9999 # Co-starts with every odek profile so semantic embeddings work out of the box
@@ -151,3 +151,45 @@ services:
151151 # SearXNG needs outbound internet to query upstream engines (Google, Bing,
152152 # DuckDuckGo, …). Behind the advanced allowlisting egress proxy, permit those.
153153 restart : unless-stopped
154+
155+ # ── PIGuard prompt-injection sidecar ─────────────────────────────────────
156+ # Optional semantic second-opinion guard for memory, system prompt, MCP
157+ # descriptions, skills, Telegram, and tool outputs. The daemon loads a
158+ # one-time-exported ONNX model (~735 MB); run ./piguard/download-model.sh
159+ # before starting an odek profile to populate ./piguard/models.
160+ #
161+ # The daemon speaks newline-delimited JSON over a private Unix socket; the
162+ # gateway bridges that to plain HTTP on the compose network so odek can use
163+ # its existing HTTP-based piguard client without sharing a socket volume.
164+ piguard :
165+ profiles : ["restricted", "godmode", "telegram-restricted", "telegram-godmode"]
166+ image : ghcr.io/backendstack21/go-prompt-injection-guard:v1.0.0
167+ command :
168+ - " --socket=/run/piguard/piguard.sock"
169+ - " --model-dir=/models"
170+ - " --max-batch=32"
171+ - " --batch-wait=5ms"
172+ volumes :
173+ - ./piguard/models:/models:ro
174+ - piguard-sock:/run/piguard
175+ healthcheck :
176+ test : ["CMD-SHELL", "test -S /run/piguard/piguard.sock"]
177+ interval : 10s
178+ timeout : 3s
179+ retries : 5
180+ start_period : 60s
181+ restart : unless-stopped
182+
183+ piguard-gateway :
184+ profiles : ["restricted", "godmode", "telegram-restricted", "telegram-godmode"]
185+ image : ghcr.io/backendstack21/go-prompt-injection-guard-gateway:v1.0.0
186+ command : ["--addr=:8080", "--socket=/run/piguard/piguard.sock"]
187+ volumes :
188+ - piguard-sock:/run/piguard
189+ depends_on :
190+ piguard :
191+ condition : service_healthy
192+ restart : unless-stopped
193+
194+ volumes :
195+ piguard-sock :
0 commit comments