How audit logging works
Every call tokavach.authorize() or kavach.authorizeByToken() writes an entry to the audit log, regardless of outcome. Allowed, denied, and rate-limited calls are all recorded. The log is append-only: entries are never updated or deleted.
authorize() returns an auditId linking the decision to its log entry:
Querying logs
AuditEntry type
Unique entry identifier, prefixed aud_.
The agent that triggered the authorization check.
The user who owns the agent.
The action the agent attempted (e.g. read, write, delete).
The resource the action was attempted on.
parameters
Arguments passed to the tool at the time of the call.
The outcome of the authorization check.
Time taken to evaluate the decision, in milliseconds.
Optional token usage from the agent’s LLM call, if provided.
When the authorization check occurred.
Filtering
All filter fields are optional and combinable. Without filters, the query returns all entries up to thelimit.
Filter to a specific agent.
Filter to all agents owned by a user.
Include entries on or after this timestamp.
Include entries before this timestamp.
Filter to specific action names.
Filter by outcome.
Maximum entries to return. Default is 1000.
Pagination offset.
Exporting logs
AuditEntry interface. Each row is one authorization decision.
Both
since and until are optional on exports. Omitting both exports the entire log.Compliance references
EU AI Act, Article 12. Record keeping
EU AI Act, Article 12. Record keeping
Article 12 requires high-risk AI systems to log events automatically throughout the system lifecycle, including the period of activity and data used. KavachOS records every authorization decision with agent identity, resource, action, parameters, outcome, and timestamp.
NIST AI RMF. GOVERN 1.7 / MANAGE 4.2
NIST AI RMF. GOVERN 1.7 / MANAGE 4.2
The NIST AI Risk Management Framework calls for documented accountability mechanisms and the ability to trace AI actions to specific identities. The append-only audit trail links every decision to a named agent and user.
SOC 2. CC6.1 through CC7.2
SOC 2. CC6.1 through CC7.2
SOC 2 trust services criteria for logical access controls and system monitoring require evidence that access is granted only to authorized identities and that access events are logged. The
allowed/denied/rate_limited result field satisfies CC6.1–CC6.3. The tamper-evident, append-only structure satisfies CC7.2.ISO 42001, Annex A.8. Documentation of AI system behaviour
ISO 42001, Annex A.8. Documentation of AI system behaviour
ISO 42001 recommends documenting the behavior of AI systems in production. Exporting the audit log as JSON or CSV gives auditors a machine-readable record of every decision the system made.
Usage patterns
Monthly access report for a userNext steps
Compliance
Map audit data to EU AI Act, NIST, SOC 2, and ISO 42001.
REST API
Query audit logs via HTTP endpoints.
Admin dashboard
Visual audit log viewer with filters and export.