What Breaks First in AI-Built Apps
AI-built apps break first at authorisation, database access rules, leaked secrets and unverified payment webhooks, not at the feature they were built to demo. They fail at the thing nobody demonstrate

Most AI features in regulated products die in the gap between the demo and the audit. The model works, the founder shows it to the board, and then someone from compliance asks a question the system can't answer: why did it make that decision? Where did the patient data go? What happens when the model is wrong? In a regulated product, those are the requirements, not edge cases. The AI is the easy part. The layer around it is what an auditor inspects and what determines whether you ship.
This holds across SOC 2, HIPAA, GDPR, and PCI DSS. The frameworks differ in detail, but the engineering posture that satisfies them is consistent, and that shared posture is what this post is about.
The single most important architectural decision for compliant AI is to treat the model (hosted LLM, managed ML platform, or your own trained models) as a replaceable component behind an interface. The provider landscape moves monthly; your compliance posture cannot. Everything defensible lives in the application layer you control: input validation, data handling, decision logging, explainability, access control, fallback logic.
Auditors audit your controls, not the model. If your controls are entangled with a provider's SDK, every model swap becomes a re-audit. Keep the boundary clean and you can change models without re-architecting the controls an auditor signed off on.
An immutable, append-only decision log is the most valuable artifact you can build for a regulated AI system. For every consequential decision the AI touches (a flagged transaction, a triaged patient, a declined application, a suppressed alert) record:
This is what an examiner asks for, what lets you reconstruct a disputed decision months later, and, under SOC 2, the evidence that your processing-integrity and monitoring controls are real rather than aspirational. If you cannot replay why the system did what it did, you have a liability, not a compliant system. Our free Audit Trail Validator exists to pressure-test this layer against what regulators expect to see.
One subtlety: the decision log itself often contains sensitive data, so it inherits the same handling requirements (access control, retention limits, encryption) as the data it records. Design it as a controlled store, not a debug dump.

The narrower the surface where regulated data flows, the smaller your audit, your breach exposure, and your ongoing cost. This principle takes a different concrete form per framework, but it's always the same move: keep sensitive data out of the components that don't strictly need it.
The common thread: scope creep is the silent compliance killer. Every new AI feature that reaches toward regulated data can pull more of your system into audit scope. Guard the boundary deliberately.
Every AI component needs defined behavior for when it is slow, down, or low-confidence, and in a regulated flow that fallback is a policy decision, not an error message. Does an unavailable fraud scorer mean hold for manual review or allow with a flag? Does a low-confidence triage model escalate to a clinician or default to the safest disposition? These belong to your compliance and risk owners; the engineering job is to make the decision explicit, configurable, and logged.
The related principle is human-in-the-loop on consequential decisions. A model can rank, pre-fill, or recommend, but where the decision carries regulatory weight, a human stays accountable. This also protects against automation bias, the well-documented tendency of reviewers to defer to a model's output: design the interface to surface uncertainty and require real review rather than one-click approval.
A few realities that reshape how you build, stated plainly:
None of this is a reason to avoid AI in regulated products. It's a reason to build the boring layer well.
If you already have an AI feature in production and aren't sure it would survive an examiner or a SOC 2 auditor, a Tech Audit is a focused diagnostic of architecture, data handling, and audit-readiness. You can also start from our compliance overview.
Compliant AI is about the layer that makes the model trustworthy: a swappable core, immutable decision logs, contained data blast radius, explicit fallbacks, and human accountability on consequential decisions. That layer is what an auditor inspects and what your customers' data depends on. Build it with intent, and compliance stops being a blocker and becomes the reason your AI is defensible.
Written by
Senior Software Engineer
Senior software engineer at Robust Devs, working across PHP, Laravel, ReactJS, and AWS.
AI-built apps break first at authorisation, database access rules, leaked secrets and unverified payment webhooks, not at the feature they were built to demo. They fail at the thing nobody demonstrate
A code audit report earns its fee when it contains four things: an executive summary the person paying can act on, findings ranked by severity that cite specific files and lines, an architecture asses
Technical due diligence rarely kills a round. It re-prices one, and it does so at the worst possible moment: after the term sheet exists, when the fund has already decided it wants in and you have alr

Tactical writing for founders building AI products. Browse the archive for more field notes like this one.
Browse all articlesIf you are building in this space, book a call or get in touch.