If you're building a healthtech SaaS on Vercel or Supabase, you've probably hit this wall: they won't sign a Business Associate Agreement (BAA) unless you're already at enterprise scale. Without a BAA, you can't legally process PHI on their platform. So you're stuck—your stack is cheap and easy to deploy, but it's a compliance dead end the moment a real customer asks for HIPAA proof.
I moved my boilerplate to AWS RDS specifically because AWS will sign a BAA for free. But signing the BAA is only half the battle. The other half is proving, in an audit, that no one altered or deleted your audit logs after they were written. A simple updated_at column doesn't cut it.
Here's how I made the audit logs tamper-proof with PostgreSQL triggers.
The trigger: block UPDATE and DELETE on audit rows
This trigger fires before any UPDATE or DELETE on audit_logs and raises an exception, making the table append-only.
sql CREATE OR REPLACE FUNCTION prevent_audit_log_mutation() RETURNS TRIGGER AS $$ BEGIN RAISE EXCEPTION 'Audit logs are immutable. INSERT only—no updates or deletes allowed.'; END; $$ LANGUAGE plpgsql; CREATE TRIGGER audit_log_immutable_trigger BEFORE UPDATE OR DELETE ON audit_logs FOR EACH ROW EXECUTE FUNCTION prevent_audit_log_mutation(); If you need to correct something, you insert a new correcting row instead of mutating history. The original entry stays intact. That's what auditors actually look for—immutable evidence, not a pretty dashboard. Why AWS RDS makes sense here Free BAA: AWS signs a HIPAA BAA at no extra cost. Vercel and Supabase don't offer this at startup-friendly pricing. RDS is HIPAA-eligible: PostgreSQL on RDS, with encryption at rest and in transit, is covered under the BAA. You control the triggers: Unlike managed serverless platforms where you can't touch the database layer, RDS lets you run raw SQL and enforce immutability at the storage level. Compliance isn't a badge you buy. It's architecture you build in from day one. If you want a head start, I packaged this trigger setup, the Creem webhook flow, and the GitHub provisioning logic into a HIPAA-ready boilerplate here: https://gethipaaready.tech