Security Testing

API Testing for SOC 2 Audits: Mapping Tests to Trust Service Criteria (2026)

Total Shift Left Team5 min read
Share:
API testing for SOC 2 — Trust Service Criteria mapping and audit evidence

In this article you will learn

  1. What SOC 2 actually requires from API testing
  2. Mapping API tests to Trust Service Criteria
  3. Type I vs Type II evidence differences
  4. Designing tests to be auditor-friendly
  5. Reference architecture

What SOC 2 actually requires

SOC 2 differs from regulations like HIPAA or PCI-DSS in that it does not prescribe specific controls. Instead, it asks whether the controls you have selected are designed appropriately and operating effectively against the Trust Service Criteria (TSC) in scope.

For most B2B SaaS organizations, that translates into a set of common selections:

  • Detect security events on production APIs (CC7.x)
  • Validate changes before they reach production (CC8.x)
  • Limit logical access to authorized users (CC6.x)
  • Meet committed availability targets (A1.x)
  • Protect confidential information (C1.x where Confidentiality is in scope)

API testing is one of the cleanest ways to demonstrate the CC7 and CC8 selections in particular. The auditor's question is essentially: "How do you know production APIs behave as committed?" The answer that scales is "We have a documented test program that runs on every change, here are the run reports."

Mapping to Trust Service Criteria

A practical mapping for a typical B2B SaaS scope:

TSCCommon selectionAPI testing evidence
CC6.1 — logical access securityAuthn/authz on production APIsNegative authentication and authorization tests; tests across enterprise IdP flows (Okta, Azure AD, Ping)
CC6.7 — restrict transmission of confidential informationTLS, scope-limited tokensTLS configuration tests; tests confirming no confidential field is returned in error paths
CC7.1 — detect security eventsMonitoring + change detectionContract tests that detect schema drift; coverage reports showing untested endpoints
CC7.2 — system anomaly detectionTest failures gating releaseCI quality gates on coverage and pass rate
CC8.1 — manage changesSDLC controlsPer-release test reports linked to change tickets; source-controlled test definitions
A1.2 — environmental, software, and data backupsAvailability monitoringAPI health and SLA tests with retained run history
C1.1 — confidentialityField-level accessContract tests asserting confidential fields appear only in authorized responses

Ready to shift left with your API testing?

Try our no-code API test automation platform free. Generate tests from OpenAPI, run in CI/CD, and scale quality.

A SOC 2 program does not require one test per criterion. It requires a credible, retained, sampleable relationship between the testing activity and the TSC the auditor is examining.

Type I vs Type II evidence

A SOC 2 Type I report attests that controls are designed appropriately at a point in time. A Type II report attests that controls operated effectively over a period (commonly six or twelve months). The evidence demands are different:

  • Type I: Documented testing program, sample test definitions, sample run report, list of API surfaces in scope.
  • Type II: All of the above, plus retained run reports across the entire audit period, change-management records linking releases to test runs, and audit logs showing who ran what when.

Most teams underestimate Type II evidence requirements. Run reports must be retained — not regenerated on demand — for the auditor's sampling. Tests run from a CI pipeline that overwrites artifacts every day will not pass Type II sampling. Exportable, immutable, dated run reports retained for the audit window are the right pattern.

Designing tests to be auditor-friendly

Three design choices that reduce auditor back-and-forth:

Source-control everything. Test definitions in git, with branch protection and a change history, give auditors a verifiable audit trail of how the test suite evolved. Tests authored ad-hoc in a UI without versioning create gaps.

Tag tests by control area. A simple convention — cc7-1, cc8-1, a1-2 tags or labels on test cases — lets you produce control-mapped reports without rewriting the suite. The auditor can see at a glance which tests evidence which criterion.

Retain coverage deltas per release. A coverage report attached to each change ticket showing what changed, what tests covered the change, and what coverage looked like before and after gives the auditor a sampling anchor. This is the single highest-leverage artifact for a clean Type II audit.

For coverage tracking patterns, see how to measure API test coverage. For CI pipeline integration patterns, see API security testing in enterprise SDL & CI/CD.

Reference architecture

A SOC 2-friendly API testing architecture has five elements:

  1. Source-controlled test definitions in a repository with branch protection and change history.
  2. CI/CD integration that runs tests on every PR and release, producing exportable run reports.
  3. Run report retention for the full audit window — typically S3, GCS, or equivalent with object lock or write-once storage class.
  4. Audit log of test executions: who, what, when, against which environment.
  5. Coverage tracking with per-release deltas surfaced on change tickets.

When deployment posture matters (regulated SaaS, single-tenant private cloud, on-prem), all five components run inside the boundary that holds the Confidentiality and Privacy criteria. See the security page for platform-level posture and the deployment page for topology options.


SOC 2 does not require API testing by name, but the Common Criteria around change management and system operations are most credibly evidenced by a documented, retained, source-controlled API testing program. The architecture work that pays off is making test artifacts queryable and sampleable months after the test ran — the difference between a clean Type II and a noisy one.

Ready to shift left with your API testing?

Try our no-code API test automation platform free.