npm package: @frlabs/axiom-sdk
Description: Verifiable inference provenance for autonomous AI agents
Author: Fr Labs
Latest version: 0.1.0

# AXIOM Protocol SDK

The official TypeScript/React SDK for the AXIOM Protocol — verifiable inference provenance for autonomous AI agents.

[![npm version](https://img.shields.io/npm/v/@axiom-protocol/sdk.svg)](https://npmjs.org/package/@axiom-protocol/sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

AXIOM Protocol provides an immutable, cryptographically verifiable audit trail for consequential AI decisions. If your agent is trading capital, making medical suggestions, or executing enterprise tasks, logs aren't enough. You need verifiable proof. 

## Why AXIOM?
* **Undeniable Proof** — Cryptographic receipts prove *exactly* what input went to what model at what time.
* **Instant Regulatory Compliance** — Meet EU AI Act Article 12 and SEC 17a-4 requirements out of the box with auto-generated compliance reports.
* **Zero Drop-in Friction** — Wraps existing OpenAI/Anthropic/Google clients without changing your application code.

## Architecture Highlights
```text
[Your LLM Call] ──► [Auto-hash] ──► [Ed25519 Signed] ──► [TEE Attested] ──► [Base Mainnet Anchored]
```

## Install

```bash
npm install @axiom-protocol/sdk
```

## 5-Minute Integration

Drop-in wrap your existing `OpenAI` client in exactly 2 lines. Every completion is automatically hashed, signed, and anchored to an EVM blockchain for permanent verifiability.

```typescript
import OpenAI from 'openai';
import { wrapOpenAI, AxiomClient } from '@axiom-protocol/sdk';

// 1. Initialize AXIOM Client
const axiom = new AxiomClient({ apiKey: process.env.AXIOM_API_KEY });

// 2. Wrap your OpenAI client
const openai = wrapOpenAI(new OpenAI(), axiom, { 
   modelId: 'gpt-4o',
   agentId: 'autonomous-trading-bot-v1' 
});

// 3. Make routine calls as usual!
const response = await openai.chat.completions.create({
  model: 'gpt-4o',
  messages: [{ role: 'user', content: 'Execute trade for 100 ETH' }]
});

// AXIOM intercepts and signs the transaction transparently.
// Access the receipt metadata directly on the response:
const receiptId = (response as any)._axiomReceipt.receipt_id;
console.log(`Verified Inference: https://axiom.sh/receipt/${receiptId}`);
```

## Offline / Machine Verification

```bash
axiom verify receipt-uuid-1234
```

```text
■ AXIOM RECEIPT VERIFICATION
  ID: receipt-uuid-1234
  
  ✓ VALID RECEIPT

  ✓ ECDSA Signature
  ✓ Append-only Hash Chain
  ✓ Model Registry Identity
  ✓ TEE Attestation Hardware Binding
  ✓ L1 EVM Anchored
  ○ ZK Inference Circuit
```

## Compliance Table

| Regulation | Requirement | AXIOM Coverage |
| --- | --- | --- |
| **EU AI Act** | Article 12: Auto-logging of consequential systems. | `AxiomReceipt` captures and hashes exact inference pairs globally. |
| **SEC 17a-4(f)(2)** | Broker-dealer WORM audit trail logging. | EVM Mainnet Anchor provides immutable timestamping. |
| **NIST AI RMF** | Measure 2.5: Identifiability over time mapping. | `ModelRegistry` mapping ensures model substitution detection. |

## Self-Hosting

You can run your own entire Attestation Bridge for fully sovereign zero-trust routing.

```bash
git clone https://github.com/axiom-protocol/axiom
cd axiom/infra
docker compose up -d
```

## Documentation

* [Quickstart](https://axiom.sh/docs/quickstart)
* [API Reference](https://axiom.sh/docs/api-reference)
* [Core Concepts](https://axiom.sh/docs/concepts)
* [Examples](https://github.com/axiom-protocol/axiom/tree/main/examples)

## Contributing

The AXIOM Core SDK is currently in early-access alpha. We are taking active PRs for missing LLM provider middleware and offline verification adapters for additional smart contract networks. 

## License
MIT