#AI#大模型#DevOps

Preserving Generative AI Incident Evidence: Reproducible Snapshots, Chain of Custody, and Minimal Exposure

Dashboard screenshots and post-incident reruns cannot prove what happened at the time of an incident. This article freezes model, prompt, retrieval, and tool evidence; defines append-only sealing and transfer chains; and enables review while protecting sensitive source content.

Key Points

  • Topic Focus: AI、大模型、DevOps
  • Suitable for: indie hackers, full-stack engineers, AI application developers
  • Core value: quickly understand background, practical paths, common pitfalls, and engineering advice
Author @admin·Published July 26, 2026·Updated July 26, 2026

Generative AI incidents often lose their original scene within minutes: session caches expire, vendors roll out model updates, retrieval indexes continue to change, and on-call engineers overwrite the original prompt while trying to reproduce the issue. Monitoring screenshots show only aggregate curves; they cannot answer, "Which input passed through which policy version to produce this output?" Handling Model Provider Degradation Incidents covers diagnosis and fallback, while AI Cloud Control Plane Audit Integrity protects platform change logs. This article addresses only the chain of custody for incident materials, from acquisition through sealing, transfer, and destruction.

Freeze the acquisition scope before copying the scene

Following the forensic readiness principles of NIST SP 800-86, teams should publish aiIncidentAcquisitionProfile.v1 in advance, listing mandatory, conditional, and prohibited acquisition items by incident type. At minimum, each case must bind the tenant, time boundaries, triggering event, approved scope, acquisition profile, data classification, retention basis, owner, and trusted clock. Data from adjacent tenants, entire vector databases, or every employee conversation must not be collected merely because it might be useful later.

For a harmful response, the minimum reproduction capsule usually includes the normalized message sequence and ordering, system prompt/bundle digest, model or provider handle, sampling parameters, tool schema and actual responses, retrieval chunk IDs/versions/authorization snapshots, safety classifier and threshold release, runtime decision receipts, feature flags, and request and response timestamps. Raw sensitive payloads belong in an isolated evidence repository; ordinary investigation views receive only redacted working copies and controlled references. Prompt and Trace Telemetry Governance defines routine collection boundaries. An incident profile must not use an emergency to permanently expand default telemetry.

yaml
schema: aiIncidentEvidenceCase.v1
caseId: aicase-2026-0719-0042
scope: { tenant: tenant-7, from: 2026-07-19T09:41:00Z, to: 2026-07-19T09:44:00Z }
acquisitionProfile: harmful-output@4
evidenceGeneration: 1
items:
  - id: conversation-sequence
    source: inference-gateway
    contentDigest: hmac-sha256:3e1...
    cipherDigest: sha256:82d...
    acquiredAt: 2026-07-19T09:47:12Z
redactionProfile: analyst-view@3
retentionClass: safety-investigation-90d

Within the trusted boundary, the collector computes an HMAC over the raw bytes using a case-specific key, then encrypts the data and records the ciphertext digest. A normalized copy used for comparison receives a separate normalizedDigest; it cannot replace the original digest. This detects changes to the original bytes while preventing the bare hashes of low-entropy prompts from being enumerated with a dictionary. Keys are isolated by case role, and evidence objects use versioning and immutable retention. If a cloud provider cannot export the model weights from that moment, preserve its immutable request ID, returned model identifier, response bytes, and acquisition status, then mark reproducibility as PARTIAL. A later approximate rerun cannot upgrade it to COMPLETE.

Sealing is an explicit acceptance point

A case's content state is OPEN -> SEALING -> SEALED -> DESTRUCTION_APPROVED -> DESTROYED. Transfers are repeatable custody events, while legal holds are orthogonal, generation-aware retention states; neither belongs in the one-way content state machine. OPEN permits additional collection. After entering SEALING, the system confirms that every required object is durable across two failure domains, its digest can be recomputed, its decryption key can be recovered, and its provenance and trusted time are complete. It then generates a deterministically ordered manifest root. SEALED is the acceptance point that investigations may cite. Late-arriving evidence creates evidenceGeneration + 1 and references the previous root without modifying the old manifest.

An RFC 3161 timestamp token can prove that a digest existed no later than a trusted time, but it does not prove that the content is authentic or that the acquisition scope is complete. It must be interpreted alongside source identity, acquisition actions, and custody events. W3C PROV entity/activity/agent relationships can express "who obtained what from which system, and which redaction transformation generated the working copy." Every export, transfer, decryption, resealing, and destruction appends a custody event recording the operator, role, purpose, before-and-after digests, time, and receipt confirmation. Investigation notes must not be written back to the originals.

A legal hold or regulatory retention order is issued by an authorized role and overrides automatic deletion; releasing it likewise requires an explicit decision. The destruction acceptance point must atomically recheck the latest hold generation so that a concurrently arriving hold cannot be bypassed by a stale deletion job. This technical state does not replace the organization's legal judgment. Expiration-driven destruction must cover objects, copies, caches, and the case key, and must generate a verifiable tombstone. Statistical reports retain only the minimum aggregate data that can no longer be linked to individuals. Data Privacy and Compliance for AI Applications addresses legality and user rights; the preservation system faithfully executes the approved scope.

Validate with evidence-gap drills

Fault injection scenarios include traces discarded by sampling, overwritten tool responses, missing provider requests, workers that upload objects without committing the manifest, client clocks running ten minutes fast, duplicate retries mixed with another output, substituted objects, temporarily unavailable case keys, redactors that change semantics, cross-tenant ID injection, and deletion jobs arriving simultaneously with a hold. The system must report COMPLETE, PARTIAL, SCOPE_VIOLATION, or UNVERIFIABLE; it must never present a correct file count as proof of completeness.

One set of launch gates can require a 100% sealing rate within ten minutes for artifacts defined as critical in synthetic incidents; a 100% recovery verification rate for manifests, object digests, and timestamps; zero undeclared evidence gaps; zero cross-tenant data or profile-prohibited fields entering a case; all 30 quarterly samples recovered from cold storage being decryptable with reconstructable relationship graphs; and every analyst export passing redaction and authorization probes. Merely increasing collection volume does not count as an improvement. Agent Replay Evaluation can turn approved incident samples into regression tasks, but those tasks must be created from redacted derivative copies and must not consume sealed originals directly.

Begin rollout by creating temporary cases only for manually constructed harmful outputs, retrieval authorization bypasses, and incorrect tool calls, then validate destruction and recovery. Next, enable actual sealing for 5% of incident alerts and expand by incident type. If the collector leaks data or introduces excessive latency, point the alias back to the previous profile version, disable collection of sensitive raw content immediately, and retain only the minimum request ID and digest. Existing sealed cases remain readable under their original contract and must not be rewritten because of a software rollback. After the fix, add a new generation documenting the gap; the historical evidence grade remains unchanged.

Further reading

Related

Related Content