Skip to content

feat: create hipaa toolkit - #10

Merged
IsaacBell merged 1 commit into
mainfrom
feat/hipaa2
Sep 5, 2026
Merged

feat: create hipaa toolkit#10
IsaacBell merged 1 commit into
mainfrom
feat/hipaa2

Conversation

@IsaacBell

@IsaacBell IsaacBell commented Sep 5, 2026

Copy link
Copy Markdown
Owner

CodeAnt-AI Description

Add a comprehensive HIPAA compliance toolkit for healthcare software development

What Changed

  • Adds guidance for identifying and protecting PHI across databases, APIs, logs, storage, and development environments
  • Documents HIPAA-ready AWS architecture, encryption, private storage, backups, audit logging, and monitoring practices
  • Defines minimum-necessary access by role, session timeouts, MFA requirements, OAuth/FHIR API protections, and rate limits for sensitive endpoints
  • Provides safe de-identification examples for development and test data
  • Adds vendor BAA, launch readiness, code review, and ongoing compliance checklists

Impact

✅ Fewer PHI exposure risks
✅ Clearer access and audit requirements
✅ Safer development and test data

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@codeant-ai

codeant-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 7d29af2 Sep 05, 2026 · 18:19 18:22

@codeant-ai

codeant-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai

codeant-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 7d29af24
Scan Time: 2026-09-05 18:20:22 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
IAC ✅ PASSED No IAC issues
SCA (Dependencies) ✅ PASSED Rating S: No vulnerabilities

View Full Results

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Sep 5, 2026
@IsaacBell
IsaacBell merged commit 65f892d into main Sep 5, 2026
14 checks passed
Comment on lines +125 to +133
Sid = "DenyNonVPCAccess"
Effect = "Deny"
Principal = "*"
Action = "kms:*"
Condition = {
StringNotEquals = {
"aws:sourceVpc" = var.phi_vpc_id
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: StringNotEquals treats missing aws:sourceVpc as a match, so AWS service integrations and recovery operations can be denied by this key policy. [security]

Assessment: 🔴 Critical · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** apps/hipaa-toolkit/skills/HIPAA Compliance Agent Skill (Original).md
**Line:** 125:133
**Comment:**
	*Security: `StringNotEquals` treats missing `aws:sourceVpc` as a match, so AWS service integrations and recovery operations can be denied by this key policy.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +242 to +251
def sanitize_error_message(message: str) -> str:
"""Replace any potential PHI with a reference token."""
import re
# Remove SSN patterns
message = re.sub(r'\b\d{3}-\d{2}-\d{4}\b', '[SSN_REDACTED]', message)
# Remove email patterns
message = re.sub(r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}', '[EMAIL_REDACTED]', message)
# Remove phone patterns
message = re.sub(r'\b\d{3}[-.]?\d{3}[-.]?\d{4}\b', '[PHONE_REDACTED]', message)
return message

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: sanitize_error_message leaves names, medical record numbers, dates, addresses, URLs, and other PHI in audit failure messages. [security]

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** apps/hipaa-toolkit/skills/HIPAA Compliance Agent Skill (Original).md
**Line:** 242:251
**Comment:**
	*Security: `sanitize_error_message` leaves names, medical record numbers, dates, addresses, URLs, and other PHI in audit failure messages.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +310 to +318
if not PHI_ACCESS_MATRIX.get(role, {}).get(resource_type):
audit_access_denied(user.id, resource_type)
raise PermissionError(
f"Role {role.value} cannot access {resource_type}. "
f"Minimum necessary access violated."
)

audit_access_granted(user.id, resource_type)
return func(*args, **kwargs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The truthy deidentified value grants researchers access, but the decorator does not de-identify or restrict the wrapped function's returned patient data. [security]

Assessment: 🔴 Critical · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** apps/hipaa-toolkit/skills/HIPAA Compliance Agent Skill (Original).md
**Line:** 310:318
**Comment:**
	*Security: The truthy `deidentified` value grants researchers access, but the decorator does not de-identify or restrict the wrapped function's returned patient data.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +394 to +396
@app.get("/fhir/r4/Patient/{patient_id}")
@limiter.limit("60/minute") # Per authenticated user
async def get_patient(...): ...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The rate limiter is attached to a duplicate route registered after the protected handler, so requests can match the first route without rate limiting. [api mismatch]

Assessment: 🟠 Major · 🔁 Occurrence: Often

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** apps/hipaa-toolkit/skills/HIPAA Compliance Agent Skill (Original).md
**Line:** 394:396
**Comment:**
	*Api Mismatch: The rate limiter is attached to a duplicate route registered after the protected handler, so requests can match the first route without rate limiting.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@codeant-ai

codeant-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. The skill links to references/aws-hipaa-services.md and references/founder-hipaa-roadmap.md, but this PR adds neither file, leaving required guidance unavailable.

Api mismatch · apps/hipaa-toolkit/skills/HIPAA Compliance Agent Skill (Original).md:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant