# Function createGraphAuditBridge

- createGraphAuditBridge(
  trail: AuditTrail,
  ): (event: { type: string; readonly [key: string]: unknown }) => void

  Creates an onEvent callback that bridges graph events to the audit trail. Pass the returned function as `onEvent` in GraphExecuteOptions.

  #### Parameters

  - trail: AuditTrail

  #### Returns (event: { type: string; readonly [key: string]: unknown }) => void

  #### Example

      const trail = createAuditTrail();
      await executeGraph(graph, inputs, { onEvent: createGraphAuditBridge(trail) });

  - Defined in packages/nexus-agents/src/security/audit-trail.ts:316