Add claims agent guardrails (5 categories + policy template) - #22113
Conversation
5 new category guardrails for healthcare claims agent chatbots: - claims_fraud_coaching: fraud coaching, exaggeration, document forgery - claims_phi_disclosure: unauthorized PHI access, bulk data extraction - claims_prior_auth_gaming: code manipulation, medical necessity misrepresentation - claims_system_override: system injection, rule bypass, role impersonation - claims_medical_advice: medical advice (claims-context-aware) Plus claims_agent_safety.yaml policy template combining all 5. All 5 eval suites pass at 100% precision/recall/F1 (243 test cases). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Combines the 5 claims guardrails into a single deployable policy template: fraud coaching, PHI disclosure, prior-auth gaming, system override, and medical advice. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds benchmark results for claims, discrimination, and content filter guardrails. Updates UI compliance prompt data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryAdds 5 new content filter guardrail categories for healthcare claims agent chatbots (
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/claims_fraud_coaching.yaml | New guardrail category for detecting claims fraud coaching. Well-structured with 3-layer detection (conditional, always-block, regex), plus exceptions for fraud prevention/detection contexts. 50/50 eval split with 100% precision/recall. |
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/claims_medical_advice.yaml | New guardrail for blocking medical advice in claims context. Allows legitimate claims-related medical term usage (code lookups, coverage) while blocking diagnosis/treatment recommendations. Comprehensive exception list for insurance terminology. |
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/claims_phi_disclosure.yaml | New guardrail for detecting unauthorized PHI disclosure and bulk data extraction. Allows self-service ("my own", "my claim") and aggregate data. Well-designed exception list for HIPAA educational content. |
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/claims_prior_auth_gaming.yaml | New guardrail for detecting prior authorization gaming (code manipulation, medical necessity misrepresentation). Good exceptions for legitimate prior-auth inquiries (status checks, appeals, documentation). |
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/claims_system_override.yaml | New guardrail for system override injection and role impersonation. Some always-block keywords like "without restrictions" and "claims records" are broad and could cause false positives outside the eval dataset, though the eval suite passes 100%. |
| litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py | Adds 5 new test classes following the existing pattern exactly. Each class loads its JSONL, creates a content filter, and runs the confusion matrix. Consistent with existing test structure. |
| policy_templates.json | Adds the "claims-agent-safety" policy template entry with 5 guardrail definitions. Points directly to category YAML files (not combined template). Correct structure matching existing patterns. |
| ui/litellm-dashboard/src/data/claimsCompliancePrompts.ts | Adds 315 compliance prompts across 17 categories for claims assistant testing. Comment says "250 prompts" but actual count is 315. Pattern follows existing codeExecutionCompliancePrompts.ts structure. |
| ui/litellm-dashboard/src/data/compliancePrompts.ts | Adds import and spread of claimsCompliancePrompts, plus new "Claims Assistant" framework metadata entry. Minimal, correct changes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User Input Text] --> B{Exception Match?}
B -->|Yes| C[ALLOW]
B -->|No| D{Conditional Match?<br/>identifier + block word<br/>in same sentence}
D -->|Yes| E[BLOCK]
D -->|No| F{Phrase Pattern<br/>Regex Match?}
F -->|Yes| E
F -->|No| G{Always-Block<br/>Keyword Match?}
G -->|Yes| E
G -->|No| H{Regular Keyword<br/>Match?}
H -->|Yes| I{Category Exception?}
I -->|Yes| C
I -->|No| E
H -->|No| C
subgraph "New Claims Categories"
J[claims_fraud_coaching]
K[claims_phi_disclosure]
L[claims_prior_auth_gaming]
M[claims_system_override]
N[claims_medical_advice]
end
D -.->|each category checked| J
D -.->|each category checked| K
D -.->|each category checked| L
D -.->|each category checked| M
D -.->|each category checked| N
Last reviewed commit: 4e9936a
| - "file an appeal" | ||
| - "file an appeal" | ||
| - "my prior authorization was denied" |
There was a problem hiding this comment.
Duplicate exception entry
"file an appeal" is listed twice in the exceptions list (lines 123 and 124). While this won't cause a runtime error (duplicate strings in a list are harmless), it looks like a copy-paste artifact.
| - "file an appeal" | |
| - "file an appeal" | |
| - "my prior authorization was denied" | |
| - "file an appeal" | |
| - "my prior authorization was denied" |
| # Claims Agent Safety — Comprehensive Policy Template | ||
| # | ||
| # A production-ready policy template for healthcare claims agent chatbots. | ||
| # Combines detection for the highest-signal failure cases: | ||
| # | ||
| # 1. Fraud coaching — exaggeration, fabrication, document forgery | ||
| # 2. PHI disclosure — unauthorized access, bulk data extraction, HIPAA violations | ||
| # 3. Prior-auth gaming — code manipulation, medical necessity misrepresentation | ||
| # 4. System override — prompt injection, adjudication rule bypass, role impersonation | ||
| # 5. Medical advice — diagnosis, treatment recommendations, medication guidance | ||
| # | ||
| # This template is a standalone policy that can be deployed as a single guardrail. | ||
| # For finer-grained control, use the individual category files in categories/: | ||
| # - claims_fraud_coaching.yaml | ||
| # - claims_phi_disclosure.yaml | ||
| # - claims_prior_auth_gaming.yaml | ||
| # - claims_system_override.yaml | ||
| # - claims_medical_advice.yaml | ||
| # | ||
| # Usage in litellm proxy config: | ||
| # guardrails: | ||
| # - guardrail_name: "claims-safety" | ||
| # litellm_params: | ||
| # guardrail: "litellm_content_filter" | ||
| # mode: "pre_call" | ||
| # categories: | ||
| # - category: "claims_agent_safety" | ||
| # enabled: true | ||
| # action: "BLOCK" | ||
| # category_file: "litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/policy_templates/claims_agent_safety.yaml" | ||
| # | ||
| category_name: "claims_agent_safety" | ||
| description: "Comprehensive safety policy for healthcare claims agent chatbots — covers fraud, PHI, prior-auth gaming, system override, and medical advice" | ||
| default_action: "BLOCK" |
There was a problem hiding this comment.
Combined template is missing ~50% of entries from individual category files
The combined claims_agent_safety.yaml policy template is documented as combining all 5 categories into "a single deployable policy", but it is significantly stripped down compared to the sum of the individual files:
- always_block_keywords: 64 entries missing (e.g.,
"fraudulent workers comp","stage a car accident","gets automatically approved","auto-approved","skip prior authorization","all claimants","all member records","ignore the coverage","disable the auto-deny","diagnose what's wrong","need surgery","indicate cancer", and 52 more) - exceptions: 51 entries missing (e.g., fraud prevention variants like
"anti-fraud","fraud investigation", PHI self-service like"my own medical","send my claim documents", prior-auth terms like"urgent","emergency services","retroactive") - additional_block_words: 38 entries missing (e.g.,
"ADHD","ibuprofen","herniated disc","pre-authorization","preauthorization","billing details","pregnancy-related") - identifier_words: ~28 entries missing (all
-inggerund forms like"exaggerating","fabricating","forging", etc., plus"access","duplicate claim","alter") - phrase_patterns: 6 of 11 patterns missing (including both prior-auth gaming regex patterns)
The missing always_block_keywords means the combined template will fail to catch many explicitly harmful phrases that the individual files would block. The missing exceptions means the combined template will produce more false positives on legitimate queries (e.g., HIPAA education, fraud reporting, prior-auth process inquiries). If this policy template is intended as a convenience wrapper with the same detection behavior, it needs to be expanded. If it's intentionally a lighter-weight subset, that should be documented clearly.
…ng.yaml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The claims-agent-safety template in policy_templates.json references individual category files in categories/, not this combined file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile please re-review this |
| @@ -0,0 +1,621 @@ | |||
| /** | |||
| * Claims Assistant Security + UX Dataset (250 prompts) | |||
There was a problem hiding this comment.
Inaccurate prompt count in comment
The file header says "250 prompts" but the actual total from the Array.from({ length: N }) calls sums to 315 prompts (30+20+20+20+25+30+25+20+20+20+10+10+20+10+15+10+10). Consider updating the comment to match.
| * Claims Assistant Security + UX Dataset (250 prompts) | |
| * Claims Assistant Security + UX Dataset (315 prompts) |
* Add claims agent guardrails with 243-case eval dataset 5 new category guardrails for healthcare claims agent chatbots: - claims_fraud_coaching: fraud coaching, exaggeration, document forgery - claims_phi_disclosure: unauthorized PHI access, bulk data extraction - claims_prior_auth_gaming: code manipulation, medical necessity misrepresentation - claims_system_override: system injection, rule bypass, role impersonation - claims_medical_advice: medical advice (claims-context-aware) Plus claims_agent_safety.yaml policy template combining all 5. All 5 eval suites pass at 100% precision/recall/F1 (243 test cases). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add claims agent chatbot safety policy template Combines the 5 claims guardrails into a single deployable policy template: fraud coaching, PHI disclosure, prior-auth gaming, system override, and medical advice. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add guardrail benchmark results and UI compliance prompts Adds benchmark results for claims, discrimination, and content filter guardrails. Updates UI compliance prompt data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove duplicate "file an appeal" exception in claims_prior_auth_gaming.yaml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Remove unused claims_agent_safety.yaml policy template The claims-agent-safety template in policy_templates.json references individual category files in categories/, not this combined file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…#22113) * Add claims agent guardrails with 243-case eval dataset 5 new category guardrails for healthcare claims agent chatbots: - claims_fraud_coaching: fraud coaching, exaggeration, document forgery - claims_phi_disclosure: unauthorized PHI access, bulk data extraction - claims_prior_auth_gaming: code manipulation, medical necessity misrepresentation - claims_system_override: system injection, rule bypass, role impersonation - claims_medical_advice: medical advice (claims-context-aware) Plus claims_agent_safety.yaml policy template combining all 5. All 5 eval suites pass at 100% precision/recall/F1 (243 test cases). * Add claims agent chatbot safety policy template Combines the 5 claims guardrails into a single deployable policy template: fraud coaching, PHI disclosure, prior-auth gaming, system override, and medical advice. * Add guardrail benchmark results and UI compliance prompts Adds benchmark results for claims, discrimination, and content filter guardrails. Updates UI compliance prompt data. * Remove duplicate "file an appeal" exception in claims_prior_auth_gaming.yaml * Remove unused claims_agent_safety.yaml policy template The claims-agent-safety template in policy_templates.json references individual category files in categories/, not this combined file. ---------
Summary
claims_agent_safety.yamlpolicy template that combines all 5 into a single deployable policytest_eval.pyGuardrails added
claims_fraud_coachingclaims_phi_disclosureclaims_prior_auth_gamingclaims_system_overrideclaims_medical_adviceEach uses 3-layer detection: conditional matching (identifier + block word in same sentence), always-block keywords, and regex phrase patterns — with exceptions to prevent false positives on legitimate claims operations.
Test plan
pytest litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py -k "Claims" -v -s