To keep AI-generated code compliant with SOC 2 and ISO 27001, make sure every change is still authorised, reviewed, tested and traceable, whoever or whatever wrote it. Neither framework bans AI-written code. What auditors check is whether your controls still work when an agent is producing much of the diff, and whether you can prove it.
Is AI-generated code SOC 2 and ISO 27001 compliant?
Code is not compliant or non-compliant on its own. Your process is. SOC 2 is an attestation report on how your controls operate, measured against the AICPA Trust Services Criteria. ISO 27001 is a certifiable standard for an information security management system. Both look at how changes reach production.
So the honest answer is: AI-generated code is fine, as long as the controls around it still hold.
Which controls do coding agents put under pressure?
| Area | SOC 2 (Trust Services Criteria) | ISO 27001:2022 Annex A | What changes with agents |
|---|---|---|---|
| Change management | CC8.1 | 8.32 | Much larger, faster diffs; review gets skimmed |
| Secure development | CC8.1, CC7.1 | 8.25, 8.28 | Agents repeat insecure patterns confidently |
| Access to production | CC6.1 to CC6.3 | 8.2, 8.3 | Agents may hold tokens or run commands |
| Suppliers | CC9.2 | 5.19 to 5.21 | The AI tool itself processes your code |
| Testing | CC8.1 | 8.29 | Agents write tests that pass but prove little |
None of these are new controls. They are old controls with a new failure mode.
What will an auditor actually look at?
Expect the same questions as always, with sharper follow-ups:
- Show me how a change gets to production. They will sample pull requests and check each had an approval from someone other than the author. If an agent opened it, the approving human is the key control.
- Show me the review was real. A one-second approval on a 2,000-line diff is a weak sign. Automated checks against defined criteria strengthen the story.
- Who can deploy, and what can the agent touch? Expect questions about tokens and permissions your agents hold.
- Have you assessed the AI tools? For ISO 27001 especially, the tools are suppliers.
How to keep AI-generated code compliant: five steps
- Write a short AI coding policy. Which tools are approved, what data they may see, and that every agent change goes through a human-approved pull request.
- Give the agent your controls. Connect your coding agent to your controls through MCP, so it builds to the requirements instead of guessing. We explain how in compliance checks in Claude Code and Cursor.
- Gate every pull request. Run an automated review against your code-level controls on each pull request, and block on hard rules such as secrets in the change. See our AI code review checklist.
- Limit what agents can reach. No production credentials in agent sessions. Read-only by default.
- Keep evidence as you go. Each pull request that fixes a failing control is evidence. Record it when it merges rather than rebuilding it before the audit.
Which problems matter most?
The problems worth catching first are plain, not exotic: secrets committed in config or tests, eval or similar dynamic execution, and TLS verification switched off to get something working. These are the checks we built Keldyn's gate to flag, because they are exactly the changes a busy reviewer misses and an auditor's sample can catch.
Where Keldyn fits
Keldyn puts your SOC 2 and ISO 27001 controls into the coding agent through MCP, checks each pull request against them with the compliance gate, and keeps the resulting evidence ready for your auditor in evidence and audit. For the wider picture, see our SOC 2 guide.