Framework-agnostic compliance middleware for clinical AI agents (HIPAA, FDA TPLC, IEC 62304).
pip install clinicsentry==0.6.1 Copy PIP instructions
ClinicSentry is an open-source Python library that wraps any AI agent framework (LangGraph, CrewAI, Google ADK, OpenAI Agents SDK, Claude SDK, MCP, A2A) and enforces clinical-domain guardrails — without requiring changes to your existing agent code.
pip install clinicsentry # core pip install 'clinicsentry[all]' # everything (Presidio, FHIR, OTEL, cloud KMS, …) Extras: [postgres], [cloud-kms], [otel], [dashboard], [all]
from clinicsentry import ClinicSentry, ClinicalRiskTier guard = ClinicSentry(framework="my-agent") # 1. Scan input for PHI scan = guard.firewall.scan( {"note": "Patient Jane Doe (MRN 12345678), SSN 123-45-6789"}, origin_agent="intake", ) print(scan.redacted) # PHI replaced with [REDACTED:MRN], [REDACTED:SSN] # 2. Register actions with risk tiers @guard.register_action( tier=ClinicalRiskTier.ADVISORY, description="Summarize a clinical note", required_fields={"note"}, ) def summarize(payload: dict) -> str: return f"Summary ({len(payload['note'])} chars)" # 3. Evaluate — router decides: proceed / escalate / block decision = guard.evaluate_action( "summarize", output_text="Summary of visit note", reasoning_text="High confidence, structured input", provided_fields={"note"}, ) print(decision.action, decision.confidence) # 4. End session → regulatory compliance report report = guard.end_session(intended_use="clinical summarization") print(report.compliance_attestation) Or let the context manager guarantee the session boundary — SESSION_END is audited even if your pipeline raises:
with ClinicSentry(framework="my-agent") as guard: ... # scans, evaluations, tool calls # report available as guard.last_report Risk Tiers Tier Behavior Example INFORMATIONAL Auto-proceed; audit logged "How do I use my device?" ADVISORY Proceed with annotation; confidence score visible Triage patients by glucose trends INTERVENTIONAL Auto-blocked; routed to human reviewer Adjust insulin dosing parameters Unregistered actions escalate by default (fail closed) — see escalation.on_unregistered_action in the policy reference.
clinicsentry demo # seeded demo session clinicsentry scan "Patient SSN 123-45-6789" # one-shot PHI scan clinicsentry verify ./audit.sqlite --secret # verify audit chain clinicsentry report ./audit.sqlite --session # compliance report clinicsentry policy-validate examples/policy.yaml # validate policy file Bundled Compliance Frameworks Framework Key rules HIPAA PHI redacted, audit signed, chain integrity, minimum necessary FDA TPLC Session boundaries, no sequence gaps, postmarket data capture IEC 62304 Agent traceability, chain integrity, interventional escalation EU AI Act Transparency, human oversight All four are checked automatically by clinicsentry report.
# Postgres audit + S3 + OTEL + Grafana dashboard docker compose -f deploy/compose/docker-compose.yml up Open http://localhost:3000 (Grafana) or http://localhost:9001 (MinIO).
v0.6.1 — pre-1.0 software (per-module status). SemVer: breaking changes only in minor releases until 1.0, always flagged in the CHANGELOG with migration notes. Only the latest minor release receives security fixes (security policy — PHI-detection bypasses are treated as vulnerabilities, reported privately).
Presidio is a complementary detector (we wrap it via [phi]); rails frameworks are complementary conversation shapers. ClinicSentry is the compliance enforcement and evidence layer between your agent and the world.
Apache-2.0. See LICENSE and NOTICE. Apache-2.0 permits commercial use, modification, and redistribution — including inside proprietary products.
Both files in this release have provenance metadata.
adk all claude cloud-kms crewai dashboard dev dicom docs fhir hl7 hsm langgraph mcp metrics nlp-medical ocr openai-agents otel pdf phi postgres s3 signing test
agents fda guardrails healthcare hipaa iec62304 llm samd
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




