A coding agent such as Claude Code can do the mechanical part of SOC 2 evidence collection if it works read-only. It gets read-only credentials, runs queries and exports, and never changes configuration or edits an export. Each artifact shows its source system, the query or filter used, the date and time of the export and the record count. A person reviews everything before it goes to the auditor.
Key takeaways
- Read-only is a permission, not an instruction: give the agent its own read-only identity.
- An export needs its provenance: source system, query or filter, date and time, record count.
- The raw export is never edited. The agent’s summary is not evidence; the file is.
- A named person reviews and uploads each artifact. The agent sends nothing to the auditor.
Can Claude Code collect our SOC 2 evidence?
An evidence request is mostly populations and configurations: every user with production access, every change merged in the period, the multi-factor setting. A coding agent (Claude Code, Cursor or similar) can write each query, run it and save the result. That is collection, not the control and not the audit.
The rule is read-only, enforced by access and not by the prompt:
- A separate identity. Create a read-only identity for the agent in each system, scoped to configuration and metadata, not customer data.
- Queries and exports only. The agent never changes configuration, even to close a gap it finds. A gap goes to the system owner.
- Approval first. Where the tool can ask before it runs a command, leave that on.
- Raw output stays raw. The agent never edits an export. Sorting and summaries happen on a copy.
First read Is it safe to put security documents into ChatGPT or Claude?
This is the collection step in SOC 2 with AI: AI-guided preparation, CPA-performed audit. Under the Zero-Platform SOC 2 Audit, Auditsuisse explains the criteria and sends its evidence request list once engaged; your management designs and operates the controls.
What does a valid evidence artifact look like?
A list from your systems is what auditors call information produced by the entity (IPE). The auditor must establish that it is complete and accurate before relying on it; see tests of controls, IPE and IUC. Keep a short manifest next to every file:
- Source system. The system of record and the account or tenant, not a spreadsheet someone maintains.
- Query or filter. The exact command, API call or report parameters, including the period.
- Date and time of the export. With the time zone.
- Record count. The records in the file, and the count the system itself shows for the same filter.
- Run by. The identity that ran the query and the person who supervised it.
For a Type II report the population covers the whole period, so the filter states its first and last day.
Which evidence can an agent export from each system?
| System | Read-only access | Example evidence |
|---|---|---|
| Cloud account | A read-only role limited to configuration and metadata | Users, roles and attached policies; multi-factor settings; encryption, logging and network configuration |
| Identity provider | A read-only administrator role or read-scoped token | User list with status; sign-in and multi-factor policy; members of groups that grant production access |
| Source control | A token with read access to repositories and settings | Branch protection rules; pull requests merged in the period with author, reviewer and merge date |
| Ticketing | A read-only project role | Change, access and incident tickets opened in the period, with approver, status and dates |
| HR system | A report-only role, or an export a person runs | Joiners and leavers in the period with dates; training completion. Names, roles and dates only |
These are examples. Your own list follows the controls your management has chosen; see the SOC 2 controls list by Trust Services Criteria and SOC 2 with AI on AWS.
What prompts should we give the agent?
Three prompts cover the cycle: plan, run, check. None asks the agent to change a system or a file.
Plan a read-only query for one request
You are helping me collect evidence for a SOC 2 audit with read-only credentials. Do not change any configuration or run any command that adds, modifies or deletes a resource. Request: [paste the auditor's request] System: [name of the system] Period: [first day] to [last day] Ask me which account or tenant is in scope and how this process works here today before you propose anything. Then propose the read-only query or report that returns the full population. Show the exact command and explain each filter. Do not run it until I approve it. If read-only access cannot answer the request, say so and stop. Flag every assumption. List anything you assumed that I need to verify.
Run the approved query and record where the export came from
Run the query I approved, exactly as written. Save the raw output to a file and leave it unchanged: no sorting, filtering, renamed columns, removed rows or corrected values. If the output looks wrong or incomplete, tell me and stop. Next to the file, save a plain-text manifest with: - source system and account or tenant - identity that ran the query - exact query or report parameters - date and time of the export, with time zone - record count, and how you counted it Ask me who supervises this export and where the same count can be seen in the system. Flag every assumption. List anything you assumed that I need to verify.
Check the export folder before a person reviews it
Read the files in [folder]. Do not edit, move or delete anything. Ask me which of the auditor's requests each file is meant to answer. For each export, check that its manifest names the source system, the query or filter, the date and time, and the record count. Count the records in the file and compare with the manifest. Check that the dates cover [first day] to [last day]. List, per file, what is missing or inconsistent. Do not fill a gap yourself or rewrite a manifest. Flag every assumption. List anything you assumed that I need to verify.
Who reviews the evidence before it goes to the auditor?
A person, every time. Before upload, a named reviewer who knows the system:
- Opens the raw file, not the agent’s summary.
- Compares the record count with the count in the system itself.
- Checks that the filter covers the in-scope environment and the whole period.
- Checks that the file holds only what was requested: no secrets, no customer data.
- Notes their name and the date, then uploads the file with its manifest.
If an export shows a gap, such as a leaver whose account is still active, fix the system through your normal process and keep the original export. The gap existed on that date.
AI-written policies and descriptions are acceptable only if they describe what your company actually does. The audit tests how controls operate, not how documents read.
See the quality gate in audit evidence management best practices and, for the auditor’s side, What auditors accept from AI.
Who does what
| Task | Your team (with or without AI) | Your AI assistant | The auditor |
|---|---|---|---|
| Write the query | Approves each query before it runs | Proposes a read-only query and explains its filters | Requests the population and states the period |
| Run the export | Supervises the run and keeps the raw file | Runs the approved query; records source, query, date and count | Asks how each list was generated |
| Review before sending | A named person checks count, period and scope, then uploads | Lists gaps; changes nothing | Not involved |
| Test and conclude | Answers questions about the exports | Nothing | Tests each population for completeness and accuracy, forms the opinion and issues the report |
Frequently asked questions
Will an auditor accept evidence that an AI agent exported?
What matters is whether the export is complete and accurate, not which tool ran the query. Provide the source, query, date and count, and expect the auditor to test them and perhaps to watch the query run again.
Can the agent take screenshots instead of exports?
A screenshot of one record shows one record, not the population or how it was selected. Export the population, and use a screenshot only to show the query and its result count on screen.
Do we need a compliance platform if an agent runs the exports?
No. Platforms such as Vanta or Drata connect to your systems and collect evidence continuously. Without one, your team runs the exports itself, on a schedule, across the whole period. See SOC 2 without Vanta or Drata.
Sources & further reading
AICPA, 2017 Trust Services Criteria (with revised points of focus, 2022); SSAE No. 18, AT-C sections 105 and 205.
Related: Tests of controls, IPE and IUC, Audit evidence management best practices.
Product names are trademarks of their owners. Auditsuisse is not affiliated with these vendors.
Work with a licensed CPA firm
Auditsuisse Assurance NA PC is a licensed US CPA firm, enrolled in the AICPA Peer Review Program and authorized to perform SOC 2 examinations and issue SOC 2 reports. You prepare; we examine your evidence. See the Zero-Platform SOC 2 audit or book a scoping call.