mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-08-24 17:42:28 +02:00
Pipelined Guardrails (#32)
* initial draft: pipelined guardrails * documentation on stream instrumentation * more comments * fix: return earlier * non-streaming case * handle non-streaming case * fix more cases * simplify request instrumentation * improve comments * fix import issues * extend tests for input guardrailing * anthropic integration of pipelined and pre-guardrailing * fix gemini streamed refusal
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
from invariant.detectors import prompt_injection
|
||||
|
||||
raise "Don't say 'Hello'" if:
|
||||
(msg: Message)
|
||||
msg.role == "user"
|
||||
prompt_injection(msg.content)
|
||||
# "Hello" in msg.content
|
||||
Reference in New Issue
Block a user