Skip to main content
    Securem Advisory
    Back to the paired briefing
    ChecklistReviewed Nov 14, 2026

    Code Execution AI Audit Trail Checklist

    Audit-trail readiness checklist for AI agents and copilots that execute code on behalf of users, covers per-execution logging, tool-call durability, customer access, and the three audit-log gaps that disqualify regulated-buyer scope.

    Read the briefing

    When this runs, who runs it, what it does not replace

    This is the checklist to walk against any AI workload that has been given execution capability against regulated data, Anthropic's code execution tool, OpenAI's Code Interpreter in the Responses API, Amazon Bedrock AgentCore Code Interpreter and the code interpretation feature in Amazon Bedrock Agents Classic, Microsoft Foundry Agent Service with Code Interpreter, Code Execution on Google's Gemini Enterprise Agent Platform (the platform that absorbed Vertex AI Agent Builder), and the customer-built tool-calling stacks that wrap any of the above. It runs whenever a code-execution AI workload enters regulated-buyer scope: a HIPAA-covered entity standing up a clinical assistant; a regulated SaaS vendor adding agentic features under a customer BAA; a financial-services buyer evaluating a copilot that touches account data under GLBA and state privacy rules; a payer or pharmacy operations team automating eligibility or prior-auth flows. It also runs after the fact, on workflows that have already shipped and have not yet been reviewed against the audit-trail surface laid out in the paired briefing, Code-Execution AI in Regulated Workloads: The Audit-Trail Surface Most Buyers Did Not See Coming.

    The intended drivers are the cloud platform lead (the person accountable for the orchestration plane and the log destinations), the compliance lead (HIPAA security officer, privacy officer, or equivalent for non-healthcare regulated workloads), and an independent reviewer, the Securem partner where we are engaged (called the partner below). The compliance lead owns the regulator-facing answer; the platform lead owns the implementation; the partner owns the read on whether the chain is defensible.

    What this checklist does not replace: legal review of the BAA, DPA, or vendor order form (counsel reads the addenda before assuming any of the items below are contractually backed); per-buyer custody and incident-response procedures (the checklist confirms the log exists and is reachable, not that the customer's IR runbook can use it); a sandbox security review (containment, escape, side-channel, and supply-chain review for the execution environment itself is a separate engagement); and a model-evaluation review (the checklist is silent on whether the model's outputs are clinically or financially accurate). It is the audit-trail surface, frozen at lastReviewed.

    Vendor status at this review

    Product names and terms in this category moved during 2026. Five points matter before the checklist is run, each taken from the vendor's own documentation on the review date.

    Anthropic's hosted code execution tool is not eligible for zero data retention or for HIPAA readiness. Container data is retained for up to 30 days, and an organization with HIPAA readiness enabled gets an error if a request includes the tool. The bash and text editor tools are different: they run in the customer's environment and are eligible. Claude Managed Agents, the hosted agent runtime, is also outside HIPAA readiness.

    OpenAI shut down the Assistants API on August 26, 2026. Code Interpreter now runs through the Responses API in a container, a sandboxed virtual machine that expires after 20 minutes without use, at which point OpenAI says its data is discarded. That is a short window for item 3.4: anything the audit trail needs has to be captured before the container expires.

    On AWS, Amazon Bedrock Agents is now Agents Classic, in maintenance mode and closed to accounts without prior usage since July 30, 2026. New builds go to Amazon Bedrock AgentCore, which includes its own Code Interpreter and is listed separately on the AWS HIPAA Eligible Services Reference.

    On Microsoft Foundry Agent Service, Code Interpreter runs in a Microsoft-managed sandbox built on Azure Container Apps dynamic sessions, with each session isolated by a Hyper-V boundary and no outbound network access. One documented exception bears directly on item 3.2: when Code Interpreter is used through a toolbox in a hosted agent, user isolation is not supported and all users in the project share one container context.

    Google renamed its platform on April 22, 2026. Vertex AI and Agent Builder are now part of Gemini Enterprise Agent Platform, and its sandboxed capability is called Code Execution.

    Section 1: Per-execution logging

    Every code execution the agent performs must produce a complete, durable record. The eight items below are the minimum that maps to HIPAA Audit Controls (45 CFR 164.312(b)) and to the equivalent record-keeping standards in GLBA, PCI-DSS, and state privacy regimes. They cover the six events the paired briefing names (the code, the data it accessed, the data returned to the model, the side effects, the identity, and the result the model interpreted) and add the join key and the environment records that make those six usable. A workload missing any single item cannot be defended in a Type II audit or a post-incident review.

    #ItemVerified?Evidence the partner expects to see
    1.1Prompt logged with timestamp, verbatim, including system prompt and any retrieved context concatenated into the model inputSample log record showing the full input string and a UTC timestamp at millisecond resolution
    1.2Tool / code invocation logged with full parameters (the source code, query, command, or arguments the model passed to the execution tool)Sample record showing the verbatim script or command, not a hash or summary
    1.3Execution result logged (stdout, stderr, return value, file artifacts produced inside the sandbox), together with the model's response to the user that followed itSample record covering all three streams, any file-artifact references, and the completion that followed
    1.4Per-execution unique ID, threaded across prompt, tool call, result, and downstream effectsSingle ID resolvable across the model log, tool-call log, sandbox log, and any data-plane logs
    1.5Identity of invoking principal (end-user identity, not just the service account), propagated from the user session through the orchestration layer to the sandboxIAM trace: end-user → orchestration role → sandbox container identity
    1.6Sandbox environment fingerprint (image digest, runtime version, language version, installed-package manifest)Container image digest and pip freeze / npm ls equivalent captured at execution time
    1.7Runtime metadata (sandbox start time, end time, CPU/memory ceiling, region, availability zone)Resource-usage record from the execution platform
    1.8Downstream-effect chain (every read, write, network call, and subsequent tool invocation the executed code triggered, with target resource and identity)Linked records showing the code's data-plane footprint, not just the model-plane footprint

    Section 2: Tool call durability

    A log that exists for thirty days is not an audit log for a workload that has to answer questions six years later, and a log the vendor can mutate is not an audit log at all. The six items below confirm the records produced in Section 1 will be there, intact, and reachable when a regulator or a litigation hold asks for them.

    #ItemVerified?Evidence the partner expects to see
    2.1Retention duration meets or exceeds the longest applicable regulatory window (six years is the usual planning floor for HIPAA workloads; financial-services and state privacy windows vary by regulator), written into the log destination's lifecycle policyS3 Object Lock / Azure Blob immutability policy / Cloud Storage retention policy with Bucket Lock, with the duration set in writing
    2.2Immutability enforced at the storage layer (write-once, append-only, or legal-hold capable), not "we don't usually delete"S3 Object Lock in compliance mode, immutable storage for Azure Blob Storage under a locked time-based retention policy, or equivalent
    2.3Deletion controls under regulator hold: documented procedure for placing and releasing legal hold, tested at least annuallyRunbook plus evidence of the most recent test
    2.4Cross-region replication for durability and disaster recovery, with the replica in the same residency boundary (US-only where the buyer's contracts or policy require it)Replication configuration and a residency attestation
    2.5Access-by-customer mode declared and operating (API export, SIEM stream, in-product dashboard, or all three), see Section 4 for detailWorking query against the customer's chosen access mode, returning a known execution within the retention window
    2.6Proof of delivery from the execution platform to the log destination (the platform confirms the log was accepted by the sink, and gaps are alarmed)Delivery-failure alarm, dead-letter queue, or equivalent

    Section 3: Sandbox isolation evidence

    The audit log is only meaningful if the execution environment it describes was actually isolated. Most code-execution products run a per-execution sandbox, but the strength of the isolation guarantee, and the customer's ability to prove it after the fact, varies sharply by vendor and by configuration.

    #ItemVerified?Evidence the partner expects to see
    3.1Per-execution sandbox provenance: each execution runs in a freshly instantiated container or VM, with the lifecycle bounded by the execution itselfVendor documentation plus a log record showing instantiation and teardown timestamps
    3.2No cross-tenant data leakage: sandbox state, ephemeral storage, and network namespace are not shared across tenants or across end-users within a tenantVendor architecture document plus, where available, a third-party report (SOC 2, HITRUST, ISO 27001 control mapping)
    3.3Sandbox lifecycle logged (instantiation, code load, execution start, execution end, teardown) with the same per-execution unique ID from item 1.4Linked lifecycle records resolvable to a single execution ID
    3.4Ephemeral-storage retention rules: any files written inside the sandbox during execution are either captured into the audit log or destroyed at teardown, with the choice declared in writingConfiguration plus a log record showing the retention decision applied
    3.5Network egress rules: outbound traffic from the sandbox is either denied by default, allowlisted to enumerated destinations, or fully logged at the network layer, and a workload that needs PHI-touching network access has the destinations documented and BAA-coveredEgress allowlist or VPC flow log evidence
    3.6Secret-handling rules: credentials passed into the sandbox are scoped to the single execution, time-bounded, and not persisted to the sandbox filesystem; secret retrieval is loggedSecret-broker configuration (AWS Secrets Manager, Azure Key Vault, Google Cloud Secret Manager) plus retrieval log

    Section 4: Customer access mode

    A log that lives only at the vendor and is not reachable by the customer's compliance team is not a customer audit log. This is a common gap: the vendor produces the log, but the customer cannot pull it on demand, cannot stream it to its SIEM, and cannot export it on contract termination.

    #ItemVerified?Evidence the partner expects to see
    4.1SIEM integration available (Splunk, Microsoft Sentinel, Google Security Operations, Datadog, or equivalent), push or pull, with documented latencyWorking integration delivering a recent execution into the customer's SIEM
    4.2Per-customer log isolation: the customer can read its own executions and only its own, with no co-mingling at the access layerAPI call returning only the customer's tenant records
    4.3Export format is structured, schema-stable, and machine-readable (JSON Lines, Parquet, or equivalent), not a PDF dump or a UI-only viewSample export plus the vendor's schema documentation
    4.4Export-on-deletion semantics: on contract termination, the customer can extract its full audit trail before the vendor deletes it, with the export window in writingContractual clause plus a tested export procedure
    4.5Access-control plane on the log itself: customer admin can grant and revoke read access to the audit log independently of access to the AI productRBAC mapping showing log readers as a distinct role

    Section 5: Regulated-buyer disqualifiers

    Each of the items below is a realistic failure, not a theoretical one. If any single one is true on a workload, the partner's recommendation is to not use the code-execution AI in regulated scope until it is remediated. Pilot-only mode against synthetic or non-regulated data is acceptable while the gap is being closed; production traffic against regulated data is not.

    #DisqualifierWhy it disqualifies
    5.1No per-execution prompt log, the model input is not captured verbatim with timestamp and end-user identityThe audit trail starts at the prompt; without it, no downstream record is reconstructable. Direct violation of 164.312(b).
    5.2No tool-call log, the executed code, query, or command is not capturedThe change record is missing. The customer cannot answer "what did the agent do" with vendor metadata alone.
    5.3Cross-tenant sandbox, execution environments, ephemeral storage, or network namespaces are shared across tenants or across end-users without isolationContainment failure under the Security Rule and across every regulated-buyer regime; a single escape exposes other customers' regulated data.
    5.4No immutability on the log destination, records can be edited or deleted by vendor or customer staff outside a documented legal-hold procedureA mutable log is not an audit log; the regulator-facing answer collapses on first challenge.
    5.5Retention is shorter than 6 years for any HIPAA-affected workload (and shorter than the equivalent regulatory window for non-HIPAA regulated workloads)Six years is the HIPAA documentation retention period (45 CFR 164.316(b)(2)(i)) and the floor this checklist applies to audit logs; a log that ages out before the audit window closes is the same as no log at all.

    The three gaps that disqualify regulated-buyer scope

    Three patterns are worth testing for in any code-execution AI procurement review. Each is subtler than the five disqualifiers in Section 5 because each can survive a casual reading of the vendor's logging documentation. Each is enough to take a workflow out of regulated-buyer scope.

    The prompt is logged, but the parameters passed to the tool are not. The vendor's run record shows the user message and the model's textual response. It does not show the SQL the model generated, the Python the sandbox executed, or the API call the tool layer made on the model's behalf. The audit trail captures what the user asked and what the model said back; it does not capture what the model did. On an OCR or state-AG inquiry, "what did the agent do against the data" is the question, and the run-record-only answer does not address it.

    The execution is logged, but the downstream effects on customer data are not. The sandbox emits a record showing that a script ran. The data plane the script touched, the production database, the file store, the third-party API, has its own log discipline that was not threaded to the execution ID. An investigator can read either log in isolation but cannot join them. A row that was changed at 14:32:08 cannot be linked to the agent execution that changed it. This is the integrity-control failure the briefing describes; it is the gap to test for first on Amazon Bedrock and Microsoft Foundry agent builds, where the data-plane logs (CloudTrail data events, SQL Server audit, application-layer logs) have to be enrolled in the same correlation scheme on purpose.

    The log exists at the vendor, but is not accessible to the customer's compliance team. The vendor will produce the log on subpoena; the vendor will not produce it on a quarterly access review or an internal incident. The customer's HIPAA security officer cannot pull yesterday's executions on demand, cannot stream them into the SIEM, and cannot honor a patient access request that requires showing what the agent did with the patient's data. A vendor-only log is a regulator-only log; it does not meet the customer's own audit obligation.

    What partners verify on a Diagnostic

    Where a Diagnostic's AI scope includes a code-execution workload, the partner does not read the logging documentation in isolation. The partner sits with the platform lead, runs three real executions against the workload, selected to cover a read-only path, a write path, and a path that triggers a downstream tool call, and walks each one end-to-end. For each execution, the partner confirms that every item in Sections 1 through 4 produced a record, that the records are joined by a single execution ID, that the customer can pull all of them through the access mode declared in Section 4, and that the records will still be there in six years under the policy in Section 2. Three executions, fully traced, against the workload as it is actually configured. The per-execution chain and the partner's read on the residual gaps go into the written report. Closing those gaps in the workflow itself is AI transformation work.

    What this is not

    This is not legal advice. It is not a substitute for per-vendor BAA, DPA, or order-form review by counsel, every contract has logging language in the addenda that does not appear in the trust portal, and every audit log obligation has to be backed by a contract clause to be enforceable. It is not a sandbox security review; the items in Section 3 confirm logging and isolation posture, not containment under adversarial conditions. It is not a model-evaluation review. And it is frozen at lastReviewed; vendor telemetry surfaces, default retention windows, and BAA addenda move on a quarterly basis, and anything read well after the lastReviewed date should be treated as a starting point and checked against the vendors' current documentation.