Skip to main content

MedGuard

Join our Discord Subscribe on YouTube Connect on LinkedIn Follow on X.com

MedGuard is a robust, production-grade Python library that ensures HIPAA compliance for large language model (LLM) agents. Designed for enterprise applications in healthcare, MedGuard provides comprehensive security, privacy, and compliance frameworks that integrate seamlessly into your AI-driven workflows. The library guarantees that your AI models and agents operate within strict regulatory boundaries, particularly the Health Insurance Portability and Accountability Act (HIPAA), ensuring the protection of sensitive health data.

Key Features

  • HIPAA-Compliant Workflows: Ensures that LLM agents handle Protected Health Information (PHI) securely and within HIPAA guidelines.
  • End-to-End Encryption: Provides automatic encryption for data in transit and at rest to protect sensitive health data.
  • Audit Logging: Tracks all agent interactions, data access, and usage patterns for auditing and compliance reporting.
  • Role-Based Access Control (RBAC): Fine-grained control over who can access and interact with specific data points within the system.
  • Data Anonymization and Masking: Automatically anonymizes or masks PHI when shared, minimizing the risk of data breaches.
  • Seamless Integration: Designed to integrate with popular AI/LLM libraries such as OpenAI, Hugging Face, and custom LLM architectures.
  • Configurable Policies: Allows for the customization of compliance policies and controls according to specific organizational needs.
  • Scalable Infrastructure: Built to support enterprise-level deployments, capable of scaling across cloud, hybrid, and on-premise environments.
  • Comprehensive Testing Suite: Includes unit tests, integration tests, and compliance checks to ensure secure and reliable operations.

Installation

To install MedGuard, use the following pip command:

pip install medguard

Quick Start

Here’s a quick guide to get MedGuard up and running in your environment:

1. Setting Up Your MedGuard Environment

from medguard import MedGuard

# Initialize MedGuard with your organization's compliance configuration
medguard = MedGuard(api_key="your_api_key", 
                    encryption_key="your_encryption_key", 
                    compliance_level="HIPAA")

2. Integrating MedGuard with Your LLM Agent

from your_llm_library import YourLLMAgent

# Create an instance of your LLM agent
llm_agent = YourLLMAgent()

# Wrap the LLM agent with MedGuard for HIPAA compliance
compliant_agent = medguard.wrap_agent(llm_agent)

# Use the compliant agent to ensure all communications adhere to HIPAA guidelines
response = compliant_agent.process("Analyze this patient's health record and recommend treatment.")

3. Anonymizing Sensitive Data

# Automatically anonymize sensitive data in the agent's output
anonymized_output = medguard.anonymize(response)

4. Logging and Auditing

# Log and audit all interactions for compliance review
medguard.audit.log_interaction(agent_id="1234", user_id="5678", input_data="Patient data", output_data=response)

Enterprise Features

Role-Based Access Control (RBAC)

MedGuard supports advanced role-based access to ensure only authorized users and systems can access PHI.

# Define roles and permissions
medguard.set_role("doctor", permissions=["read", "write"])
medguard.set_role("nurse", permissions=["read"])

Audit and Compliance Reporting

MedGuard provides detailed audit logs and compliance reports, ensuring that your AI systems remain transparent and fully auditable.

# Generate audit reports
audit_report = medguard.generate_compliance_report(start_date="2024-01-01", end_date="2024-01-31")
print(audit_report)

End-to-End Encryption

MedGuard enforces encryption both in transit and at rest for all interactions with LLM agents.

# Encrypt sensitive data before processing
encrypted_data = medguard.encrypt_data(patient_record)

# Decrypt after processing
decrypted_data = medguard.decrypt_data(encrypted_data)

Best Practices

  • Data Minimization: Only include necessary PHI when processing data with MedGuard to reduce the risk of exposure.
  • Periodic Audits: Regularly review audit logs and compliance reports to ensure continuous adherence to HIPAA regulations.
  • Automated Alerts: Set up automated alerts for suspicious activity or policy violations using MedGuard's built-in monitoring tools.

Customization

MedGuard offers a flexible configuration system, allowing your organization to tailor compliance rules to fit specific regulatory environments.

# Customize compliance policies
medguard.set_policy("data_retention_period", "30_days")
medguard.set_policy("encryption_algorithm", "AES-256")

Scalability and Performance

MedGuard is built with enterprise scalability in mind, supporting multi-node clusters, cloud-native environments, and hybrid deployments.

  • Cloud Support: Full support for AWS, Azure, and Google Cloud.
  • Horizontal Scaling: Efficiently scales with Kubernetes, Docker, or other orchestration platforms.
  • Performance Optimized: Designed for minimal latency in high-volume environments with large-scale LLM agents.

Compliance Standards

MedGuard complies with the following standards and regulations:

  • HIPAA: Health Insurance Portability and Accountability Act
  • HITRUST: Health Information Trust Alliance
  • GDPR: General Data Protection Regulation (Optional)

Contributions

MedGuard is open to contributions from the community. Please submit pull requests or file issues to help us improve and expand the library.

  1. Fork the repository.
  2. Create a new branch.
  3. Submit a pull request with a detailed description of changes.

License

MedGuard is licensed under the MIT License.

Support

For enterprise support, contact support@medguard.ai.

For documentation, tutorials, and examples, visit our official website.

Contact

For any inquiries or enterprise solutions, reach out to our team at info@medguard.ai.

Metadata

Release files for medguard 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for medguard 0.0.1
File Size Uploaded
medguard-0.0.1.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for medguard 0.0.1
File Interpreter ABI Platform
medguard-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / medguard-0.0.1.tar.gz

Download URL medguard-0.0.1.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4e3db69b543fdd9d487724deb0df58ffe2006cb67743bd204bd50f2dc2f43713
BLAKE2b-256 checksum
How to use checksums
690a3cf44ccf598468b986e61d93f655c0d47937784b759ad91be3ce28d10b26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0

Release files / medguard-0.0.1-py3-none-any.whl

Download URL medguard-0.0.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e49285c7719a74932d02dfed4ed67b6a9356bdca5847e30410e3af5742a5a51
BLAKE2b-256 checksum
How to use checksums
b8dfc5f9ab523214fb7bcab1c7d2508ad717157c3608f3cc0b4ae712618ec1fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page