---
title: "Handling Protected Health Information Under HIPAA: Best Practices for Developers"
description: "Any health data linkable to a person is Protected Health Information under HIPAA, including incidental data such as IP addresses logged during telehealth visits, ZIP codes in dashboards, or names in query logs and staging tables."
url: "https://swe.quest/articles/handling-protected-health-information-under-hipaa-best-practices-for-developers-d635ed48cb899fa8"
canonical: "https://neon.com/blog/hipaa-best-practices-for-developers"
source: "Neon"
published: "2025-06-13"
difficulty: "medium"
kind: "How-to"
reading_minutes: 11
tags: ["privacy","security","postgres"]
---

# Handling Protected Health Information Under HIPAA: Best Practices for Developers

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-06-13, 11 min read, How-to. Original: [https://neon.com/blog/hipaa-best-practices-for-developers](https://neon.com/blog/hipaa-best-practices-for-developers)

## Summary

Any health data linkable to a person is Protected Health Information under HIPAA, including incidental data such as IP addresses logged during telehealth visits, ZIP codes in dashboards, or names in query logs and staging tables. The guide lists HIPAA's 18 identifiers and contrasts Safe Harbor de-identification (strip the identifiers, keep only years and 3-digit ZIPs, easy to automate in SQL views) with Expert Determination (date shifting, aggregation, k-anonymity for more analytical utility). Practices covered: AES-256/TLS 1.2+ with managed keys, no real PHI in dev/test, least-privilege RBAC with MFA, no PHI in URLs, BAAs for every third-party service, audit-logging access but not content, sanitizing free text and file metadata, and planning incident response early. It is framed around Neon Postgres becoming HIPAA-compliant.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Privacy](https://swe.quest/tags/privacy.md) (Security)
- [Security](https://swe.quest/tags/security.md) (Security)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)

## Prerequisites

- web application security basics ([easy posts on Application security](https://swe.quest/tags/appsec.md?difficulty=easy))
- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

HIPAA, PHI, Safe Harbor, Expert Determination, k-anonymity, Neon, PGAudit

## Related posts

- [The Difference Between Postgres Logging and PGAudit](https://swe.quest/articles/the-difference-between-postgres-logging-and-pgaudit-3a35dae235b4a4b7.md): Neon · 2025-05-28 · Medium · 8 min read · PostgreSQL, Privacy, Security, Observability
  Postgres's built-in logging is designed for operational monitoring and troubleshooting, while PGAudit produces structured audit logs for compliance regimes like HIPAA, SOX and PCI DSS.
- [De-identifying text at scale: How Airbnb protects personal data in AI training](https://swe.quest/articles/de-identifying-text-at-scale-how-airbnb-protects-personal-data-in-ai-training-8f0e89339f2f4724.md): Airbnb Engineering · 2026-11-17 · Medium · 13 min read · Privacy, Machine learning, ML platforms, Python
  Airbnb de-identifies messages, reviews and support chats before ML training using Presidio, an open-source PII framework, shipped as an in-process Python library and a shared pipeline step whose de-identified dataset tag gates model deployment.
- [How to Handle PII in Staging Databases Without Losing Realistic Data](https://swe.quest/articles/how-to-handle-pii-in-staging-databases-without-losing-realistic-data-41c0818c53e7c05e.md): Neon · 2025-11-17 · Medium · 11 min read · Privacy, PostgreSQL, Testing, Databases
  Four common ways to get realistic but PII-safe staging data are compared, with code for each: manual CSV export plus Python anonymization scripts, Faker-based masking libraries with deterministic seeding to preserve referential integrity, fully synthetic data generators, and replication into staging with SQL masking views or the PostgreSQL Anonymizer extension (declarative security labels, dynamic masking, anonymized dumps, k-anonymity checks).
- [Schematizing Deletion at Scale](https://swe.quest/articles/schematizing-deletion-at-scale-4a9164e6bb73ed7b.md): Shopify Engineering · 2021-06-10 · Medium · 16 min read · Privacy, Data pipelines, Queues & messaging, Analytics & OLAP
  Shopify handles PII deletion in a warehouse ingesting tens of billions of events per day by requiring privacy-annotated schemas for every analytical event (4,500+ active schemas) and pseudonymising PII before it lands.
- [How we handle sensitive data in BigQuery](https://swe.quest/articles/how-we-handle-sensitive-data-in-bigquery-1b75e2ab86e89799.md): incident.io · 2024-11-14 · Medium · 10 min read · Privacy, Analytics & OLAP, Data pipelines, Python, Identity & auth
  incident.io masks sensitive data in BigQuery by default: a daily Python job applies PII and confidential policy tags to every untagged STRING/BYTES column replicated by Fivetran, so humans see only SHA256-hashed values.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
