AI in Regulated SDLC: HIPAA/SOC2 Audit Trails with Agentic Workflows

Regulators do not accept 'the AI wrote it' as an audit response. How to govern AI-assisted development so it holds up in HIPAA, SOC 2 and ISO 27001 audits.

By VVVHQ Team ·

AI coding agents now write and change code in companies that answer to HIPAA, SOC 2 auditors, ISO 27001 certification bodies or the FDA. None of those frameworks has a separate category for code written by a model. They ask what they always asked: who was accountable for a change, which controls applied to it, and whether you can prove it. "The AI wrote it" answers none of those questions.

For a leadership team that is good news. The controls auditors expect for AI-written code are mostly the change-management controls you already run, applied to a new kind of contributor and enforced by the pipeline.

What the frameworks ask for

HIPAA

The Security Rule requires access controls, audit controls and integrity protections for systems that handle protected health information (PHI). For AI agents, that means deciding which repositories and environments each agent can reach, logging every change an agent makes to a system that processes PHI, and keeping PHI out of the places agents work. PHI in test fixtures, logs or a developer database is hard to justify under the minimum necessary standard in any case, and a coding tool vendor that could receive PHI would need a business associate agreement.

SOC 2

The change management criterion, CC8.1, expects each change to production to be authorized, tested and approved. AI-generated changes are changes like any other. Auditors look for the intent, the approval and the deployment record, and for separation between the person who asked for a change and the person who approved it. Collect that evidence continuously, so it already exists when the auditor asks.

ISO 27001

ISO 27001 asks for a risk assessment that covers the tools in your development process, and its Annex A controls for the secure development life cycle (8.25) and secure coding (8.28) apply to code from any source. AI agents bring risks that belong in the risk register: plausible but wrong code, suggested dependencies that nobody vetted, and data sent to an outside model. Teams that want a management system specifically for AI can look at ISO/IEC 42001.

Medical device software

The FDA's AI guidance for devices deals with AI functions inside the device. Code that an assistant writes for a device is held to the same lifecycle expectations as other device software: IEC 62304 and the design controls of the Quality Management System Regulation, in force since February 2026. Every change still needs a traceable requirement, a review and verification.

Four controls for agentic work

A named person approves every AI-generated change

Each change an agent produces has a named human approver on record, who reviews it against the security and compliance requirements and authorizes it for the pipeline. The approver owns the change.

An audit trail for each change

The trail records who started the agent and for which task, what the agent changed and what it could access while doing so, and who reviewed and approved the result before it reached production. Keep it in append-only storage that cannot be edited after the fact.

The requester does not approve

The person who triggers an agent should not be the one who approves its output. GitHub's branch rules do not know who asked the agent for a change, so record the requester on the pull request and add a required status check that fails when the requester is the only approver.

Agents work away from sensitive data

Agents run in sandboxed environments with no access to production data, PHI, other personal data or secret stores. Development and tests use synthetic or de-identified data.

How it looks in the pipeline

Commits are signed, and agent commits carry the agent's own identity, so authorship is clear in the history. Branch protection requires a human approval before merge, with bypass turned off for administrators too.

Pipeline gates run security scanning, license checks and policy checks on every change, and a failed gate blocks promotion.

Each build produces an SBOM, which shows every dependency an agent added. On a regulated medical-device platform we built CI/CD for more than 25 repositories, with SAST and SBOM generation in the pipelines.

Agents run in short-lived, isolated environments with least-privilege access and no route to production systems, customer data or secrets, and every environment they use is logged.

Where data residency matters, pin the model endpoint as well. For a healthtech AI startup we pinned AI inference to a healthcare customer's country and verified it against the provider's audit logs.

Governance and speed

These controls make audits cheaper. When the pipeline records every change, approval and boundary as it happens, the evidence is there when the auditor asks, instead of being assembled by hand before each audit. They also make the next tool easier to adopt, because the question of how it fits the controls already has an answer.

We were the only infrastructure owner of that healthtech AI startup for 21 months, through its SOC 2 audit, running the infrastructure controls and keeping the evidence current in Vanta. If you are bringing AI coding tools into a regulated environment, send us a few lines about your setup and we will tell you which controls we would put in place first.

Tags: ai compliance, regulated industries, hipaa, soc2, agentic workflows