feat(audit): Add core audit logging infrastructure
- Add AuditLogger class with rotation support - Add audit configuration to config schema - Instrument tool execution with full audit logging - Instrument session lifecycle (create, message, delete, transfer, compact) - Add audit logger initialization in daemon - Add cron scheduler audit logging Audit events captured: - tool.start/success/error/denied - session.create/message/delete/transfer/compact - cron.trigger/add/remove All logs go to ~/.local/share/flynn/audit.log (JSON lines) with rotation (10MB files, 30-day retention)
This commit is contained in:
@@ -132,6 +132,14 @@ export interface ToolPolicyContext {
|
||||
agent?: string;
|
||||
/** Provider name (e.g. 'ollama', 'anthropic'). */
|
||||
provider?: string;
|
||||
/** Session ID for audit logging. */
|
||||
sessionId?: string;
|
||||
/** Channel name for audit logging. */
|
||||
channel?: string;
|
||||
/** Sender ID for audit logging. */
|
||||
sender?: string;
|
||||
/** Model tier for audit logging. */
|
||||
tier?: string;
|
||||
}
|
||||
|
||||
// ── ToolPolicy engine ───────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user