Quickstart
Install
Section titled “Install”npm install @brivora/crypto @brivora/verifyWrap an AI call with governance
Section titled “Wrap an AI call with governance”import { verify } from '@brivora/verify';
// Your existing AI call -- any provider, any modelconst aiCall = () => fetch('https://api.openai.com/v1/chat/completions', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'gpt-4', messages: [{ role: 'user', content: 'Analyze this loan application' }], }),}).then(r => r.json());
// Wrap it with EU AI Act governanceconst result = await verify.govern(aiCall, { governance: 'eu-ai-act', audit: true,});Inspect the result
Section titled “Inspect the result”console.log(result.output); // The AI response (unchanged)console.log(result.valid); // true -- all governance rules passedconsole.log(result.score); // 0.0-1.0 fidelity scoreconsole.log(result.report); // Detailed compliance reportconsole.log(result.proof); // The cryptographic proofVerify the proof independently
Section titled “Verify the proof independently”const verified = await verify.check(result.proof);console.log(verified.valid); // trueconsole.log(verified.governance); // 'eu-ai-act'console.log(verified.timestamp); // ISO timestampThe proof is a PQC-signed Merkle root. It can be stored, transmitted, published on-chain, or handed to a regulator. Anyone can verify it without trusting you, Brivora, or any intermediary.