New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@openrng/auto

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openrng/auto

Auto-instrument AI SDK calls to emit VEO-2 objects. One line, zero code changes.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

@openrng/auto

Auto-instrument AI SDK calls to emit VEO-2 objects. One line, zero code changes.

Install

npm install @openrng/auto @openrng/core

Quick Start

import OpenAI from 'openai';
import { auto } from '@openrng/auto';

// Wrap your existing client — one line
const client = auto(new OpenAI());

// Use exactly as before — VEOs are emitted automatically
const response = await client.chat.completions.create({
  model: 'gpt-4o',
  messages: [{ role: 'user', content: 'What is the capital of France?' }],
});
// response is unchanged — same OpenAI response object
// but a VEO-2 record was created in the background

With Anthropic

import Anthropic from '@anthropic-ai/sdk';
import { auto } from '@openrng/auto';

const client = auto(new Anthropic());

const message = await client.messages.create({
  model: 'claude-4-sonnet',
  messages: [{ role: 'user', content: 'Hello' }],
});

With Signing

import { auto } from '@openrng/auto';
import { generateSigningKeys } from '@openrng/core';

const keys = generateSigningKeys();
const client = auto(new OpenAI(), {
  privateKey: keys.privateKey,
  provider: 'my-service',
});
// Every VEO is now Ed25519-signed and independently verifiable

Accessing VEOs

import { auto, MemoryStore } from '@openrng/auto';

const store = new MemoryStore();
const client = auto(new OpenAI(), { store });

await client.chat.completions.create({ ... });

// Get all recorded VEOs
const veos = store.list();
console.log(veos[0].execution?.model_id); // 'gpt-4o'
console.log(veos[0].execution?.cost);     // { total_tokens: 150 }

Callback on Every VEO

const client = auto(new OpenAI(), {
  onVEO: (veo) => {
    console.log('AI call recorded:', veo.object_id);
    // Send to your observability pipeline, database, etc.
  },
});

What Gets Captured

Every instrumented call produces a VEO with:

FieldSource
execution.prompt_hashSHA-256 of the prompt/messages
execution.output_hashSHA-256 of the response
execution.model_idModel from the request
execution.latency_msMeasured response time
execution.costToken usage from response
execution.tool_callsTool/function calls if any
confidence.score700 (success) or 100 (error)
lifecycle.state'created' or 'signed'

Instrumented Methods

SDKMethods
OpenAIchat.completions.create, completions.create, embeddings.create, images.generate
Anthropicmessages.create
Genericcreate, generate, complete

Safety Guarantees

  • Never breaks your API calls — VEO emission errors are caught and logged, never thrown
  • No SDK dependency — works with any client object via ES Proxy
  • Zero performance impact — VEO creation happens after the API call returns
PackagePurpose
@openrng/coreTypes, schema, signing, validation
@openrng/autoAuto-instrumentation (this package)

License

MIT — OpenRNG

Keywords

openrng

FAQs

Package last updated on 01 Aug 2026

Related posts