> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adrian.secureagentics.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Wrap a LangChain agent with Adrian and see your first event in the dashboard.

Wrap a LangChain agent with Adrian in two lines and watch events appear in your dashboard.

<Steps>
  <Step title="Sign up to Adrian">
    Go to [app.adrian.secureagentics.ai](https://app.adrian.secureagentics.ai) and create an account.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Install the Adrian SDK">
    ```sh theme={null}
    pip install adrian-sdk
    ```

    Requires Python 3.12+. Install the LangChain provider for your agent's model alongside it:

    ```sh theme={null}
    pip install langgraph langchain-openai   # or langchain-anthropic, etc.
    ```
  </Step>

  <Step title="Wrap your LangChain agent">
    ```python theme={null}
    import asyncio

    import adrian
    from langchain_openai import ChatOpenAI


    async def main():
        adrian.init(api_key="adr_live_...", ws_url="wss://adrian.secureagentics.ai/ws")

        # 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 `ws_url` above points at Adrian Cloud. The SDK's default is `ws://localhost:8080/ws` (a self-hosted backend), so set `ws_url=` or `ADRIAN_WS_URL` to `wss://adrian.secureagentics.ai/ws` for the hosted service.

    <Note>
      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.
    </Note>

    Set `OPENAI_API_KEY` in your environment alongside `ADRIAN_API_KEY` for the snippet above; `ChatOpenAI` reads it directly.
  </Step>

  <Step title="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](/reference/severity-codes) for what each M-code means.
  </Step>
</Steps>

That's it: your first agent event is in Adrian. See [How it works](/how-it-works) for what happens to it, or [Integrations](/integrations) to route alerts to Slack or Discord.

## Demo

<iframe width="100%" height="450" src="https://www.youtube.com/embed/THqmh1u75CE" title="Adrian demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />

## Watch the walkthrough

<iframe width="100%" height="450" src="https://www.youtube.com/embed/7vYjeGxY8to" title="Adrian quickstart walkthrough" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />
