Daemon
Run the optional Fuze daemon to add cross-run pattern detection, org-wide budget enforcement, kill switches, and persistent hash-chained audit storage.
Starting the daemon
The daemon listens on a Unix Domain Socket (or Windows named pipe) and exposes an HTTP API for the dashboard and external integrations.
What the daemon adds
| Capability | SDK only | SDK + Daemon |
|---|---|---|
| Per-run budget | Yes | Yes |
| Org-wide daily budget | No | Yes |
| Per-agent daily budget | No | Yes |
| Loop detection | Per-run | Per-run + cross-run patterns |
| Trace storage | JSONL file | SQLite with hash-chained audit log |
| Kill switch | No | Yes, via API or dashboard |
| Compensation/rollback | In-process only | Persistent + API-triggered |
| Alerts | No | Webhooks + dashboard WebSocket |
| Pattern analysis | No | Repeated failures, cost spikes, reliability drops |
Architecture
The SDK communicates with the daemon over a Unix Domain Socket (Linux/macOS) or named pipe (Windows). The daemon stores all audit data in SQLite with SHA-256 hash chains for tamper detection.
There is no embedded web dashboard. The REST API at :7821 is for direct queries, custom dashboards, or automation. For a full web UI, use Cloud mode (set FUZE_API_KEY).
Configuration
On Windows, use a named pipe:
Tool config cache
The daemon maintains a local config cache (tool_config_cache table in audit.db). When the SDK sends a register_tools message, the daemon stores default configs for any tool not already in the cache. The SDK reads tool configs synchronously from the cache on every guard() call, zero network latency on the hot path.
Hybrid mode
If FUZE_API_KEY is set in the daemon process environment, the daemon runs an additional background sync loop every 30 seconds that:
- Pulls tool configs from
api.fuze-ai.tech/v1/tools/config→ writes to local cache - Pushes buffered telemetry to the cloud API
This lets you run a local daemon (data stored on-prem) while still getting the cloud dashboard for visibility. The SDK talks only to the daemon, it never calls the cloud API directly in daemon mode.
API endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/health | Daemon liveness check |
GET | /api/runs | Paginated run list with filters |
GET | /api/runs/:id | Single run with steps and events |
POST | /api/runs/:id/kill | Kill an active run |
GET | /api/runs/:id/compensation | Compensation records for a run |
POST | /api/runs/:id/rollback | Trigger manual rollback |
GET | /api/budget | Org and per-agent spend |
GET | /api/agents/:id/health | Agent reliability stats |
GET | /api/compliance/report/:id | EU AI Act incident report |
WS | /ws | Live alerts stream |
Audit integrity
Every record in the SQLite database is hash-chained using SHA-256. The daemon maintains four independent chains:
- Runs, immutable fields hashed at insertion
- Steps, every tool call recorded and chained
- Guard events, loop detections, budget blocks, kills
- Compensation records, rollback actions and outcomes
Verify chain integrity:
The verifyHashChain() method checks all four chains and reports the first broken record if tampering is detected.
Data retention
The daemon automatically purges data older than retention_days. Purging cascades across all related tables:
- Runs
- Steps
- Guard events
- Compensation records
- Idempotency keys
This ensures no orphaned records remain after purge.
Resource management
The daemon caps in-memory ended runs at 1,000 entries (FIFO eviction) to prevent unbounded memory growth during long-running deployments. Active runs are always retained.