Quickstart
Wrap your AI client once. Every call is then hashed, signed and anchored as a tamper-evident log entry, without blocking your application.
Requirements
- TypeScript: Node.js 18 or later
- Python: Python 3.11 or later
Installation
TypeScript
npm install @sarek/ai-accountabilityYour first monitored call
monitor() wraps your existing client and detects the provider automatically.
The original client is never modified, and the AI response is returned
unchanged and immediately. Prompts and completions are hashed locally with
SHA3-256; the raw text never leaves your process.
OpenAI
TypeScript
import OpenAI from 'openai'
import { AiLogger } from '@sarek/ai-accountability'
const sarek = await AiLogger.init()
let openai = new OpenAI()
openai = sarek.monitor(openai)
await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Approve loan #4821?' }]
})Fourteen providers are supported. Most are detected automatically; clients that are wire-compatible with OpenAI take a provider hint. See the SDK references for the full table.
What gets logged
Each call produces one signed log entry in
ai-accountability/logs/<agent>.jsonl and one proof file in
ai-accountability/proofs/<agent>/. The entry contains hashes, token counts,
latency, model and finish reason. It never contains the prompt or the
completion.