Healthcare Compliance
The healthcare-compliance policy runs in the output phase. It blocks configured medical phrases. It adds disclaimer text before medical advice.
This policy is a deterministic phrase and disclaimer rule. It does not determine clinical accuracy, medical-device status, or regulatory compliance.
Configuration
pack:
name: healthcare-compliance
version: 1.0.0
enabled: true
policies:
chain:
- healthcare-compliance
policy:
healthcare-compliance:
blocked_patterns:
- diagnose you with
- prescribe
- stop taking
- surgery is necessary
required_disclaimers:
- This is not medical advice.
- Consult a licensed clinician for diagnosis or treatment decisions.
fda_class: II
Fields
| Field | Type | Description | Default |
|---|---|---|---|
blocked_patterns | string[] | Case-insensitive substrings that cause a block when found in the output. | [] |
required_disclaimers | string[] | Disclaimer lines with a newline between them. The gateway adds them before output that looks like medical advice. | [] |
fda_class | I | II | III | Used for policy details and for the built-in default disclaimer when required_disclaimers is empty. | II |
Behavior notes
- The policy uses plain substring checks for
blocked_patterns. It does not use regex evaluation. - The built-in advice heuristic looks for terms such as
diagnose,treat,prescribe,dosage,take 500 mg,start taking,stop taking,contraindication, andside effects. - If
required_disclaimersis empty, the policy uses one built-in disclaimer based onfda_class:I→General health information only; not medical advice.II→This is not medical advice. Consult a licensed clinician.III→This is not medical advice and must not be used for diagnosis or treatment decisions. Consult a licensed clinician.
fda_classdoes not add automatic block rules. Onlyblocked_patternsand the built-in advice check can cause a block.
Use cases
Block prescribing language
policy:
healthcare-compliance:
blocked_patterns:
- prescribe
- increase the dose
- stop taking
required_disclaimers:
- This is not medical advice.
Use class-based default disclaimer
policy:
healthcare-compliance:
blocked_patterns:
- diagnose you with
- this is cancer
fda_class: III
How it works
- After the upstream model returns a response, the policy lowercases the output text.
- If the response contains a configured
blocked_patternssubstring, the response is blocked. - If no pattern matches, the gateway checks its built-in medical-advice heuristic.
- If the response looks like medical advice, the gateway checks its start for the disclaimer text.
- If the text is missing, the gateway adds the disclaimer before the output.
Best practices
- Write
blocked_patternsas literal phrases that must not occur. - Keep disclaimers short because the gateway adds them verbatim at the start of the output.
- Use
fda_classfor documentation and the default disclaimer. It does not replace a correct block list. - Pair with
hipaa-phi-detectorwhen patient data must also be redacted or blocked. - Use
stream: falsewhen this output control is necessary. The active SSE path does not run this evaluator.
Next steps
- HIPAA PHI Detector — Protected health information controls
- Human Oversight — Review and escalation
- PII Detector — Personal-data protection
- Safety Filter — More safety controls