Skip to main content

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

FieldTypeDescriptionDefault
blocked_patternsstring[]Case-insensitive substrings that cause a block when found in the output.[]
required_disclaimersstring[]Disclaimer lines with a newline between them. The gateway adds them before output that looks like medical advice.[]
fda_classI | II | IIIUsed 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, and side effects.
  • If required_disclaimers is empty, the policy uses one built-in disclaimer based on fda_class:
    • IGeneral health information only; not medical advice.
    • IIThis is not medical advice. Consult a licensed clinician.
    • IIIThis is not medical advice and must not be used for diagnosis or treatment decisions. Consult a licensed clinician.
  • fda_class does not add automatic block rules. Only blocked_patterns and 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

  1. After the upstream model returns a response, the policy lowercases the output text.
  2. If the response contains a configured blocked_patterns substring, the response is blocked.
  3. If no pattern matches, the gateway checks its built-in medical-advice heuristic.
  4. If the response looks like medical advice, the gateway checks its start for the disclaimer text.
  5. If the text is missing, the gateway adds the disclaimer before the output.

Best practices

  • Write blocked_patterns as literal phrases that must not occur.
  • Keep disclaimers short because the gateway adds them verbatim at the start of the output.
  • Use fda_class for documentation and the default disclaimer. It does not replace a correct block list.
  • Pair with hipaa-phi-detector when patient data must also be redacted or blocked.
  • Use stream: false when this output control is necessary. The active SSE path does not run this evaluator.

Next steps