feat(audit): add correlation ids and redaction
This commit is contained in:
+28
-1
@@ -2,7 +2,7 @@ export type AuditLevel = 'debug' | 'info' | 'warn' | 'error';
|
||||
|
||||
export type AuditEventType =
|
||||
// Tool execution
|
||||
| 'tool.start' | 'tool.success' | 'tool.error' | 'tool.denied'
|
||||
| 'tool.start' | 'tool.success' | 'tool.error' | 'tool.denied' | 'tool.approval'
|
||||
// Skills installer
|
||||
| 'skills.installer.execution_blocked' | 'skills.installer.command_result'
|
||||
// Session lifecycle
|
||||
@@ -49,6 +49,10 @@ export interface AuditQuery {
|
||||
export interface ToolStartEvent {
|
||||
tool_name: string;
|
||||
tool_args: unknown;
|
||||
execution_id?: string;
|
||||
execution_environment?: 'host' | 'sandbox';
|
||||
skill_name?: string;
|
||||
redactions_applied?: number;
|
||||
session_id?: string;
|
||||
channel?: string;
|
||||
sender?: string;
|
||||
@@ -59,6 +63,10 @@ export interface ToolSuccessEvent {
|
||||
tool_name: string;
|
||||
result: { success: boolean; output: string; error?: string };
|
||||
duration_ms: number;
|
||||
execution_id?: string;
|
||||
execution_environment?: 'host' | 'sandbox';
|
||||
skill_name?: string;
|
||||
redactions_applied?: number;
|
||||
session_id?: string;
|
||||
}
|
||||
|
||||
@@ -67,16 +75,35 @@ export interface ToolErrorEvent {
|
||||
error: string;
|
||||
duration_ms: number;
|
||||
reason?: string;
|
||||
execution_id?: string;
|
||||
execution_environment?: 'host' | 'sandbox';
|
||||
skill_name?: string;
|
||||
redactions_applied?: number;
|
||||
session_id?: string;
|
||||
}
|
||||
|
||||
export interface ToolDeniedEvent {
|
||||
tool_name: string;
|
||||
reason: string;
|
||||
execution_id?: string;
|
||||
execution_environment?: 'host' | 'sandbox';
|
||||
skill_name?: string;
|
||||
redactions_applied?: number;
|
||||
session_id?: string;
|
||||
denial_type: 'policy' | 'hook' | 'not_found' | 'autonomy_override';
|
||||
}
|
||||
|
||||
export interface ToolApprovalEvent {
|
||||
tool_name: string;
|
||||
approved: boolean;
|
||||
reason?: string;
|
||||
execution_id?: string;
|
||||
execution_environment?: 'host' | 'sandbox';
|
||||
skill_name?: string;
|
||||
redactions_applied?: number;
|
||||
session_id?: string;
|
||||
}
|
||||
|
||||
export interface SkillsInstallerExecutionBlockedEvent {
|
||||
skill_name: string;
|
||||
phase: 'install' | 'execute';
|
||||
|
||||
Reference in New Issue
Block a user