Direct answer
Audit evidence is usable in an investigation only after you check three things: that the events you expected were captured, that timestamps line up across sources, and that the export you are holding has a traceable provenance. Available telemetry is not the same thing as a complete audit trail. Claude Code monitoring can include user prompts, assistant responses, tool results, API requests, API errors and tool decisions, but availability and content depend on configuration, redaction and truncation. Checking those limits before an incident is what makes the record trustworthy afterwards.
The concrete win is an investigation that starts from records you can defend, with known coverage and a documented export path. The concrete loss is that the checks will find gaps, and gaps found during an incident are much more expensive than gaps found during a quiet week. The practical implication is that a correlation identifier links records together without proving that an agent action caused a cloud event. Correlation is a thread to pull, not a conclusion.
The workflow here applies to any audit pipeline: define the expected event set first, then measure what the pipeline actually delivers against it, then preserve exports in a way that a third party can verify. Doing the checks in that order keeps the gap analysis honest.
Expected Event Set
Start from the events an investigation would need, not from the events the pipeline happens to emit. The expected set is a design decision, and writing it down is what turns “we have logs” into a checkable claim.
| Expected event | Telemetry source | Coverage caveat |
|---|---|---|
| User prompt submitted | Claude Code monitoring | Content depends on redaction and truncation settings |
| Assistant response | Claude Code monitoring | May be truncated for large responses |
| Tool decision | Claude Code monitoring | Records the decision, not always the full arguments |
| Tool result | Claude Code monitoring | Large results may be truncated or elided |
| API request and error | Claude Code monitoring | Error events may not capture upstream detail |
| Cloud control-plane change | CloudTrail or equivalent | Depends on the trail covering every region in use |
| Cluster change | Kubernetes audit log | Depends on audit policy verbosity configured |
Official, F046: Claude Code’s monitoring documentation lists user prompt, assistant response, tool result, API request, API error and tool decision as event types monitoring can include. Availability and content depend on configuration, so the expected set has to be confirmed against the deployed configuration rather than assumed from the documentation.
The cloud and cluster rows are where coverage usually breaks. An agent can trigger an infrastructure change whose record lives entirely in the cloud audit log, and the agent-side telemetry may not contain the resulting change at all. The Terraform plan review gates guide covers the review gate that should sit in front of such a change, and the plan command reference in the sources is the documentation for the command that produces the plan being reviewed.
Two event families are commonly missing from the expected set. Authentication events for the agent identity, which tell you who was acting, and administrative changes to the monitoring configuration itself, which tell you whether the pipeline was altered around the time of the event. Both belong in the set.
Telemetry Coverage Limits
Coverage limits are the honest part of the exercise. Every pipeline has them, and an investigation that ignores them produces overconfident conclusions.
Redaction removes content before it reaches the log, which means an event can be present and still be missing the detail an investigation needs. Truncation cuts large payloads, so a tool result that was truncated cannot be recovered from the log later. Sampling drops events by design, which makes absence of an event ambiguous between “did not happen” and “was not sampled”. Retention limits delete records on a schedule, so an incident discovered late may be past the window.
| Limit | What it removes | How to detect it |
|---|---|---|
| Redaction | Sensitive fields within an event | Event present, fields empty where content was expected |
| Truncation | Tail of large payloads | Event size at or near a fixed cap |
| Sampling | Whole events by rate | Event counts below expected volume |
| Retention | Records past an age | Export window older than the retention period |
| Destination filtering | Events routed away from your sink | Events present upstream, absent downstream |
Official, F046 support: The monitoring documentation describes these event types alongside configuration-dependent availability. Treat the deployed configuration as the source of truth for what is actually captured, and check it on a schedule because it changes.
None of these limits makes the telemetry useless. They make it bounded, and a bounded record with known limits is more useful in an investigation than an unbounded record whose limits are discovered mid-investigation.
Derived, F048: The general principle that audit records should be assessed for coverage and integrity before being used as investigation evidence is a derived evidence-handling recommendation. A CISA logging reference architecture document was surfaced during research but not fetched in full, so the specific workflow here is editorial rather than a summary of that document.
Timestamp Integrity
Timestamps are what let records from different systems be ordered and compared. When they disagree, the investigation spends its first hours arguing about the timeline instead of the cause.
Three checks cover most timestamp problems. First, confirm every source records time in a single agreed reference, usually UTC, and that the timezone is stored with the value rather than implied. Second, confirm clock synchronization is actually running on the hosts that generate the events, because an unsynchronized clock produces events that appear out of order. Third, compare a single action’s records across sources and check whether the ordering is consistent with causality.
| Timestamp problem | Symptom | Check |
|---|---|---|
| Mixed timezones | Events appear to jump backward | Confirm all sources store UTC with offset recorded |
| Unsynchronized clock | One source consistently offset | Compare NTP sync status across event-producing hosts |
| Missing timezone in the value | Ambiguous ordering during DST shifts | Inspect stored values for an explicit offset |
| Latency between event and record | Related events appear unrelated in time | Compare a known action across agent and cloud logs |
The last row is the one that catches investigations out. A cloud change can be recorded seconds after the agent decision that triggered it, and a naive timeline comparison can put the change before the decision. Where the platform provides request correlation fields, use those to link the records instead of ordering them purely by timestamp.
Timestamp checks belong in the quiet-week routine rather than in the incident. Fixing a clock synchronization problem during an incident means every record collected so far is suspect, which is a much worse position than finding the problem a month earlier.
Correlation Fields
Correlation fields are the identifiers that connect records across systems. They answer “which records belong to the same action”, which is the question an investigation asks first.
Official, F047: Claude Code’s monitoring documentation describes prompt.id and request_id attributes for correlating prompts with API requests. These link agent-side records to each other and to the API calls behind them. Correlation links records; it does not prove that an agent action caused a cloud event.
| Correlation goal | Field | What it proves |
|---|---|---|
| Link a prompt to its API calls | prompt.id | Same conversation thread |
| Link a prompt to the request that served it | request_id | Same API request |
| Link an agent action to a cloud change | No universal field | Requires an investigation, not an identifier |
The third row is the boundary to respect. An agent decision and a cloud change may be connected by timing, by an identifier the tool propagated, or by nothing at all. Establishing that the agent caused the change needs evidence beyond a shared timestamp: the tool invocation record, the cloud change’s principal, and the plan or command that was reviewed. The incident timeline correlation guide covers building that timeline from request identifiers without overclaiming causation.
A practical habit is to propagate an identifier from the agent action into the infrastructure change whenever the tooling allows it. A plan file tagged with the request identifier, or a commit message carrying it, turns a correlation question into a lookup later. The Terraform state access controls guide covers the state side of that provenance.
Request identifiers are also not proof of authorization. A record showing the agent made a request does not show that the request was allowed by policy, which is the distinction the policy as code audit guide draws.
Export Provenance
An export is what you hand to an investigator, an auditor or a regulator. Provenance is the record of where it came from, how it was produced, and what happened to it afterwards. Without provenance the export is just a file with no way to establish that it reflects the source system.
| Artifact | Integrity check | Storage owner |
|---|---|---|
| Log export archive | Checksum recorded at export time | Evidence custodian |
| Export manifest | Lists sources, time window and filter applied | Evidence custodian |
| Chain-of-custody record | Who handled the export and when | Evidence custodian |
| Configuration snapshot | Monitoring configuration at export time | Observability owner |
Record the checksum when the export is created, not afterwards. A checksum computed later on a file that has already been handled proves nothing about the original. The manifest should state the time window, the sources included, and any filter or redaction applied during export, because a filtered export presented as complete is the specific misrepresentation to avoid.
Storage access belongs to a custodian separate from the people under investigation where that is practical. Splitting the role is the same independence principle the security exception ownership guide applies to exception approval: the person whose actions are being examined should not control the record of them.
One boundary worth stating plainly. Raw conversation content in Claude Code telemetry can include sensitive material, and filling evidence gaps by exporting and circulating raw conversation content creates a new exposure. Prefer targeted, redacted exports, and treat raw content as a last resort with its own access control.
Gap Detection
Gap detection is the practice of looking for missing events deliberately rather than waiting for an investigation to find them. Most gaps are visible from the pipeline’s own metrics if someone checks.
| Observed gap | Possible cause | Verification step |
|---|---|---|
| Event count below expected volume | Sampling, or a source stopped sending | Compare source-side counts with sink-side counts |
| Events present with empty fields | Redaction applied | Compare against redaction configuration |
| Events clustered at a fixed size | Truncation | Check payload sizes against the truncation limit |
| Window older than expected missing | Retention expiry | Confirm export window against retention setting |
| Cloud events absent for a region | Trail not covering that region | Enumerate regions and trail coverage |
Two of these deserve a standing check. The count comparison between source and sink catches a silently dead pipeline, which is the concern the log pipeline health guide addresses directly. The region coverage check catches the trail that misses the region where the change actually happened, which is the gap that makes a cloud-side investigation impossible after the fact.
Official, CloudTrail context: AWS CloudTrail’s user guide documents recording API activity for auditing. Treat the trail configuration, including whether it covers every region in use, as part of the expected event set rather than an assumption.
Record gaps as findings with an owner and a target, the same way the AISVS control mapping guide records unmet controls. A gap that is known, owned and scheduled is a managed limitation. A gap that is discovered during an incident is a problem with no good options.
Evidence Handling
Handling rules decide what happens to an export after it is created. The rules are short, and they exist to keep the export admissible and useful.
Preserve the original export unchanged and work from copies. Record every transfer of custody with a time and a person. Store exports with access control proportional to their sensitivity, and set a retention period that matches your obligations rather than keeping everything forever. Where an export contains personal data, apply the same handling rules your organization applies to any other personal data export.
| Handling rule | Reason | Failure it prevents |
|---|---|---|
| Work from copies, never the original | Preserves the original’s integrity | Untraceable modification of evidence |
| Record custody transfers | Establishes a chain | Dispute over who handled the export |
| Access control on storage | Limits exposure | Sensitive content circulated widely |
| Documented retention period | Matches obligations | Indefinite retention of personal data |
| Redact before wide sharing | Limits exposure | Raw conversation content spreading |
The redaction rule has a cost, and it is worth naming. A heavily redacted export is less useful to an investigator, and there is a real tension between minimizing exposure and preserving investigative detail. Resolve it by producing two tiers: a redacted export for wide sharing and a controlled raw export for the investigation team, each with its own custody record.
Evidence handling also intersects with postmortem work. The blameless postmortem evidence guide covers using records to understand a failure without assigning blame, which depends on the same integrity discipline.
Investigator Checklist
Run this list before treating any export as investigation evidence. Each row is a pass condition, and a row that fails is a limitation to record rather than to ignore.
| Check | Pass condition | If it fails |
|---|---|---|
| Expected event set defined | The set is written down and covers cloud and cluster changes | Define it before drawing conclusions |
| Coverage confirmed | Events for the window are present against the expected set | Record the gap as a limitation |
| Limits documented | Redaction, truncation and retention behavior known | Query the configuration, do not assume |
| Timestamps consistent | Sources agree on reference time and ordering | Treat ordering across sources as unreliable |
| Correlation used correctly | Identifiers link records without causal claims | Investigate causation separately |
| Export provenance recorded | Checksum, manifest and custody exist | Mark the export as unverified |
| Access to raw content controlled | Raw content stored with restricted access | Restrict before circulating |
Official, monitoring fields: The prompt.id and request_id attributes documented for Claude Code monitoring are the correlation fields to use for agent-side records. Cloud-side correlation generally depends on the cloud platform’s own identifiers, and there is no universal field joining the two. The investigator should say which fields were used rather than implying a join that was not made.
The concrete win, loss, and implication
The concrete win is an investigation that starts from a known baseline. When coverage, timestamp behavior and export provenance are checked in advance, the first hours of an incident go toward the cause rather than toward establishing whether the records can be trusted at all. A gap found in advance is a limitation you planned around.
The concrete loss is the maintenance. Pipelines change, retention windows expire, redaction rules get updated, and a coverage check that passed last quarter can fail today. Keeping the expected event set current is real work, and the checks only help if they run on a schedule.
The practical implication is that audit evidence is a pipeline property, not a records property. Teams that treat telemetry as a complete forensic record keep discovering truncation and retention limits mid-investigation. Teams that measure coverage against a written expected set know exactly how far their records can be pushed, and the SLO burn rate alerts guide applies the same measured-against-expectation discipline to reliability signals.
Further reading on where evidence leaks
Evidence quality depends on what the pipeline captures, and two existing posts cover the cases where it captures too much. The secrets in logs guide covers credentials and sensitive content ending up in transcripts and telemetry, which is the exposure the redaction and raw-content rules in this post are meant to limit. The settings files and secrets guide covers configuration that can change what gets captured quietly, and a monitoring configuration change is exactly the kind of event the expected event set should include.
Evidence also depends on what an agent was induced to do. The repository prompt injection guide covers instructions arriving from repository content, and the plugin security audit guide covers auditing hooks and commands that produce telemetry. Where an investigation touches either, the tool decision and tool result events are the records most likely to explain what happened.
Verification cost applies here too. The cost per verified change guide covers pricing the effort of checking coverage on a cadence, and the verification guide covers what to ask for before calling a coverage check done.
Where an agent’s own reach is the subject of the record, the boundaries it operates within matter as much as the events. The agent harness boundary guide covers where the harness is the real boundary, and the sandbox escape guide covers what a published escape showed about isolation assumptions. An investigator reading agent telemetry should know which boundary the record describes.
Data gap and future update
The CISA logging reference architecture was surfaced during research but not fetched in full for this pass, so F048 is used as a derived principle rather than a specific requirement set. The evidence-handling workflow in this post is editorial, and a future update could align the checks with a specific published logging architecture once that document is reviewed directly.
No specific completeness percentage, retention figure or truncation limit is reported here, because none was measured for a particular deployment. Coverage behavior depends entirely on configuration, so any concrete numbers would be deployment-specific and unverified. A future update with a worked coverage check against a real pipeline would need that measurement pass.
Cloud-side correlation fields vary by platform, and this post describes the agent-side fields documented by Claude Code without enumerating cloud-side equivalents. A future update could map agent request identifiers to specific cloud platform correlation identifiers for a named platform.
Working through a coverage check with Claude Code
Give the agent the expected event set, the time window and the queries it may run against the pipeline. Ask for a coverage comparison between expected and observed events, plus a list of events present with empty fields where content was expected.
Useful agent outputs are a gap list with a candidate cause per gap, a timestamp consistency summary across sources, and a draft export manifest. Review the gap list against the redaction and truncation configuration rather than against intuition, because a redaction rule that looks like a gap is the most common false positive.
The investigation conclusions stay human. The agent can produce the coverage evidence, but deciding whether a record is trustworthy enough to base a conclusion on is a judgment with consequences, and the verification and done proof guide covers that division of labor for code changes.
Related reading in this batch
Evidence quality connects to the wider observability half of the batch. The OpenTelemetry semantic conventions guide for agents covers naming and structuring agent telemetry so it can be correlated later. The log pipeline health guide covers confirming the pipeline is alive before trusting its output, and the incident timeline correlation guide covers building a timeline from request identifiers.
For the governance side, the SOC 2 change evidence packets guide covers the evidence needed for change management specifically, and the blameless postmortem evidence guide covers the review that consumes the evidence after an incident. Vendor-side evidence expectations are covered by the vendor security review checklist guide.
One AI API Key option for OpenAI-format agents
Claude Code uses an Anthropic-format route, so the One AI free model IDs are not a Claude Code model source. The packet records Claude IDs as unavailable on 2026-11-27, and nothing in this post changes that.
OpenAI-format agents have a separate path. One AI API Key offers https://api.oneaiapikey.com/v1, one key, and 46 live free IDs, which is a different client and request format rather than a workaround for Claude Code authentication. Check the free model list and eligibility notes before wiring up an agent, read the quickstart for the request shape, or estimate spend with the cost calculator.
FAQ
Is Claude Code telemetry a complete forensic record?
No. Monitoring can include user prompts, assistant responses, tool results, API requests, API errors and tool decisions, but availability and content depend on configuration, redaction and truncation. Treat it as one source in a wider evidence set, with known limits.
Does a shared request_id prove the agent caused a cloud change?
No. Correlation fields link records that belong together and establish ordering. Causation needs additional evidence, such as the tool invocation record and the principal that made the cloud change. A shared identifier is a thread to pull, not a conclusion.
What integrity checks belong on an export?
Record a checksum when the export is created, produce a manifest naming the sources, time window and any filter applied, and keep a chain-of-custody record for every transfer. A checksum computed after the file has been handled proves nothing about the original.
Why not just export raw conversation content to fill gaps?
Raw content can include sensitive material, and circulating it to fill an evidence gap creates a new exposure. Prefer targeted redacted exports for wide sharing, and keep any raw export under restricted access with its own custody record.
How do we detect a gap before an incident?
Compare source-side and sink-side event counts for the window, check for events present with empty fields indicating redaction, check payload sizes against truncation limits, and confirm the time window against retention settings. Run these on a schedule, because coverage changes when configuration changes.
More Claude Code troubleshooting
- Claude Code Terraform Drift: Triage Before Reconciliation
- Kubernetes Server-Side Apply: Ownership Checks for Claude Code
- Claude Code Kubernetes RBAC: Least Privilege Reviews
- Claude Code NetworkPolicy: Blast Radius Reviews
- Claude Code Pod Security: Admission Gate Reviews
- Claude Code Cloud IAM: Permission Boundary Reviews
- Claude Code Cloud Costs: Budget and Quota Guardrails
- Claude Code Incident Tabletops: NIST-Aligned Exercises
- Claude Code Access Reviews: Recertify Agent Identities
- Claude Code Threat Models: Infrastructure Agent Boundaries
- Claude Code RACI: Ownership for Infrastructure Changes
- Claude Code Approvals: Risk Tiers for Infrastructure
- Claude Code Break Glass: Incident Access Controls
- Claude Code Change Freezes: Emergency Change Rules
- Claude Code Runbooks: Ownership and Review Cadence
- Claude Code Governance: Platform Council Charter
- Claude Code Error Budgets: Release Decision Policy
Sources
- Official: Claude Code monitoring and usage documentation, on event types including prompt, response, tool result, API request and error, and on prompt.id and request_id correlation fields (F046, F047).
- Official: AWS CloudTrail user guide, reference for recording cloud API activity for auditing.
- Official: CISA Logging Reference Architecture, surfaced during research and not fetched in full; used as the general principle in F048.
- Official: Terraform plan command reference, reference for the plan command whose review produces infrastructure change records.
- Independent: OWASP Secure Coding with AI Cheat Sheet, supporting least privilege and human review for agent workflows.