<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Max Gerhardson</title>
    <description>The latest articles on DEV Community by Max Gerhardson (@max_gerhardson_9a99976541).</description>
    <link>https://dev.to/max_gerhardson_9a99976541</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3872648%2Fbab5b0b7-3e6d-45a6-9911-ce96ef9dbe70.png</url>
      <title>DEV Community: Max Gerhardson</title>
      <link>https://dev.to/max_gerhardson_9a99976541</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/max_gerhardson_9a99976541"/>
    <language>en</language>
    <item>
      <title>How to Prove Compliance in AI-Generated Code</title>
      <dc:creator>Max Gerhardson</dc:creator>
      <pubDate>Sat, 11 Apr 2026 01:45:56 +0000</pubDate>
      <link>https://dev.to/max_gerhardson_9a99976541/how-to-prove-compliance-in-ai-generated-code-3f9j</link>
      <guid>https://dev.to/max_gerhardson_9a99976541/how-to-prove-compliance-in-ai-generated-code-3f9j</guid>
      <description>&lt;h1&gt;
  
  
  How to Prove Compliance in AI-Generated Code
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Every security tool tells you what's wrong. None prove what's right. Here's how compliance evidence maps change the audit conversation.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Problem: AI Writes Code. Auditors Ask Questions.
&lt;/h2&gt;

&lt;p&gt;84% of developers now use AI coding tools &lt;em&gt;(Stack Overflow 2025)&lt;/em&gt;. Claude Code, Cursor, and Copilot generate thousands of lines of code per week. That code ships to production, handles patient data, processes payments, and runs critical infrastructure.&lt;/p&gt;

&lt;p&gt;Then the auditor arrives.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Show me where you implement encryption at rest."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Show me your audit logging for ePHI access."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Show me evidence that your access controls meet SOC 2 CC6.1."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And the engineering team scrambles. Someone opens &lt;code&gt;git blame&lt;/code&gt;. Someone searches Confluence. Someone opens a spreadsheet that was last updated three months ago. Six weeks later, the evidence package is assembled — manually, expensively, and probably incomplete.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is broken.&lt;/strong&gt; Not because the code is non-compliant, but because there's no automated way to prove it is.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Traditional Security Tools Don't Solve This
&lt;/h2&gt;

&lt;p&gt;SAST tools like SonarQube, Semgrep, and Snyk find violations. They tell you "line 45 has an SQL injection vulnerability" or "this function uses MD5 hashing." That's valuable — but it's only half the picture.&lt;/p&gt;

&lt;p&gt;When an auditor asks &lt;em&gt;"show me where you implement audit logging,"&lt;/em&gt; no existing tool can answer that question. They can tell you where audit logging is &lt;strong&gt;missing&lt;/strong&gt;, but they can't point to the file and line where it's &lt;strong&gt;implemented&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This gap is the difference between:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Approach&lt;/th&gt;
&lt;th&gt;What it tells you&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Violation scanning&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;"You have 7 critical findings" &lt;em&gt;(every tool does this)&lt;/em&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Compliance evidence&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;"Your code satisfies 124 of 130 applicable requirements, with evidence at these locations" &lt;em&gt;(nobody does this)&lt;/em&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Introducing the Compliance Evidence Map
&lt;/h2&gt;

&lt;p&gt;A compliance evidence map inverts the traditional scanner model. Instead of only finding what's wrong, it also identifies &lt;strong&gt;where your code satisfies each regulatory requirement&lt;/strong&gt; — with the exact file, line number, and matched pattern.&lt;/p&gt;

&lt;p&gt;For each rule in a compliance framework, the evidence map reports one of four statuses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Met&lt;/strong&gt; — code evidence found that satisfies the requirement&lt;/li&gt;
&lt;li&gt;❌ &lt;strong&gt;Violated&lt;/strong&gt; — violations detected by the scanner&lt;/li&gt;
&lt;li&gt;🔍 &lt;strong&gt;Manual Review&lt;/strong&gt; — documentation obligation with no matching docs found&lt;/li&gt;
&lt;li&gt;➖ &lt;strong&gt;Not Applicable&lt;/strong&gt; — no files match the rule's scope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The coverage percentage tells you how many applicable requirements have verified implementations. An auditor can look at &lt;strong&gt;"87.2% coverage — 156 requirements met"&lt;/strong&gt; and immediately understand your compliance posture.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Evidence Collection Works
&lt;/h2&gt;

&lt;p&gt;Different rule types generate evidence in different ways.&lt;/p&gt;

&lt;h3&gt;
  
  
  Required patterns become proof of implementation
&lt;/h3&gt;

&lt;p&gt;Many compliance frameworks require specific capabilities to exist in your code. HIPAA requires audit logging. IEC 62304 requires configuration management. SOC 2 requires access controls.&lt;/p&gt;

&lt;p&gt;When a required pattern rule finds the pattern in your code, that's evidence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HIPAA-164.312-b (required_pattern): MET
  → middleware/audit.py:14 — Implements audit-logging-required: import logging
  → api/patients.py:3    — Implements audit-logging-required: import logging
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The auditor sees exactly where audit logging is implemented, in which files, on which lines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Violation rules prove clean code
&lt;/h3&gt;

&lt;p&gt;For rules that check for vulnerabilities — SQL injection, hardcoded secrets, weak crypto — a clean scan across all files is evidence of compliance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OWASP-A01-001 (regex): MET
  → (project-wide) — No violations of no-permissive-cors across 43 file(s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Documentation detection satisfies process requirements
&lt;/h3&gt;

&lt;p&gt;Many regulatory frameworks require documentation — risk management plans, data governance policies, security procedures. Sentrik searches your &lt;code&gt;.md&lt;/code&gt;, &lt;code&gt;.adoc&lt;/code&gt;, &lt;code&gt;.rst&lt;/code&gt;, and &lt;code&gt;.txt&lt;/code&gt; files for relevant keywords and links them to the requirement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HIPAA-164.308-a1 (documentation_obligation): MET
  → docs/risk-analysis.adoc:14 — Documentation found matching: risk, analysis, vulnerabilities
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you write your risk management documentation in AsciiDoc and keep it in the repo, Sentrik finds it and links it to HIPAA §164.308(a)(1) automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  What This Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;Here's a real example from a medical device API project scanned against HIPAA, OWASP, SOC 2, and IEC 62304 simultaneously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sentrik compliance-map
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compliance Evidence Map
  Coverage:  87.2%
  Met:       156
  Violated:   18
  Manual:      0
  N/A:        33
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Out of 207 applicable requirements across four frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;156&lt;/strong&gt; have verified code or documentation evidence&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;18&lt;/strong&gt; have violations that need fixing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0&lt;/strong&gt; require manual review — all documentation obligations were satisfied by files in the repo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The HTML report groups results by framework, so the HIPAA auditor sees only HIPAA controls, and the SOC 2 auditor sees only Trust Services Criteria.&lt;/p&gt;




&lt;h2&gt;
  
  
  Smart Rules: Only Fire When Relevant
&lt;/h2&gt;

&lt;p&gt;Not every rule applies to every project. HIPAA rules shouldn't fire on a fintech app. EU AI Act rules shouldn't fire on a project with no ML code.&lt;/p&gt;

&lt;p&gt;Sentrik uses &lt;code&gt;applies_when&lt;/code&gt; conditions to make rules contextual:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HIPAA rules&lt;/strong&gt; only fire when code contains &lt;code&gt;patient&lt;/code&gt; / &lt;code&gt;health&lt;/code&gt; / &lt;code&gt;medical&lt;/code&gt; / &lt;code&gt;PHI&lt;/code&gt; keywords&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EU AI Act rules&lt;/strong&gt; only fire when PyTorch, TensorFlow, or other ML libraries are imported&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PCI-DSS rules&lt;/strong&gt; only fire when &lt;code&gt;payment&lt;/code&gt; / &lt;code&gt;credit card&lt;/code&gt; / &lt;code&gt;merchant&lt;/code&gt; keywords are present&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This eliminates false positives from irrelevant frameworks and keeps the evidence map focused on what actually applies to your project.&lt;/p&gt;




&lt;h2&gt;
  
  
  From Evidence Map to Audit Evidence
&lt;/h2&gt;

&lt;p&gt;The evidence map is the foundation. On top of it, you can generate:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Output&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Per-framework compliance reports&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Clause-by-clause status for a specific standard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Trust center page&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Public-safe HTML showing compliance scores without code paths&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Signed attestation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;HMAC-SHA256 cryptographic proof of compliance state at a point in time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Auditor portal&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Read-only access with time-limited tokens, no codebase access needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Evidence export&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ZIP bundle with findings, reports, and attestation for audit submission&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sentrik trust-center &lt;span class="nt"&gt;--org&lt;/span&gt; &lt;span class="s2"&gt;"Your Company"&lt;/span&gt;
sentrik attest
sentrik auditor create &lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"Jane Smith"&lt;/span&gt; &lt;span class="nt"&gt;--email&lt;/span&gt; jane@auditor.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Sentrik's &lt;strong&gt;free tier&lt;/strong&gt; includes SOC 2 and OWASP Top 10 — 99 rules with evidence mapping, no credit card required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; sentrik
sentrik scan
sentrik compliance-map
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The evidence map generates in seconds from your last scan. For HIPAA, IEC 62304, PCI-DSS, and other regulated frameworks, upgrade to the &lt;strong&gt;Team tier at $29/month&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://sentrik.dev" rel="noopener noreferrer"&gt;sentrik.dev&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>compliance</category>
      <category>ai</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
