@secureagentics/adrian) attaches to your agent’s LLM calls, captures activity and reasoning, and streams them to the Adrian backend over WebSocket. The core package owns the event pipeline - event pairing, PII redaction, JSONL logging, WebSocket streaming, and policy verdicts. Provider packages build on it; the OpenAI integration wraps your OpenAI client so every call is captured with no change to your call sites.
Install
OpenAI integration
@secureagentics/adrian-openai instruments the official openai client (Chat Completions). init, adrian.openai(client), and shutdown bracket your normal OpenAI code - call sites stay unchanged.
openai package as a peer dependency (>=4.0.0). Events appear in your dashboard within seconds, classified by severity.
The SDK defaults to
ws://localhost:8080/ws. For Adrian Cloud, pass wsUrl: "wss://adrian.secureagentics.ai/ws" to init (or set ADRIAN_WS_URL).Configuration
Explicitinit() options take precedence over environment variables.
Policy and BLOCK mode
When the dashboard policy is in BLOCK or HITL mode, the SDK waits for backend verdicts on the tool calls an LLM turn proposes. In BLOCK mode, if no verdict arrives withinblockTimeout seconds, the SDK fails open and allows execution (matching the Python SDK). See Severity codes for the M-codes and How it works for the operating modes.
What’s captured
- Activity events. LLM calls and tool executions, paired (start + end) and streamed to the backend.
- Reasoning traces. Captured where the model exposes them.
Manual instrumentation
For a framework without a provider package, attach the handler fromadrian.getHandler() and pair each LLM or tool start and end by a shared runId (handleChatModelStart / handleLLMEnd, handleToolStart / handleToolEnd). Shared capture helpers are exposed at @secureagentics/adrian/capture.
Known limitations
- Fail-open on timeout. In BLOCK mode a verdict timeout allows execution; a dashboard-configurable failure policy is planned.
- OpenAI surface. The OpenAI package instruments the
openaiclient’s Chat Completions calls.

