Explore our comprehensive resources on behavioral AI monitoring, compliance frameworks, and policy templates.
Start your compliance journey with HAIEC. Free assessment, automated evidence, audit-ready documentation.
Explore compliance frameworks:
Developer tools & integrations:
How AI AppSec uses Semgrep to detect prompt injection sinks, tool abuse, and AI-specific vulnerabilities in source code. 122 detectors, 79 security checks, with code examples.
Learn what AI vendor public security disclosures entail and how they impact AI security and compliance professionals.
Discover the essential questions to include in an AI vendor security questionnaire to ensure robust security and compliance in AI procurement.
A CTO I worked with last quarter had a problem she could not solve: she did not know how many AI models her company was using. The engineering team had integrated OpenAI's API in three different services. The data science team had an Anthropic Claude integration in a notebook. Someone in marketing had built a prototype with a local Llama model. The finance team was paying bills from three different AI vendors and could not map the spend to the projects.
She asked engineering for an inventory. They said it would take two weeks to audit all the code. The audit found 11 different integration points across 6 repositories. Two of them were calling deprecated models. One was calling a model that had been retired last month and was silently failing.
AI Inventory solves this with instrumentation. You install a wrapper package (@haiec/openai or @haiec/anthropic), change one import statement, and every SDK call is automatically tracked. Model name, token count, cost, timestamp, and calling service are captured and fed into an inventory dashboard. No code audit required.
There are three ways to instrument an SDK:
Monkey-patching: replace methods on the SDK's prototype at runtime. Fragile. Breaks when the SDK updates. Hard to debug.
Proxy/wrapper: wrap the SDK client in a proxy object that intercepts calls. More stable than monkey-patching but adds a layer of indirection.
Subclassing: extend the SDK client class and override methods. Clean but requires the SDK to support subclassing.
HAIEC uses the wrapper pattern. @haiec/openai wraps the OpenAI client. @haiec/anthropic wraps the Anthropic client. You change one import:
// Before
import OpenAI from 'openai'
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
// After
import { OpenAI } from '@haiec/openai'
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
That is the only change. The wrapper exposes the same API as the official SDK. Your existing code continues to work without modification. The wrapper intercepts each call, captures usage metadata, and emits it to HAIEC AI Inventory.
Each SDK call captures:
| Field | Example | Source |
|---|---|---|
| Model | gpt-4o | SDK call parameter |
| Token count (input) | 1,247 | API response |
| Token count (output) | 832 | API response |
| Cost | $0.0124 | Calculated from model pricing |
| Timestamp | 2026-08-22T14:30:00Z | System clock |
| Calling service | api-gateway | Environment variable or config |
| Call duration | 1.2s | Measured |
| Status | success / error | API response |
The wrapper captures this data without sending the actual prompt or response content to HAIEC. Only metadata is transmitted. The prompt and response stay in your application.
The wrapper does not capture:
This is a deliberate privacy decision. HAIEC AI Inventory tracks what models you use and how much they cost. It does not need to see what you say to them or what they say back.
If you need content-level monitoring (for PII redaction, prompt injection detection, or output safety), use LLMVerify. AI Inventory is for usage tracking, not content verification.
Wraps the OpenAI SDK (requires version 4.0.0 or higher). Supports:
chat.completions.createembeddings.createimages.generateaudio.transcriptions.createaudio.translations.createInstall:
npm install @haiec/openai
Usage:
import { OpenAI } from '@haiec/openai'
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello' }],
})
// Usage automatically captured:
// { model: 'gpt-4o', inputTokens: 1, outputTokens: 1, cost: 0.00001, ... }
Wraps the Anthropic SDK (requires version 0.20.0 or higher). Supports:
messages.createmessages.streamInstall:
npm install @haiec/anthropic
Usage:
import { Anthropic } from '@haiec/anthropic'
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })
const response = await client.messages.create({
model: 'claude-3-5-sonnet-20241022',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello' }],
})
// Usage automatically captured:
// { model: 'claude-3-5-sonnet-20241022', inputTokens: 8, outputTokens: 12, cost: 0.0001, ... }
The wrapper pattern means your application code talks to the wrapper, not directly to the OpenAI or Anthropic API. The wrapper forwards the call to the real API and captures the response. The prompt and response pass through the wrapper but are not stored or transmitted to HAIEC.
If your organization has a data residency requirement (e.g., EU data must not leave the EU), the wrapper does not change where your data goes. The OpenAI API call still goes to OpenAI's servers. The Anthropic API call still goes to Anthropic's servers. The wrapper only adds metadata transmission to HAIEC's inventory service.
If you are in a regulated environment where you need to prove that prompt content is not being exfiltrated, the wrapper source code is open and auditable at github.com/subodhkc/haiec-sdk.
Not a security scanner. The wrappers track usage. They do not scan code, check tenant boundaries, or verify model output safety. For security scanning, use AI AppSec, MCP Tenant Isolation, and LLMVerify.
Not a content monitor. The wrappers do not capture or transmit prompt or response content. If you need content-level monitoring, use LLMVerify.
Not a billing replacement. The cost calculations are estimates based on published pricing. They may not match your actual invoice due to discounts, rate limits, or pricing changes. Use the inventory for spend visibility and anomaly detection, not for financial reconciliation.
AI Inventory is the instrumentation layer in the Developer Security family. It is not a scanner. It tells you what models you are using and how much they cost. The three scanners (AI AppSec, MCP Tenant Isolation, LLMVerify) tell you whether your AI applications are secure. ISAF Logger tells you what was used to train your models.
You need all of them for a complete picture: what you built, what it costs, whether it is secure, and what evidence you have for auditors.