xLineage: AI Agent Tool-Use Chain of Custody
HMAC-chained audit trail for AI agent tool calls. Every tool invocation, its parameters, and results are DID-signed and cryptographically linked.
The Problem
AI agents use dozens of external tools, but there is no verifiable record of which tools were called, with what parameters, or what results were returned.
Tool-use agents can call APIs, query databases, execute code, and modify systems. Without a chain-of-custody log, there is no way to reconstruct what an agent did, why, or whether it was authorized.
Standard logging is insufficient because logs can be tampered with. A compromised agent can delete or modify its own log entries to cover its tracks.
The Old Way: Tamperable Logs
The PRIVATE.ME Solution
xLineage creates an HMAC-chained, DID-signed record of every tool invocation. Each entry is cryptographically linked to the previous, making tampering detectable.
Every tool call generates a signed entry: tool name, parameters (hashed if sensitive), result hash, timestamp, and the calling agent's DID. Entries are HMAC-SHA256-chained.
Threshold authorization can gate sensitive tools — require K-of-N approval before the agent can execute high-risk operations like database writes or payment calls.
The New Way: Tamper-Evident Chain
Solution Architecture
xLineage provides an append-only tool-use audit trail with HMAC chaining, DID signatures, and optional threshold gates for sensitive operations.
- audit.ts (214 LOC) — HMAC-chained audit trail generation and integrity verification
- tracking.ts — Tool call event logging with DID signatures and parameter hashing
- verification.ts — Chain integrity verification and tamper detection
- reconstruction.ts — Event replay and forensic reconstruction from chained logs
Pipeline Architecture
Core Modules
Real-World Use Cases
Tamper-evident log of every tool an agent calls, with parameters and results.
AuditRequire multi-party approval before agents can use sensitive tools.
ThresholdIrrefutable record of agent actions for regulatory compliance.
ComplianceReconstruct exactly what a compromised agent did and when.
ForensicsDeveloper Experience
import { auditChain, verifyChain } from '@private.me/xlineage'; // Log tool call with DID signature const result = await auditChain({ lineageId: 'agent-session-abc', actionType: 'tool:database.query', actorDid: agent.did, dataHash: hashParams(queryParams) }); // Verify chain integrity before forensic reconstruction const verification = await verifyChain('agent-session-abc'); if (!verification.ok) { console.error('Chain tampered!', verification.error); }
import { gateToolCall } from '@private.me/xlineage'; // Require 2-of-3 approval for payment API calls const gateResult = await gateToolCall({ toolName: 'stripe.createCharge', threshold: 2, totalShares: 3, approverDids: [did1, did2, did3], paramsHash: hashParams(chargeData) }); if (gateResult.ok) { // Execute payment only after threshold approval await executeCharge(); await auditChain({ /* log execution */ }); }
API Reference
Security Properties
| Property | Mechanism | Guarantee |
|---|---|---|
| Integrity | HMAC-SHA256 chain | ✓ Tamper-evident |
| Attribution | DID signatures | ✓ Non-repudiation |
| Access control | Threshold gates | ✓ K-of-N for sensitive tools |
| Privacy | Parameter hashing | ✓ Sensitive params hidden |
Test Coverage
xLineage ships with comprehensive test coverage across 4 test files:
- audit.test.ts (23 tests) — Chain generation, HMAC linking, tamper detection
- verification.test.ts (23 tests) — Integrity verification, DID signature validation, chain break diagnostics
- reconstruction.test.ts (19 tests) — Event replay, filtered playback, forensic reconstruction
- tracking.test.ts (6 tests) — Tool call logging, parameter hashing, DID attribution
Verifiable Data Protection
Every operation in this ACI produces a verifiable audit trail via xProve. HMAC-chained integrity proofs let auditors confirm that data was split, stored, and reconstructed correctly — without accessing the data itself.
Read the xProve white paper →
Ready to deploy xLineage?
Talk to Sol, our AI sales engineer, or book a live demo with our team.
Deployment Options
SaaS Recommended
Fully managed infrastructure. Call our REST API, we handle scaling, updates, and operations.
- Zero infrastructure setup
- Automatic updates
- 99.9% uptime SLA
- Enterprise SLA available
SDK Integration
Embed directly in your application. Runs in your codebase with full programmatic control.
npm install @private.me/xlineage- TypeScript/JavaScript SDK
- Full source access
- Enterprise support available
On-Premise Upon Request
Enterprise CLI for compliance, air-gap, or data residency requirements.
- Complete data sovereignty
- Air-gap capable deployment
- Custom SLA + dedicated support
- Professional services included
Enterprise On-Premise Deployment
While xLineage is primarily delivered as SaaS or SDK, we build dedicated on-premise infrastructure for customers with:
- Regulatory mandates — HIPAA, SOX, FedRAMP, CMMC requiring self-hosted processing
- Air-gapped environments — SCIF, classified networks, offline operations
- Data residency requirements — EU GDPR, China data laws, government mandates
- Custom integration needs — Embed in proprietary platforms, specialized workflows
Includes: Enterprise CLI, Docker/Kubernetes orchestration, RBAC, audit logging, and dedicated support.