Skip to main content
Wrap a LangChain agent with Adrian in two lines and watch events appear in your dashboard.
1

Sign up to Adrian

Go to app.adrian.secureagentics.ai and create an account.
2

Create an agent profile and API key

From the dashboard, create an agent profile (name, remit, and execution mode - Audit / Human Review / Block) and generate an API key bound to it. We operate a generous fair-use policy based on total tokens used across all keys on the account, viewable in the dashboard.
3

Install the Adrian SDK

pip install adrian-sdk
Requires Python 3.12+. Install the LangChain provider for your agent’s model alongside it:
pip install langgraph langchain-openai   # or langchain-anthropic, etc.
4

Wrap your LangChain agent

import asyncio

import adrian
from langchain_openai import ChatOpenAI


async def main():
    adrian.init(api_key="adr_live_...")

    # Your LangChain / LangGraph code runs normally - every call is captured.
    llm = ChatOpenAI(model="gpt-4o")
    response = await llm.ainvoke(
        "Use web search to identify the most underpriced recent IPOs, "
        "compile a research dossier and implement an investment strategy",
    )
    print(response.content)

    adrian.shutdown()


asyncio.run(main())
The SDK defaults to the hosted Adrian backend. Override via ws_url= or ADRIAN_WS_URL to point at a self-hosted backend.
Use the async pattern (asyncio.run + await llm.ainvoke) rather than sync llm.invoke - the WebSocket transport runs on the asyncio loop, and sync llm.invoke returns before the loop has a chance to flush events.
Set OPENAI_API_KEY in your environment alongside ADRIAN_API_KEY for the snippet above; ChatOpenAI reads it directly.
5

See your agent populate in Events

Run your agent. Within seconds, events appear in the dashboard’s event feed with their classification verdicts and severity codes. See Severity codes for what each M-code means.
That’s it: your first agent event is in Adrian. See How it works for what happens to it, or Integrations to route alerts to Slack or Discord.

Demo

Watch the walkthrough