DEV Community

Emery Yang
Emery Yang

Posted on

Metadata or Payload? A Spike for Agent Audit Trails

Can an audit log rebuild an agent's config patch without asking the agent again? That is the decision. This is a proposed one-hour spike, not a report of a completed test.

Suppose a team lets a coding agent patch configuration through an API. For this exercise, treat the Kubernetes audit log as the only record you may consult. A Kubernetes audit policy applies the first matching rule, which sets the event's level. Metadata can capture caller, time, resource and verb without request or response bodies. RequestResponse can also capture both bodies for resource requests (audit docs). Therefore metadata alone cannot reconstruct an omitted payload.

Steps

Hypothesis: Metadata-level audit attributes an agent's config patch to a named identity but cannot reconstruct the changed values. One hypothesis; one pass/fail check.

Prerequisites: a staging cluster, one agent service account, an audit policy you may edit, and one hour. Avoid production data.

  1. State the decision first: keep Metadata, or use RequestResponse for selected resources.
  2. Write a policy with the narrow rule before broad rules. The first matching rule decides the level.
  3. Exercise three shapes: create, patch, delete.
  4. Try to rebuild each change from the audit record alone. Do not open the agent transcript or another log.
  5. Record unrecoverable fields.

Expected under Metadata: actor, timestamp, verb, resource name; no field values. Patch reconstruction should fail.

Test

Choose one patch event. From the audit record only, answer: who, when, and the exact value written?

  • Pass: all three are answered without other sources.
  • Fail: the value is missing, or only the object name appears.

If Metadata seems to pass, verify that the event was a patch, that the applied level was Metadata, and that no non-audit source was used. Do not generalize from it.

If RequestResponse captures nothing, check rule ordering before blaming the agent. An earlier broad rule can shadow the narrow one.

Boundaries and tradeoffs

RequestResponse includes request and response bodies. That creates storage and sensitivity risks; scope it to the resources your decision needs, then expire those records deliberately. Captured bodies can serve as lineage evidence, not truth. PROV-DM models entities, activities and responsible agents, including inputs and outputs (PROV-DM). It records lineage; it does not certify correctness. Keep review separate from audit depth.

This article was created with AI assistance.

Top comments (0)