What problem does it solve?
HealthFlow security guidance prevents accidental PHI leakage, bypassing redaction, broken tenant isolation, and unsafe logging when developers change authentication, LLM agents, database models, or configuration.
Core Features & Use Cases
- PHI-safe agent prompting: Enforces building prompts only via the
PromptInput dataclass boundary so redaction happens automatically before any LLM call.
- Tenant isolation by infrastructure: Ensures PHI queries are always scoped by
broker_id through SQLAlchemy listeners, and documents the correct patterns for cross-broker access with audit reasons.
- Automatic PHI audit logging: Defines which tables are audited, enforces listener ordering, and instructs how to query audit logs safely.
- Auth, secrets, and crypto guardrails: Specifies fail-loud environment variables, refresh-token rotation/replay handling, encryption-at-rest key versioning, and safe plaintext migration windows.
- Operational rules for external services: Covers RxNav’s non-PHI posture while treating broker search behavior as sensitive and preventing query or identifier leakage.
Quick Start
Use the healthflow-security skill when reviewing a change that touches healthflow/auth, healthflow/agents (LLM calls), PHI fields in healthflow/database/models.py, env/config, the seed script, or anything that could log request bodies.