mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
Fase 8 · Bloco D — injection-guard em todas as rotas LLM + red-team (#3857)
Integrated into release/v3.8.25 — Fase 8 Bloco D (injection-guard em todas as rotas LLM + red-team).
This commit is contained in:
committed by
GitHub
parent
d3146a1751
commit
d728bfbb1e
@@ -267,3 +267,22 @@ exercise the full flow without DB or network access.
|
||||
forced-bridge model list
|
||||
- `docs/architecture/RESILIENCE_GUIDE.md` — orthogonal layer (circuit breaker, cooldowns)
|
||||
- `docs/reference/ENVIRONMENT.md` — full env var reference
|
||||
|
||||
## Injection-guard route coverage & red-team (Fase 8 · Bloco D)
|
||||
|
||||
O injection-guard (`createInjectionGuard` / `withInjectionGuard`) cobre todas as rotas
|
||||
que aceitam prompt do usuário. Respeita `INJECTION_GUARD_MODE` (default `warn` = só loga;
|
||||
`block` = retorna HTTP 400 `SECURITY_001`).
|
||||
|
||||
| Tipo | Rotas | Modo default |
|
||||
|---|---|---|
|
||||
| Texto (já existente) | `/v1/chat/completions`, `/v1/completions`, `/v1/relay/chat/completions` | warn |
|
||||
| Generativas | `/v1/messages`, `/v1/responses`, `/v1/images/generations`, `/v1/images/edits`, `/v1/videos/generations`, `/v1/music/generations`, `/v1/audio/speech` | warn |
|
||||
| Dados | `/v1/embeddings`, `/v1/rerank`, `/v1/search`, `/v1/moderations` | warn |
|
||||
|
||||
A extração de texto (`extractMessageContents`) cobre `messages`/`input`/`prompt`/`query`+`documents`/`instructions`/`system`.
|
||||
|
||||
**Red-team (nightly, `nightly-llm-security.yml`):** promptfoo valida que cada rota bloqueia
|
||||
o corpus OWASP-LLM em `INJECTION_GUARD_MODE=block`; garak roda probes (skip sem secret).
|
||||
`moderations` é incluída por consistência — operadores em block-mode podem isentá-la via
|
||||
`resolveDisabledGuardrails`.
|
||||
|
||||
Reference in New Issue
Block a user