Fix false positives in agent guardrails
Skip empty fingerprints in SystemPromptLeakGuardrail to prevent blank
values from flagging every message. Replace overly broad "sk-" pattern
in SensitiveDataGuardrail with specific LLM provider prefixes
("sk-proj-" for OpenAI, "sk-ant-" for Anthropic) to avoid false
positives on common words like "risk-based" or "task-management".
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
2f8674471b
commit
4725a1b080
@@ -66,6 +66,8 @@ func TestSensitiveDataGuardrail_Check(t *testing.T) {
|
||||
|
||||
// LLM provider keys
|
||||
{"openai key", "The API key is sk-proj-abc123", true},
|
||||
{"anthropic key", "Key: sk-ant-api03-abc123", true},
|
||||
{"sk prefix not a false positive", "This is a risk-based approach to task-management.", false},
|
||||
|
||||
// JWT tokens
|
||||
{"jwt token", "Token: eyJhbGciOiJIUzI1NiJ9.payload.sig", true},
|
||||
|
||||
Reference in New Issue
Block a user