What it does
This example demonstrates how to use the Grantex audit trail as a rich data source:
- Set up two agents with different scopes and generate grant tokens
- Generate audit entries — a mix of success, failure, and blocked statuses across agents
- Display full audit timeline — formatted table with status icons, agent names, and timestamps
- Filter by agent — show entries for each agent separately
- Filter by action — show only specific actions (e.g.
email:send) with metadata
- Compute metrics — success rate, failure rate, entries per agent, top actions by frequency
- Verify hash chain integrity — walk the cryptographic chain to confirm tamper evidence
Prerequisites
- Node.js 18+
- Docker (Docker Desktop or Docker Engine with Compose)
Run
Start the local Grantex stack from the repository root:
In a separate terminal, run the example:
Expected output
Environment variables
Source code
The full source is in examples/audit-dashboard/src/index.ts.Last modified on March 30, 2026