Interface: AuditTrailConfig
Defined in: packages/core/src/core/middleware/AuditTrail.ts:80
Configuration for the AuditTrail middleware.
Properties
actionField?
readonly optional actionField: string;Defined in: packages/core/src/core/middleware/AuditTrail.ts:100
Field name used as the action discriminator in tool arguments. Defaults to 'action'. Set to the correct discriminator for non-standard tools (e.g., 'command', 'operation').
Default
'action'extractIdentity()?
readonly optional extractIdentity: (ctx) => AuditIdentity;Defined in: packages/core/src/core/middleware/AuditTrail.ts:109
Extract identity information from the request context. Return fields relevant for your compliance requirements.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | unknown | Request context |
Returns
Identity object for audit logging
hashArgs?
readonly optional hashArgs: boolean;Defined in: packages/core/src/core/middleware/AuditTrail.ts:117
Whether to hash the arguments (SHA-256). When true, args are hashed for change detection without storing PII.
Default
truelogResult?
readonly optional logResult: "status" | "none";Defined in: packages/core/src/core/middleware/AuditTrail.ts:127
What level of result detail to log.
'status'— Log only success/error status (recommended)'none'— Don't log result at all
Default
'status'sink
readonly sink: AuditSink;Defined in: packages/core/src/core/middleware/AuditTrail.ts:85
Sink function for audit events. Can be a TelemetrySink, a logging function, or any other consumer.
toolName?
readonly optional toolName: string;Defined in: packages/core/src/core/middleware/AuditTrail.ts:91
Tool name to include in audit events. Should match the tool's registered name (e.g., 'billing').