Infrastructure Review Stack
FeaturesLong read

What SOC 2 Compliance Actually Requires From a Code Execution Environment

SOC 2 auditors want enforceable limits and evidence for sandboxes.

· 9 min read
Cover illustration for “What SOC 2 Compliance Actually Requires From a Code Execution Environment”
Features · November 8, 2026 · 9 min read · 1,977 words

SOC 2 compliance for a code execution environment depends on which rules the infrastructure can enforce and how it can prove they held while untrusted, AI-generated code runs. Policies and a provider’s report are not enough. The central requirement is an execution boundary that limits authority, controls changes, validates results, and preserves evidence across the workload’s life.

Why SOC 2 creates real friction for code execution environments, not just paperwork overhead

An agent can generate code, install a tool, and execute both before a human has reviewed either. The system no longer works on the basis of human authorization, deterministic behavior, and processing logic documented before deployment. A change process may exist on paper while the execution path bypasses its authorization, testing, and approval stages.

Yet SOC 2 is outcome-based. It does not mandate a particular isolation technology or require a change ticket for every instruction. Instead, the controls must demonstrably address the risks the system presents. An alternative to a familiar agent workflow must therefore provide enforceable limits and evidence that those limits held.

Scope determines how far that question extends. Security is mandatory, while Availability, Processing Integrity, Confidentiality, and Privacy are additive. For an environment handling sensitive workloads, all five are likely to be in scope. Enterprise buyers require Type 2 reports, which assess controls operating effectively over a sustained period, extending assessment beyond their design at a single point in time.

What CC6 (logical access security) actually demands when the entity executing code is not a human

CC6.1 requires access to systems, data, and infrastructure to be restricted to authorized users and entities. An executing agent is one of those entities. Its permissions cannot be treated merely as an extension of the developer who configured it, because the agent selects tools and takes actions at runtime. Static role assignments do not, by themselves, constrain every way those permissions may be combined.

When an agent installs a tool, that tool inherits whatever resources the agent can reach, including database credentials, API keys, and filesystem paths. One permissive credential amplifies the potential damage. The 2026 CSA/Zenity study found that a majority of organizations report agents exceeding their intended permissions, demonstrating a practical need for access controls.

Controls start with least-privilege credentials that each have a unique identity and a managed lifecycle for their authorization, review, and revocation. CC6.2 and CC6.3 make credentials and access removal explicit concerns, including for long-lived service accounts and static secrets. Hard-coded API keys and database strings create an upstream exposure that sandboxing alone does not resolve.

An identity-aware proxy provides an architecture for enforcing these controls. Sitting between the agent and infrastructure, it intercepts protocol traffic, applies least privilege, issues one-time credentials for sensitive operations, and requires human approval for high-risk commands. It also records each session. This connects access control to monitoring and change authorization under CC7.1, CC7.2, and CC8.1, rather than leaving each obligation in a separate policy.

How isolation architecture determines whether CC6.1 is satisfiable at all

Credentials limit what code is allowed to access, but isolation must hold when code tries to bypass those permissions. What prevents one tenant’s execution from reaching another tenant’s data? Under CC6.1, that is a foundational question. An auditor needs a defensible account of the boundary separating workload environments.

Containers share the host kernel, so a kernel vulnerability can undermine their isolation. That exposure is especially relevant when code has not been reviewed before execution. MicroVMs instead use hardware virtualization to provide a separate kernel per workload. Each sandbox runs as a dedicated process with its own virtual CPU and memory resources, so a hardware-enforced boundary separates the execution environments.

SOC 2 does not prescribe either technology. The distinction is whether the stated controls adequately address untrusted execution and operate as described. Purpose-built sandbox infrastructure is better positioned to make that case because isolation is a core design assumption, while developer tooling adds it as a feature. Hardware virtualization strengthens the boundary, but the audit still concerns the implemented system.

The report’s scope is equally consequential. A certified provider’s report may cover the management plane without naming the sandbox where the code runs. Teams must therefore check that the execution environment is within the audit boundary. Otherwise, evidence about the surrounding service leaves the central CC6.1 question unanswered.

What CC8.1 (change management) requires when code is generated and executed without a change ticket

CC8.1 requires changes to be authorized, tested, and approved before deployment, but with autonomous code generation, that decision happens at runtime. An environment can contain an agent perfectly and still allow it to execute changes outside any approved scope. Isolation and change authorization address different failures.

When an agent installs a package from a registry during a task, it changes the system. If installation bypasses the change controls, the gap is not an administrative omission that can be repaired by writing a ticket afterward. The control must stop the unapproved execution before it goes ahead.

The practical response is a pre-approved, version-pinned set of what the agent may install and execute. Deviations require a human authorization gate. This moves approval to an enforceable boundary without demanding a separate manual workflow for every permitted action. The fact that code runs successfully cannot prove that a change was safe or reviewed, especially when generated patches can introduce vulnerabilities while fixing the original issue.

The evidence must show how that boundary operated. Execution logs need to capture what code ran, when it ran, which credential it used, and whether it stayed within the pre-approved scope. For an auditor, those records connect the authorization decision to the actual change. A record of successful completion does not provide the same evidence.

How stateful execution and long-running agents affect CC7 (monitoring) and the audit evidence chain

Execution-time controls leave a further question about continuity. Can the organization show that monitoring worked throughout the Type 2 observation period, including pauses, restarts, and changes in capacity? CC7.2 and CC7.3 cover monitoring and the evaluation of security events. Snapshots of selected runs cannot establish an unbroken record for the workload.

Ephemeral instances make that continuity harder to demonstrate. If a new sandbox does not inherit the previous instance’s monitoring instrumentation, the log chain develops gaps. Auto-scaling creates the same problem when short-lived instances are inconsistently instrumented. Those gaps weaken monitoring evidence and can also make Availability evidence harder to produce.

Stateful execution provides a persistent identity for the workflow. A sandbox that retains its identity while compute is dormant can preserve continuity instead of leaving disconnected instance logs to be reconciled later. Checkpoint-and-restore adds another useful artifact for multi-step workflows. The saved state supports resumption without re-execution and becomes part of the audit record, making statefulness more than a performance or reliability feature.

Persistence is not always the right data policy. For sensitive workloads, zero data retention between runs can remove the risk of retained state, but it does not remove the risk during execution. Strong isolation remains necessary, as does evidence of monitoring for the chosen model. A sandbox vendor’s SOC 2 report cannot demonstrate that monitoring was active and continuous for the customer’s particular agent workload.

What Processing Integrity (PI1) requires from a system whose outputs are generated, not programmed

PI1 requires processing to be complete, valid, accurate, timely, and authorized. Conventional verification compares behavior with documented processing logic, but generated code may have no pre-existing specification of what it will do. Interactions can also produce behavior that was not explicitly programmed. How, then, can an execution environment demonstrate that processing stayed within its intended purpose?

Output validation gates check what the agent produced before it is committed, comparing that result with expected outcome boundaries. This is distinct from reviewing the generated code itself. A code review and an output check answer different questions, and neither the fact that code ran nor the absence of an error establishes processing integrity.

Authorization must also be narrower than credential reach. A service account may be able to access a resource without the current task permitting its use. Task-scoped authorization defines what the agent may do in the session. That distinction connects PI1 to access control without treating the two as interchangeable.

The audit trail must make these relationships inspectable. It needs inputs, outputs, executed code, and evidence of whether execution remained within authorized bounds. Structured JSON logs with timestamps, action references, and outcome codes provide records that can be verified against the task and its outcome. Unstructured text whose details must be linked by hand does not provide the same evidence just because those details might appear somewhere in it.

Where Confidentiality and Privacy criteria add obligations that the execution environment itself must enforce

The evidence chain itself can hold sensitive data. Confidentiality and Privacy therefore require the execution environment to enforce data boundaries and support compliant retention and deletion, rather than relying entirely on the application above it. Data that leaves execution needs the same checks. A controlled sandbox does not make an external destination part of the compliance boundary.

Computer-use agents expose this distinction particularly clearly. An agent that reads a screen and interacts with a portal may send screenshots to a model endpoint. If those images contain PHI, PII, or confidential business data, the endpoint, screenshot store, and logs all need to meet the applicable compliance requirements. Protecting only the original application leaves the agent’s data path unaccounted for.

HIPAA adds a contractual requirement before PHI touches vendor infrastructure. A signed Business Associate Agreement is required, and standard public LLM API offerings are not generally BAA-covered by default. Teams may need enterprise agreements, specific opt-in steps, or other deployment models. Google Cloud’s BAA excludes pre-release features, illustrating why coverage must match the vendor’s particular feature and plan.

GDPR and HIPAA require records identifying when access occurred, who accessed the data, what action was performed, and which data was involved. Customer-managed compute can keep workloads within the organization’s own data boundary and audit scope. It does not, however, make a sandbox provider’s Type 2 report answer separate questions about model-provider handling, transcript retention and deletion, or the acceptability of agent-action records under the applicable regulation.

What a code execution environment must actually implement to satisfy all five criteria in practice

Implementation should treat the execution environment as the point where these obligations meet. For logical access, that means hardware-enforced isolation, per-agent least-privilege credentials, and lifecycle management. An identity-aware execution layer must record actions with the credential, timestamp, and resource reference. The boundary needs both enforcement and evidence.

Monitoring then has to survive the workload’s lifecycle. Persistent sandbox identity, structured JSON records with action references, and instrumentation that remains effective through dormancy and auto-scaling support that continuity. Change management also needs pre-approved, version-pinned environments and human authorization when an agent deviates from them. The resulting execution records must show both the completion of changes and the authorization behind them.

Processing integrity also needs task-scoped authorization and output validation gates. Its records must connect inputs, executed code, outputs, and outcomes against authorized bounds. Confidentiality and Privacy add data-boundary controls, compliant retention and deletion, BAA-covered infrastructure for PHI, and zero data retention options for sensitive workloads. Customer-managed compute is one way to keep regulated execution within the organization’s own audit scope.

Sandbox infrastructure built for this purpose brings these controls together in one execution architecture. Open-source, transparent infrastructure also lets auditors and security teams see how it behaves, check its isolation claims, and compare what was built with the scope document. Docker-native compatibility can support adoption without rewriting existing workloads or undertaking a full re-platforming. Neither property substitutes for operating evidence.

The provider’s Type 2 report remains necessary but insufficient. The team must check that its own workload configuration, access controls, and logging are within the audit boundary and produce the evidence that each applicable criterion requires. That tests the deployed environment as well as the service beneath it.

Sources

  1. SOC 2 Compliance Requirements (Must know in 2026) - Sprinto

More in Features