@secureagentics/adrian-openai
v1.0.0
Published
OpenAI SDK instrumentation for Adrian security monitoring.
Maintainers
Readme
@secureagentics/adrian-openai
OpenAI SDK instrumentation for Adrian security monitoring. Wraps your OpenAI client so every call is captured by the core SDK and streamed to your backend.
Install
npm install @secureagentics/adrian-openai openaiUsage
Wrap your OpenAI client. init, adrian.openai(client), and shutdown bracket your normal OpenAI code; call sites stay unchanged:
import OpenAI from "openai";
import { adrian } from "@secureagentics/adrian-openai";
async function main() {
await adrian.init({ apiKey: "adr_local_..." });
// Wrap your existing OpenAI client; every call is captured.
const client = adrian.openai(new OpenAI());
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: "user", content: "Find the most underpriced recent IPOs and build an investment strategy" },
],
});
console.log(response.choices[0]?.message?.content);
await adrian.shutdown();
}
main();Requires the openai package (peer dependency >=4.0.0). The SDK defaults to ws://localhost:8080/ws; set wsUrl= if your self-hosted backend runs elsewhere.
Events appear in the dashboard within seconds, classified by severity.
Local development
To develop against a local build instead of the published package, point your consumer's package.json at the package directories with file: paths (relative to that file), then npm install:
"dependencies": {
"@secureagentics/adrian": "file:../Adrian/sdk/typescript/packages/core",
"@secureagentics/adrian-openai": "file:../Adrian/sdk/typescript/packages/openai",
"openai": ">=4.0.0"
}Both packages are linked because adrian-openai depends on adrian. The paths above assume your project is a sibling of the Adrian repo; adjust the ../ depth to match. Build first so dist/ exists, and rebuild after editing the SDK:
cd sdk/typescript && npm run buildFull documentation: Adrian TypeScript SDK
License
Apache-2.0
