Converting a vibe-coded patient-intake app to HIPAA-ready, step by step
Last reviewed:
HYPOTHETICAL EXAMPLE — not PAHL client work. The practice, app, architecture, cases and planning timeline below are invented for illustration. No real patient data, measured outcomes, completed migration or collected test evidence is represented. Every evidence item is something to collect, test or record—not a reported result.
Official sources checked November 7, 2026 (PT). Educational material, not legal advice.
Start with a useful prototype, not a verdict
Imagine you built an adult pre-visit intake app. Patients could enter contact details, medications, allergies and a reason for visiting; staff could review the submission before an appointment. Your demonstration uses wholly invented patients. Colleagues like the layout, but nobody has authorized clinical deployment.
Keep that workflow insight. AI-generated code is neither automatically unsafe nor automatically ready for practice use. The next task is deciding which components can remain, what needs refactoring and which questions must stay blocked.
For this example, assume the future operator is a covered medical practice because it conducts applicable electronic standard transactions. That is an invented applicability assumption, not a finding about you: HIPAA applies to covered entities and business associates, and being a physician or building a health app alone does not settle those definitions. HHS covered entities
“HIPAA-ready” here is our shorthand, not certification or a legal conclusion. OCR does not endorse, certify or recommend specific technologies or products. A BAA alone does not establish application compliance; HHS also describes safeguards and risk analysis. HHS cloud guidance, Q1 and Q4
Palo Alto Health Labs recommends thinking in evidence gates. This walkthrough is a planning example, not a claim that PAHL has completed this project.
Step 1: Write the scope and the human handoff
Define the proposed first release narrowly: adult scheduled-visit intake, staff review and a documented transfer into the practice's existing record workflow. Exclude diagnosis, autonomous triage, prescribing, emergency monitoring and unattended clinical decisions. Leave minors and proxy submissions out until their distinct workflows receive review.
Write prominent patient-facing instructions that the form is not for emergencies and is not continuously monitored. Have the practice approve actual emergency directions and contact alternatives. Do not invent a response-time promise. Specify who checks the queue, covers absences, handles failed submissions and confirms that information reaches the right chart.
For every field, ask what decision it supports. Remove speculative questions. Decide whether attachments are needed at all; the example initially leaves them disabled while retaining storage in the future inventory.
Collect: an intended-use statement, field dictionary, excluded-use list, staff responsibility map and proposed patient instructions. Record unresolved decisions rather than presenting them as approvals.
Step 2: Draw the invented “before” architecture
This diagram describes an illustrative demonstration, not a verified builder's behavior or an accusation about all prototypes. All its content is synthetic.
Invented cases + doctor prompts
-> AI builder / coding assistant -> prompt history and generated repository
-> shared demo preview -> browser intake form -> demo database
-> verbose debug logs / analytics
-> test email sink (no real recipients)
Demo database -> prototype summary experiment -> external model endpoint
Demo files -> demo storage -> backups
Developer screenshots / bug reports -> support workspace
Separate development inputs from runtime requests. An assistant reading repository context may see fixtures and comments. A model summarizer may see submitted form text. An email integration may see a message body even if the database remains private.
Do not connect this demonstration to a live practice database to make it more convincing. If you discover real records already present, stop the demonstration, restrict access and involve the practice's incident/privacy owners; do not casually export or delete material as an improvised remediation.
Collect: a proposed map of recipients, then test it with invented submissions and network inspection. Mark inferred flows as unverified until inspected.
Step 3: Inventory the less-visible recipients
Use this inventory as a worksheet. For every row, record operator, service/account, data fields, retention, permissions, deletion/export behavior and decision owner.
| Surface | What to inspect in the hypothetical app | Evidence to collect |
|---|---|---|
| Prompts and assistant context | Attachments, fixtures, terminal output, repository access | Sample synthetic context and allowed tool permissions |
| Preview and hosting | Public links, server rendering, caches, build artifacts | Environment map and preview-access tests |
| Database and storage | Tables, files, derived summaries, object names | Schema, policies and negative-access tests |
| Email and notifications | Bodies, subjects, delivery logs, routing | Invented-message samples sent only to test sinks |
| Analytics and AI | Replay, events, traces, model tools/fallbacks | Outbound request captures and explicit disablement decisions |
| Support and backups | Screenshots, exports, replicas, restore destinations | Support procedure and backup/retention inventory |
Include identity services, queues and scheduled jobs in the map. Do not assume that a frontend-only integration cannot disclose information. For regulated workflows, even encrypted cloud storage without the decryption key can create business-associate obligations when the provider maintains ePHI on the practice's behalf. HHS cloud guidance, Q1–2
Step 4: Resolve contracts before selecting a production path
For cloud providers acting as business associates, HHS calls for an appropriate BAA and compliance with the Rules, not simply a security badge or willingness to negotiate. Regulated entities must also conduct risk analysis across their ePHI. HHS cloud guidance, Q1
For each intended recipient, collect the applicable executed/accepted agreement and acceptance evidence, exact covered services, organization/account, eligible features, exclusions and required settings. Record who assessed the relationship. Keep unknown eligibility unresolved; do not translate “we found no answer” into “the vendor never signs.”
Distinguish builder access from hosting, consumer chat from a model API, and standard services from previews or third-party integrations. Ask for account-specific clarification when plan guidance and legal acceptance terms differ. A model name or subscription tier is not the complete contract inventory.
This example approves no named stack. Its production path remains a proposal until the relevant owners resolve agreements, configurations and risk decisions. Encryption and SOC reports may inform review; neither replaces the agreement and safeguard assessment HHS describes. HHS cloud guidance
Collect: a service-by-service decision register with owner, source, acceptance record and open questions. Do not mark an entire vendor “approved” from a single covered component.
Step 5: Review the repository and choose what survives
Preserve a reproducible synthetic-data baseline. Inventory dependencies, licenses, installation scripts and external requests. Inspect generated authentication middleware, upload handlers, database migrations and error handling. Rebuild in a clean development environment rather than relying on your personal logged-in session.
Search source, history, bundles, environment templates and build output for credentials or clinical fixtures. Rotate any exposed credentials through an authorized remediation process; deleting the latest line is not proof that a secret disappeared from history or artifacts. Keep production credentials away from coding assistants and demo environments.
Keep understandable form components and useful navigation. Refactor privileged calls, permissions or telemetry where boundaries can be repaired. Rebuild a subsystem if its data model cannot express ownership reliably or its behavior cannot be reproduced. Document component-level reasons, not a blanket claim that generated software requires replacement.
Test/record: clean-build instructions, dependency review findings, proposed changes, rollback-compatible schema changes and unresolved maintenance responsibilities.
Step 6: Sketch the vendor-neutral target
The following “after” architecture is an invented target to evaluate, not a deployed system or a claim of compliance. Keep real records out until separate launch authorization.
DEVELOPMENT — synthetic only
Invented cases -> restricted development/staging -> reviewed build pipeline
(no production database or credentials)
PROPOSED RUNTIME — after explicit approvals only
Patient browser -> authenticated intake API -> tenant-aware authorization
-> private database / private storage
Staff identity -> review queue -> authorized staff -> approved chart workflow
API -> minimized access events -> restricted event store
API -> generic notification -> approved recipient -> authenticated review queue
Database/storage -> protected backups -> isolated restore environment
Support -> approved, limited-access process; synthetic reproductions preferred
AI summarizer -> disabled for initial release; separate future decision gate
The example chooses generic notifications without clinical content, not chart copies in ordinary email. Even that notification path needs review for recipient identifiers, routing and link behavior. Do not put patient details or reusable access tokens into URLs. No generic email attachment is the migration route.
Test: that staging cannot reach production, previews require intended access, secrets stay server-side and requests follow the proposed diagram. Record deviations before deciding whether the target is usable.
Step 7: Separate authentication from authorization
Authentication asks who signed in. Authorization asks whether that person may read or change this intake. Enforce ownership and practice membership at backend and data layers, not only in hidden buttons.
Create fictional patients in separate fictional practices. Attempt to change record identifiers, call endpoints directly, follow file links and request bulk exports. Test staff transfers, disabled accounts, old sessions, background workers and privileged service keys. Bind new records to the authorized context rather than trusting a browser-supplied practice ID.
Consider shared devices and accidental browser back-navigation. Verify invitation and recovery paths as well as the normal sign-in. Recommend MFA and least privilege based on the design, without claiming this exact implementation is one universal statutory recipe.
Collect: a role/action matrix, automated denial tests and recorded findings. These are test instructions, not assertions that tenant isolation has passed.
Step 8: Design logs and patient-facing workflow together
Record meaningful access events: actor, action, resource reference, outcome and time. Avoid copying medication lists or free-text reasons into every event. Restrict event readers and define review/escalation ownership. Treat record references and user identities as information needing assessment, not inherently anonymous values.
Force synthetic failures and inspect logs, analytics, traces, alerts and support exports. Test nested errors and retry paths. Disable unnecessary replay and marketing tracking in the intake flow. Keep a separate, explicit retention decision for logs rather than inheriting a vendor default unquestioningly.
Have the practice's advisor distinguish privacy notice acknowledgement, treatment consent, optional features and authorization for particular disclosures. A generic checkbox should not be described as permission for every use: HHS distinguishes permitted uses from uses requiring authorization and describes notice/acknowledgement requirements separately. HHS Privacy Rule summary, Permitted Uses, Authorized Uses and Notice
Rehearse understandable instructions, accessibility, language support, correction requests and a non-digital alternative. Keep confirmation messages honest: “submitted” must not imply “clinically reviewed.”
Step 9: Rehearse migration without patient data
Build wholly invented cases covering blank fields, duplicate submissions, conflicting allergies, special characters, time zones and interrupted uploads. Do not rename actual charts and call the result synthetic.
Define source-to-target mappings and validation rules before importing. Rehearse in isolated staging: count expected records, compare field values and attachment references, test ownership and reconcile rejected rows. Test retries for duplication and partial failure. Record expected checks and actual findings if a real team performs them later; this article supplies no counts or success results.
Because the prototype here contains only synthetic records, do not migrate its demo patients into a production patient list. Prefer an empty approved runtime, preserving only reviewed schema/configuration. Any future clinical-record import would require its own authorized scope, controlled transfer, access, validation and rollback plan—not a copy-and-paste instruction from this walkthrough.
Collect: mapping specification, rehearsal script, reconciliation checklist, rejected-row handling and explicit authorization gates for any later real-data work.
Step 10: Decide rollback, retention, deletion and recovery
Define when to halt intake, who can stop it and how staff will continue using an approved alternative. Rehearse rolling back an application release without losing or misassigning submissions created after cutover. A schema rollback may need a forward repair rather than blindly restoring an older database.
Ask the practice's advisor to approve retention by record type and applicable obligations; this example supplies no universal medical-record or log-retention duration. Inventory replicas, exports, caches, support artifacts and backups before promising deletion. Exporting or deleting an app does not demonstrate that all copies disappeared.
HHS cloud guidance describes return/destruction at BAA termination where feasible and continuing protections for retained PHI when it is not feasible. It also explains that business-associate obligations can exist regardless of whether a BAA was executed. Do not treat subscription cancellation as proof that retained-ePHI duties vanish. HHS cloud guidance, Q5 and Q8
Restore invented records and files into an isolated environment. Test permissions and completeness, not merely whether a restore job starts. Prevent rehearsal notifications reaching patients. Record observed recovery behavior only if tested, then have the practice choose acceptable interruption and loss tolerances.
Step 11: Hold separate review and go/no-go gates
The Security Rule requires appropriate administrative, physical and technical safeguards. Risk analysis is broader than a code scan. HHS Security Rule HHS cloud guidance
Clinical safety needs a different review: could omitted allergies, wrong-patient matching or a reassuring confirmation cause harm? Test the proposed staff handoff and failure messages. Keep autonomous summary/triage features disabled unless separately evaluated. Privacy review does not determine FDA status; HHS developer resources identify multiple potentially applicable regimes based on app function. HHS developer resources
Before any real deployment decision, collect:
- Privacy/legal: applicability assessment, actual covered-service agreements and approved notice/retention decisions.
- Security/engineering: remediation findings, authorization tests, log checks, restore rehearsal and controlled deployment/rollback procedures.
- Clinical/operations: reviewed intended use, failure cases, queue coverage, training and an accessible fallback.
- Decision record: named approvers, unresolved risks, stop authority and conditions for reassessment.
These are proposed evidence categories, not evidence already collected. Missing agreement scope, unresolved cross-patient access or an unowned intake queue means pause and resolve—not launch because the calendar ended.
An explicitly illustrative planning timeline
Every week range below is a hypothetical planning allocation, not measured experience, a PAHL delivery commitment or a legal deadline. Assume a small, exportable prototype, no legacy clinical-data import, disabled AI summarization, available reviewers and no complex EHR integration.
| Hypothetical planning allocation | Proposed work | Gate, not automatic progression |
|---|---|---|
| Weeks 1–2 — hypothetical planning allocation | Scope, inventory, contract questions and repository review | Record accountable owners and resolve target-service eligibility |
| Weeks 3–4 — hypothetical planning allocation | Backend boundaries, permissions, logging and configuration | Collect reviewed implementation and negative-test findings |
| Weeks 5–6 — hypothetical planning allocation | Synthetic migration, restore/rollback and workflow rehearsals | Resolve findings and collect separate review decisions |
| Week 7 onward — hypothetical planning allocation | Only if separately authorized, plan a bounded deployment and monitoring | No launch implied; maintain stop conditions and reassess changes |
Contract approvals, security findings, staffing and integration complexity can extend or restart phases. Parallel tasks do not remove dependencies. This is not a countdown to permission for patient data.
Step 12: Keep ownership after the first release decision
Assign owners for access reviews, dependencies, vendor changes, queue failures and incident escalation. Re-run relevant tests after changing prompts, models, schema or integrations. Keep synthetic reproductions available so debugging does not begin with a copied patient chart.
Review whether the workflow still matches what patients are told. Test departure of a staff member and absence of the original developer. A working prototype becomes maintainable software through repeated evidence and accountable decisions—not a one-time badge.
For a different workflow with related handoff risks, compare the hypothetical reminder-app walkthrough, especially suppression and delivery-versus-action states.
Discuss the next step with PAHL
See Fabrica and book a 30-minute call
Palo Alto Health Labs offers a free 30-minute call to review your app or your practice's tech. Bring a synthetic-data demonstration and an architecture sketch, not patient records, real-chart screenshots or credentials. The call is not a completed compliance/security audit, certification or guarantee.