# Interface IAuditLogger

Audit exports - Structured audit logging (Issue #193) Split from index.ts for file size compliance (Issue #285)

interface IAuditLogger {
log(
input: {
category:
| "authorization"
| "system"
| "configuration"
| "security"
| "authentication"
| "tool_invocation"
| "data_access"
| "data_modification";
severity: "info"
| "warning"
| "critical";
outcome: "error" | "success" | "failure" | "denied";
action: string;
description?: string;
actor: {
type: "system" | "user" | "external" | "agent";
id: string;
name?: string;
ip?: string;
userAgent?: string;
};
resource?: { type: string; id: string; name?: string; path?: string };
requestId?: string;
traceId?: string;
sessionId?: string;
toolName?: string;
durationMs?: number;
metadata?: Record<string, unknown>;
policyName?: string;
policyDecision?: string;
violationType?: string;
},
): void;
logToolInvocation(opts: ToolInvocationAuditOpts): void;
logPolicyDecision(opts: PolicyDecisionAuditOpts): void;
logSecurityEvent(opts: SecurityEventAuditOpts): void;
logRateLimitViolation(opts: RateLimitAuditOpts): void;
flush(): Promise<void>;
close(): Promise<void>;
}

#### Implemented by

- AuditLogger

- Defined in packages/nexus-agents/src/audit/audit-types.ts:233

##### Index

### Methods

log
logToolInvocation
logPolicyDecision
logSecurityEvent
logRateLimitViolation
flush
close

## Methods

### log

- log(
  input: {
  category:
  | "authorization"
  | "system"
  | "configuration"
  | "security"
  | "authentication"
  | "tool_invocation"
  | "data_access"
  | "data_modification";
  severity: "info"
  | "warning"
  | "critical";
  outcome: "error" | "success" | "failure" | "denied";
  action: string;
  description?: string;
  actor: {
  type: "system" | "user" | "external" | "agent";
  id: string;
  name?: string;
  ip?: string;
  userAgent?: string;
  };
  resource?: { type: string; id: string; name?: string; path?: string };
  requestId?: string;
  traceId?: string;
  sessionId?: string;
  toolName?: string;
  durationMs?: number;
  metadata?: Record<string, unknown>;
  policyName?: string;
  policyDecision?: string;
  violationType?: string;
  },
  ): void

  Log an audit event

  #### Parameters

  - input: {
    category:
    | "authorization"
    | "system"
    | "configuration"
    | "security"
    | "authentication"
    | "tool_invocation"
    | "data_access"
    | "data_modification";
    severity: "info"
    | "warning"
    | "critical";
    outcome: "error" | "success" | "failure" | "denied";
    action: string;
    description?: string;
    actor: {
    type: "system" | "user" | "external" | "agent";
    id: string;
    name?: string;
    ip?: string;
    userAgent?: string;
    };
    resource?: { type: string; id: string; name?: string; path?: string };
    requestId?: string;
    traceId?: string;
    sessionId?: string;
    toolName?: string;
    durationMs?: number;
    metadata?: Record<string, unknown>;
    policyName?: string;
    policyDecision?: string;
    violationType?: string;
    }

  #### Returns void

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:235

### logToolInvocation

- logToolInvocation(opts: ToolInvocationAuditOpts): void

  Log a tool invocation

  #### Parameters

  - opts: ToolInvocationAuditOpts

  #### Returns void

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:238

### logPolicyDecision

- logPolicyDecision(opts: PolicyDecisionAuditOpts): void

  Log a policy decision

  #### Parameters

  - opts: PolicyDecisionAuditOpts

  #### Returns void

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:241

### logSecurityEvent

- logSecurityEvent(opts: SecurityEventAuditOpts): void

  Log a security event

  #### Parameters

  - opts: SecurityEventAuditOpts

  #### Returns void

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:244

### logRateLimitViolation

- logRateLimitViolation(opts: RateLimitAuditOpts): void

  Log a rate limit violation

  #### Parameters

  - opts: RateLimitAuditOpts

  #### Returns void

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:247

### flush

- flush(): Promise<void>

  Flush pending events

  #### Returns Promise<void>

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:250

### close

- close(): Promise<void>

  Close the logger

  #### Returns Promise<void>

  - Defined in packages/nexus-agents/src/audit/audit-types.ts:253