Audit Event Schema
Every APF audit record is one JSON object on one line, valid against contracts/audit/apf.audit.event.v1.schema.json, a JSON Schema draft 2020-12 document. Components validate each record against the schema before writing it. For how to read and ship records, refer to Access Audit Events.
Files
Files are created with mode 0600 in the component’s --audit-log-dir and opened in append mode for every write. APF does not rotate or fsync them.
Envelope
Every record carries these fields.
The schema also defines causation_id, trace_id, span_id, device_id, deployment_profile, component.workload_identity, delivery, and extensions. Of these, only extensions is set: an authorization record written after the Enrichment stage ran carries extensions.x_apf_pip, listing what each policy information provider contributed. Refer to Policy Information Providers.
String Profiles
Event Types
Every event type rejects fields it does not allow. authentication and policy_service_startup records never carry subject or policy identity, so a caller cannot choose whose name or which policy appears on a refusal.
Event Fields
The schema also defines result_class, argument_summary, result_summary, obligations, checks, signer_id, workspace_id, review_ref, credential_scope, and credential_request_id. No component sets them in this release.
Policy Identity
What bundle_digest identifies depends on the component.
Use policy_revision to relate records across components, not bundle_digest. Only policy service records carry bundle_id. Refer to Trace Policy Provenance.
Resource and Verb
Values are normalized to fit their profiles. In verb, characters that are not lowercase letters, digits, underscores, or dots are dropped, so a tool named GetMail is recorded as tool.etail. A value that normalizes to nothing becomes unspecified.
Findings
A record holds up to 32 findings. The gateway keeps the most severe. A record that carries verdict never also carries a policy_verdict finding.
Effects
effects is omitted when nothing changed.
Correlation IDs
Degraded Records
If a record fails schema validation or the credential scan, some producers write a reduced record instead. Every reduced record keeps the event type and the decision or outcome, and explains itself in reason, for example caller-supplied request detail omitted.
Other policy service records have no reduced form. What happens when one cannot be written is listed in Write Failures.
What Is Never Recorded
- Request and response bodies.
- Header values and patch values.
- Request paths on middleware records.
- Extension bearer tokens, the policy service HTTP token, and bundle source tokens.
- Evaluator error text on middleware records. The generic
policy evaluation failedis used.
Before writing, every string is scanned. A record that contains a private key block, a bearer or basic credential, or a token with a known prefix such as sk-, ghp_, xoxb-, or AKIA, or a string longer than 2048 bytes, is not written as is.
Write Failures
Next Steps
- For every
reason_code, refer to Error Reference. - For example records and queries, refer to Understand Decisions and Findings.