mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-02-12 14:32:45 +00:00
* 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
7 lines
184 B
Plaintext
7 lines
184 B
Plaintext
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 |