Traceability Record
Every agent action that passes through the Trust Fabric pipeline produces an 8-field traceability record (STD-03.3). These records are stored in thetrustFabricEvents table and are available for ClickHouse ingestion for long-term analytics.
The record captures the full context of what happened, who acted, what the governance pipeline decided, what it cost, and how to verify it:
| Field | Type | Description |
|---|---|---|
traceId | string | Unique identifier for this trace. Format: {runId}:{stepId}:{timestamp}. Used for distributed trace correlation. |
decisionRecord | object | The governance pipeline outcome: which gates ran, whether each passed, the final disposition, and the policy version in effect. |
governancePacket | object | Agent identity and governance metadata: agent ID, NHI credential ID, autonomy rung, owning team, risk tier, and fiduciary flag. |
executionTrace | object | Execution details: tool calls made, intermediate outputs, and timing (start/end timestamps). |
costAttribution | object | Token count, compute cost, virtual key used, and budget tier. Links to the token spend attribution chain. |
toolCallLog | ToolCallEntry[] | Detailed log of every tool invocation: endpoint, method, parameters, response code, latency. |
explanationPacket | object (optional) | When present: the agent’s reasoning and confidence indicators for the action taken. |
auditRecord | object | Tamper-evidence fields: content hash, timestamp, environment ID, and schema version. |
Decision Record Structure
ThedecisionRecord captures every gate evaluation in the pipeline:
Governance Packet Structure
ThegovernancePacket ties every trace back to its agent identity and organizational context:
The traceability record is emitted at dispatch time via
emitTraceEvent with the governance decision already known. Cost and tool call data are backfilled after execution completes via enrichTraceEvent, which patches the original record by traceId lookup.Governance Decision Audit
EveryGovernanceDecision produced by the governance engine is persisted as an audit event in the auditEvents table with category governance and event type governance_decision. This happens on every dispatch attempt — whether the decision is allow, block, or hold.
The persisted decision record includes:
| Field | Description |
|---|---|
disposition | pass, block, or hold |
dispatchType | step, delegated_run, or launch |
agentId | Agent that was evaluated |
gatewayId | Target gateway |
gates | Full array of gate outcomes (pass/fail/skip per gate) |
blockedBy | When blocked: gate name, error code, message, retryability |
heldBy | When held: policy name, policy ID, trigger |
budgetSnapshot | Agent and envelope spend at decision time |
trustSnapshot | Agent trust level vs gateway minimum |
durationMs | Evaluation time in milliseconds |
actorIdentity | Structured identity envelope (actor type, actor ID) |
Dual Write Path
Governance decisions are written to two tables in parallel:auditEvents— The general-purpose append-only audit log. Queryable by run, category, resource, actor type, and time range. Supports full-text search on event names.governanceAuditLog— A governance-specific audit table with dedicated indexes for run, agent, and disposition queries. Includes theadminOverrideflag andauthoritySourcefield.
Admin Bypass Logging
When an administrator overrides governance controls (e.g., bypassing a budget gate or approving a blocked dispatch), the bypass is captured in theadminAuditLog table. This runs in the same transaction as the mutation — not fire-and-forget — guaranteeing that no admin bypass can occur without a corresponding audit record.
Each admin bypass record captures:
| Field | Type | Description |
|---|---|---|
timestamp | number | When the bypass occurred |
adminUserId | string | Identity subject of the admin |
adminEmail | string (optional) | Email address of the admin |
action | string | The permission key that was bypassed |
permissionKey | string | The specific permission (e.g., ops:manage, governance:override) |
scopeType | string (optional) | Scope category (e.g., gateway, agent, workflow) |
scopeTargetId | string (optional) | The specific resource affected |
adminAuditLog table is indexed by admin user, action, and timestamp — enabling queries like “show all overrides by this admin in the last 30 days” or “show all budget bypasses across the platform.”
Distributed Tracing
Every governance evaluation generates atraceId with the format {runId}:{stepId}:{timestamp}. This identifier propagates through the full execution chain:
- Governance evaluation —
traceIdis generated when the governance pipeline starts - Trace event emission — The initial
trustFabricEventsrecord is written with thetraceId - Dispatch to gateway — The
traceIdaccompanies the dispatch payload through Bridge - Post-execution enrichment — When execution completes,
enrichTraceEventuses thetraceIdto locate and patch the original record with cost and tool call data
trustFabricEvents table is indexed on traceId (by_trace), agentId + timestamp (by_agent), and disposition + timestamp (by_disposition). This supports three primary query patterns:
- Point lookup: Find the complete trace for a specific dispatch by
traceId - Agent timeline: Reconstruct a single agent’s full activity history ordered by time
- Disposition analysis: Find all blocked or held dispatches across the platform
Retention Policy
Audit events follow a TTL-based retention policy enforced by daily cron jobs:| Table | Retention | Cron Schedule |
|---|---|---|
auditEvents | 365 days | Daily at 03:15 UTC |
trustFabricEvents | Unlimited (ClickHouse ingestion) | — |
adminAuditLog | Unlimited | — |
governanceAuditLog | Unlimited | — |
tokenEvents | 90 days | Daily at 03:00 UTC |
auditEvents uses cursor-based pagination to avoid re-scanning previously cleaned records. Each run deletes up to 2,000 records with a 20-second time limit, storing the cursor in the retentionPolicies table for the next run.
Compliance Surface
The audit trail is designed to answer the questions that compliance reviews, incident investigations, and regulatory audits require:What happened?
Every governance decision, approval, policy change, and agent action is recorded with full context in the append-only audit log.
Who authorized it?
Actor identity envelopes on every event. Admin bypasses captured transactionally with user ID and permission key.
What constraints applied?
Gate outcomes, policy evaluations, budget snapshots, trust levels, scope constraints, and role context — all captured at decision time.
Can it be verified?
Append-only guarantees (no update/delete mutations), content hashes in traceability records, and dual-write paths for cross-referencing.
Audit Event Categories
TheauditEvents table uses a category system to organize events across domains:
| Category | Events Captured |
|---|---|
governance | Governance decisions, policy CRUD, approval policy changes, position creation |
safety_gate | Individual gate evaluation outcomes |
workflow | Approval creation, approval resolution, reminder delivery |
lifecycle | Agent stage transitions (requested, approved, rejected) |
agent_exec | Agent execution events |
routing | Gateway routing decisions |
evaluation | Evaluation run events |
Query Capabilities
Audit events support multiple query patterns through dedicated indexes:- By run (
by_run) — All events for a specific workflow run - By time range (
by_time) — Events within a time window, with optional open-ended queries for live tailing - By category (
by_category) — Events filtered by domain category within a time range - By resource (
by_resource) — Events for a specific resource type and ID - By actor type (
by_actorType) — Events filtered by actor type (human, agent, system, delegated_agent) - Full-text search (
search_audit) — Text search across event names, filterable by category and actor type

