SOC 2 Scanning for Code: What to Scan and What to Keep

SOC 2 does not scan your code. It tests the controls around it. Learn which scans to run, what evidence auditors sample, and how to cover AI-written changes.

Axiom Studio Axiom Studio November 30, 2026 13 min read

A SOC 2 audit does not scan your code. It tests whether the controls around your code worked, every time, for the whole audit period. Code scanning matters because it produces the records that prove those controls ran. If your team ships AI-written changes, the standard is the same, and the proof has to be just as complete. We built VibeFlow and Vera, our code review agent, so that review findings, compliance findings mapped to SOC 2 sections and the record of each change sit in one place, and the evidence exists before the auditor asks for it.

TL;DR

  • SOC 2 is an attestation about controls, not a code quality test. Auditors sample change records, scan configurations, findings and fixes.
  • No SOC 2 criterion names a specific scanner. You choose the method, document why it fits and prove it ran.
  • Run scans at several stages (IDE, pull request, nightly), block merges on new high and critical findings and track every finding to closure.
  • AI-generated code gets the same review, gate and evidence as human code. Nothing in SOC 2 exempts it or adds a separate rule.
  • Keep scan logs, review approvals and remediation tickets in systems that export records with timestamps, not screenshots.

What a SOC 2 examination actually covers

SOC 2 is a report from an independent CPA firm on a service organization’s controls. According to the AICPA, the examination covers controls relevant to security, availability, processing integrity, confidentiality or privacy. Its purpose is to give customers detailed assurance about the systems that process their data.

The examination has a defined structure. As summarized in the AICPA guide on PwC’s Viewpoint, the auditor looks at the description of your system and at whether the controls are suitably designed. In a Type 2 report, the auditor also looks at whether they operated effectively over a period. That last point drives everything about scanning: one clean scan the week before the audit proves little. A scan history that runs across the whole window proves a lot.

It is an attestation, not a certification. No one “certifies” your repository. The auditor tests samples of your records against the criteria you chose.

Where scanning fits in the criteria

Two areas of the Trust Services Criteria carry most of the weight for engineering teams.

Change management (CC8.1). This covers authorizing, designing, developing, testing, approving and implementing changes to software and infrastructure. Auditors want to see that a change was requested and approved, reviewed by someone other than its author, tested, and deployed with a record that ties to the commit.

Change management sequence in six steps: request and authorize, design and develop, independent review by someone other than the author, test, approve before implementation, and deploy with the record tied to the commit

Vulnerability management (CC7.1). Here the questions are: Do you detect vulnerabilities on a defined schedule? Do you track what the scans find? Do you fix findings within a stated timeframe?

Static analysis, the automated examination of source code that is not running, maps cleanly onto both. An audit firm, Linford & Co, notes that static code analysis fits the change-management control family and that its results touch nearly every Trust Services area.

The same firm draws a distinction worth keeping: static analysis is an automated control, while code review is a human one. Maintain both. Each catches defects the other can miss.

No criterion tells you to use a particular tool. The control is the outcome. You choose the method, write down why it fits your environment and keep records showing it ran.

The scans worth running, and where

A SOC 2-ready pipeline usually combines several scan types, because each answers a different question:

Scan type What it finds Typical place to run it
SAST (static application security testing) Insecure patterns in your own source Pre-commit, pull request, nightly
SCA (software composition analysis) Known vulnerabilities in dependencies Pull request, scheduled
Secret scanning Credentials committed to the repository Push protection, pull request
Container and IaC scanning Image and infrastructure misconfiguration Build stage
DAST (dynamic testing) Flaws visible only in a running app Staging

OWASP’s DevSecOps guideline on SAST recommends staging by speed. An IDE plugin gives feedback in under a second. Pre-commit checks on changed files take seconds. The pull request scan takes a minute or a few and acts as the authoritative gate that blocks new high and critical findings. A nightly full-codebase scan takes longer and goes deeper.

The same guideline describes a tuning cycle:

  1. Baseline for two to four weeks.
  2. Triage the first 50 to 100 findings.
  3. Suppress rules with false-positive rates above 80%.
  4. Gate only on new findings.
  5. Re-tune quarterly.

Tuning is not cosmetic. Linford & Co warns that a poorly configured tool produces false positives, and when there are too many, developers start ignoring alerts. An ignored alert that sits in your findings list is exactly what an auditor will sample.

Make the scan a gate, not a report

Auditors test whether a control is enforced by the system or merely written in a policy. A scan that posts a comment developers can skip is weak evidence. A scan that fails the pipeline and blocks the merge is strong evidence.

The practical setup:

  • Protect the production branch so merges require a review and passing checks.
  • Require the approver to be someone other than the author.
  • Configure the scan so failing results on new high or critical findings stop the merge.
  • Document how emergency changes bypass the normal path and who approves them afterward.

Our write-up on quality gates for AI-generated code walks through the gates we recommend on every commit. If your team uses CODEOWNERS files to route reviews, see how human approval and merge gates fit together with automated review.

What auditors sample, and what you should keep

Auditors test through inquiry, observation, inspection and reperformance, and they sample across the observation window. For engineering controls, they ask for a system-generated population, such as every production change in the period, then pick a sample and trace each item.

For each sampled change, expect to show:

  • The ticket or request that authorized it.
  • The author and a different approver, with the approval timestamp before merge.
  • Passing test and scan results.
  • The deployment record tied to the commit.

For vulnerability management, expect to show the scanner configuration, proof that scans ran on schedule for the whole window and tickets showing findings were fixed within your defined timelines. Your policy sets those timelines. A lapsed scanner license that leaves a gap in scan history shows up as an exception.

Three habits make this easier:

  1. Export, do not screenshot. A system export with a timestamp is stronger than a picture of a settings page. Pull review records from your Git platform’s API with reviewer, state, submitted time and commit ID.
  2. Save the query. If you export a population of merged pull requests, keep the exact query so the auditor can reproduce it.
  3. Document risk acceptance. A finding you choose not to fix needs a named owner, a reason and a date. A silent “won’t fix” label reads as a control failure.

Edge cases cause most exceptions: self-approved pull requests, approvals that went stale after new commits, bot-authored changes, admin merges nobody explained, and emergency fixes with no after-the-fact review. Decide how each is handled before the audit period starts. For more on how change records are tested, what auditors sample in SOC 2 bug reporting shows how timestamps and period-spanning evidence get checked.

Our guide to what to automate for SOC 2 covers which of these records are worth collecting automatically.

Scanning AI-generated code

The question for teams using AI coding agents is whether SOC 2 treats their output differently. It does not. NIST’s SP 800-218A, the secure development profile for generative AI, states that its practices do not distinguish between human-written and AI-generated source code, because all source code should be evaluated for vulnerabilities before use.

In SOC 2 terms, an AI-written change goes through the same change-management criteria as any other, and the same logical-access rules decide who may merge it. If your policy says every change needs a non-author approver, an agent’s pull request needs one too. For a deeper treatment of SOC 2 and AI systems more broadly, see this overview of SOC 2 for AI systems.

What changes is volume and speed. Agents open more pull requests than people do, so manual review becomes the bottleneck, and a skipped step multiplies fast. Three adjustments help:

  • Attribute every change. Record which agent or tool produced it and which human approved it.
  • Limit agent permissions. An agent should not be able to merge its own work to the production branch.
  • Scan for dependencies that do not exist or are misnamed. Generated code can reference packages that are wrong or malicious, so dependency checks earn their place.

We cover this in more depth in how teams ship AI-written code safely, and in our piece on prompt injection in pull requests, which tests the path from untrusted input to agent action.

Why a unified platform beats three bolted-on tools

Most teams start with a tracker, an AI reviewer and a compliance add-on. Each holds a piece of the evidence: tickets in one place, review comments in another, scan results in a third. At audit time someone must stitch the records together, and every join is a place where a timestamp does not line up or a ticket link is missing.

Axiom Studio takes the opposite approach. VibeFlow is our AI SDLC team: nine specialist agent personas across planning, development, security, QA and delivery. Work is tracked natively as features, todos and issues on a Kanban board, so the item that authorizes a change lives next to the change itself, and every work item keeps an append-only execution log with commit attribution. Vera reviews each pull request with evidence and verifies fixes with a fresh review. After a work item is built, the Security Lead agent reviews it for exploitable flaws and maps its findings to seven frameworks, including SOC 2 and GDPR, with section references and links from the change that raised each finding to the work that fixed it.

Mapped to the evidence list above:

What the auditor asks for Where it lives in the workflow
Authorized change request Work item on the VibeFlow board
Independent review Vera’s review of the pull request, plus your Git host’s approval rules
Scan results and findings Your CI scan results, Vera’s findings and the Security Lead’s compliance findings
Complete record of actions The work item’s execution log and commit attribution

Each Vera finding names the file and line, explains the impact and shows the evidence and the commands used to verify it, and a fresh review checks the fix, so a finding closes with a record rather than a comment. Your CI scanners still run SAST, dependency and secret scanning; Vera and the Security Lead agent add review and compliance mapping on top of them. You can read how the review agent works on the Vera AI code review page, and how we handle security specifically in AI security review for every code change.

If you are comparing review approaches, our guides to code review tools and the five types of AI code review tools set out the criteria that matter for audit work: enforcement, evidence and traceability.

A rollout plan for the next audit window

If your observation period has not started, you have time to set this up properly. A sequence that works:

  1. Inventory your controls. List every control touching change management and vulnerability management, with an owner for each.
  2. Pick the scans and document why. Write a short rationale for each scan type. Auditors read this alongside your configuration.
  3. Tune before you gate. Baseline, triage, suppress noisy rules, then enforce on new findings only.
  4. Turn on enforcement. Branch protection, non-author approval and failing checks on the production branch.
  5. Define remediation timelines. Set them in policy and track them in tickets. Common timelines in practice are measured in days for critical findings and longer for high ones; your policy decides.
  6. Automate evidence capture. Make sure exports of reviews, scans and deployments are generated by the systems, with timestamps.
  7. Run an internal sample. Pick 25 recent merged changes and trace each one from request to deployment. If you cannot trace one, an auditor will not be able to either.

The sample size in step 7 is a guide. Your auditor decides the actual sample, and it varies with the size of the population.

Try it on your own pipeline

Vera is free on every plan, including the free Starter plan, so you can start on your own repositories. Pro is $20 per month and Team is $49 per seat per month with a three-seat minimum. Enterprise is available for larger organizations, and you can see what each plan includes on the pricing page. If you want to see compliance findings and execution logs against your own SOC 2 scope, request a demo.

The Axiom Studio homepage: the headline “Ship AI-written code, with nothing left untested.” with Start reviewing free and Request a demo buttons above the AI-assisted delivery deck.

Teams that adopt AI coding agents want the speed without losing the traceability their auditors require. That is the case for scanning at the pull request, enforcing the gate and keeping the evidence where the work happens.

Sources

Frequently asked questions

Do SOC 2 auditors review my source code?

Generally no. They test the controls around development, such as whether reviews happened, scans ran and findings were handled. They sample records like merged pull requests, scanner configurations and remediation tickets rather than reading your code for quality.

Which scanner do I need for SOC 2?

No criterion names a specific tool. Most teams that pass run static analysis in their pipeline, plus dependency and secret scanning. What matters is that you choose a method, document why it fits and keep records showing it ran for the full period.

Does AI-generated code need different treatment under SOC 2?

No. NIST's secure development profile for generative AI says its practices do not distinguish between human-written and AI-generated code. Apply the same review, merge gate and evidence, and record which agent produced each change and who approved it.

What is the difference between a SOC 2 Type 1 and Type 2 report?

A Type 1 report covers whether controls are suitably designed at a point in time. A Type 2 report also tests whether they operated effectively over a period, which is why continuous scan history and review records matter.

Axiom Studio

Written by

Axiom Studio

Turn AI governance insight into evidence

Get weekly governance insights for engineering leaders, then put them to work with VibeFlow.