TypeScript SDK — Audit Logs
Log and query audit events.
typescript
// Log blocked/approval_required events only
await korclaw.audit.create({
agent: "ops-bot",
action: "deploy",
resource: "production",
severity: "high",
result: "blocked",
});
// List audit logs
const logs = await korclaw.audit.list({ limit: 50, result: "blocked" });
// Alias: korclaw.audit.log, korclaw.events.listaudit.create rejects result: allowed. Use policies.evaluate for allowed outcomes — it writes the audit log automatically.