# Hosted and self-hosted Source: https://docs.adrian.secureagentics.ai/hosted-vs-open-source Two ways to run Adrian's backend: hosted by Secure Agentics, or self-hosted from the open-source release. Adrian is available as a free hosted service managed by Secure Agentics, and as a self-hosted open-source release. Both share the same architecture and SDK integration. The hosted route is the quickest way to get started, and is free (forever) with a generous fair-use policy. The self-hosted route is for those that prefer to run stuff locally, or who need data sovereignty. ## Hosted Run by Secure Agentics on managed AWS infrastructure and server-grade GPUs. No setup beyond installing the SDK and pointing it at the hosted backend at wss\://adrian.secureagentics.ai/ws. Expected latency is roughly **100-600 ms per event classification**. Treat this as rough guidance. Actual latency depends on: * Region * Server load at the time * Size of the event being classified * Severity and complexity of the classification Latency was benchmarked using L4, L40S, and H100 GPUs. Other GPU classes have not yet been measured. Sub-60 ms latencies have been achieved in testing with optimisations that are not yet in production. Production rollout is planned and will reduce these numbers further. ## Self-hosted Self-hosted Adrian runs the Go backend, the Next.js dashboard, and a bundled Llama.cpp container serving Gemma 4 (E2B or E4B) entirely on your own infrastructure. Bring-up is a single `docker compose --profile llm up` after a one-shot bootstrap. See the [Backend reference](/reference/backend) for configuration and endpoints. Expected latency is roughly **\~500 ms per event classification** on Gemma 4 E4B running on an NVIDIA RTX 5070 Mobile. Treat this as rough guidance. Actual latency depends on: * GPU class (server-grade GPUs run faster; older or smaller-VRAM GPUs slower) * Model variant (Gemma 4 E2B is smaller and faster than E4B) * Server load at the time * Size of the event being classified * Severity and complexity of the classification # How it works Source: https://docs.adrian.secureagentics.ai/how-it-works Adrian's architecture, event flow, and operating modes. The diagram below shows Adrian's open-source architecture. The hosted version follows the same flow. ## Architecture ```mermaid theme={null} flowchart TD Agent[Agent Runtime] --> SDK[Adrian SDK] SDK --> Backend[Adrian Backend] Backend --> Classifier[Classifier Model] Classifier --> Verdict{"Verdict
"} Verdict --> Control[Control Plane] Verdict -.->|allow / block / human review| Agent ``` ## Flow The Adrian SDK wraps your agent runtime and captures activity (tool calls, outputs, side effects) and reasoning traces as the agent runs. Each event is shipped to the Adrian backend over a persistent websocket connection. The backend assembles context across the agent's session, sends the event to the classifier model, and returns a verdict. The verdict is routed back to the agent and to the control plane, where alerts surface and humans can intervene. The SDK can point at a hosted Adrian backend or a locally running open-source backend. See [Hosted vs Open Source](/hosted-vs-open-source) for the trade-offs. ## Detection engine Adrian's detection engine evaluates each event against a rule set focused on misaligned, malicious, and out-of-remit behaviour. The output is a classification verdict that the rest of the system uses to decide what happens next. ## Operating modes | Mode | Behaviour | When to use | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | **Audit** | Alert-only. Adrian reports security alerts but does not block agent actions. | Observability without changing agent behaviour; default for most deployments. | | **Human Review** | Adrian pauses potentially harmful actions until you (the human) approve or reject. | When you want a human in the loop for risky actions but don't want to fully automate blocking. | | **Block** | Adrian reviews every agent action prior to execution and automatically blocks actions deemed malicious, without human oversight. | High-stakes environments where the cost of an unsafe action outweighs the cost of latency. | Alerting thresholds and notification preferences are configurable per deployment. # Integrations Source: https://docs.adrian.secureagentics.ai/integrations Adrian connects to your agent framework and to the alerting channels you already use. ## Frameworks The framework integration attaches the Adrian SDK to your running agent and captures activity logs and reasoning traces. Set up starts in your [dashboard](https://app.adrian.secureagentics.ai), where you generate the API key the SDK uses. **Supported today** * **LangChain.** Wrap an existing LangChain agent with two lines of code via the Adrian SDK (Python). * **Anthropic SDK.** Calling `messages.create` directly, without a framework? The same Python SDK patches the Anthropic client. See the [Anthropic SDK](/reference/anthropic-sdk) reference. * **OpenAI.** Wrap your OpenAI client with the Adrian [TypeScript SDK](/reference/typescript-sdk) - one line, every Chat Completions call captured. * **Claude Code.** Integrates as a Claude Code plugin rather than the SDK - it hooks every tool call, classifies it, and enforces per your policy, with no code to write. See the [Claude Code plugin](/reference/claude-code) reference. **Coming next** We're exploring framework integrations including OpenClaw, OpenAI Agents SDK, and CrewAI. Tell us what you want next on our [Discord](https://discord.gg/6nmJ9k3u6). ## Alerting channels Adrian sends one-way alerts to the channels you choose, based on your configured thresholds. Approvals and human-in-the-loop interventions are handled through the dashboard only at launch. Channel setup, thresholds, and policies are all configured from your [dashboard](https://app.adrian.secureagentics.ai). **Supported today** * **Slack.** Connect from your dashboard, pick a channel, set your alert threshold. * **Discord.** Connect from your dashboard, pick a channel, set your alert threshold. **Coming next** WhatsApp, Microsoft Teams, PagerDuty, and others. We are also exploring dynamic two-way conversations / approvals / configurations with Adrian for deeper personalisation to your specific use case. Tell us what you want next on our [Discord](https://discord.gg/6nmJ9k3u6). # Introduction Source: https://docs.adrian.secureagentics.ai/introduction Adrian is a real-time security monitoring and control engine for AI agents that analyses agent activity logs (tool calls, actions, outputs) and reasoning traces to detect malicious, misaligned, or out-of-remit behaviour and optionally intervene in-flight. AI agents are moving from chat to autonomous action across real systems. Most people building with them have minimal visibility into what their agents are doing after they have been deployed, and even less control over what they are about to do. Adrian addresses this directly: * **Oversight.** What an agent has done, why, and what it is about to do next. * **Detection.** Malicious, misaligned, or out-of-remit actions, classified by severity. * **Control.** Pause or block specific actions, with optional human-in-the-loop approval. Install the Python SDK with just 2 lines of code, self-hosted or hosted backend options. ## Why Adrian is different Most agent monitoring stops at activity logs: tool calls, outputs, side effects. Adrian also analyses the agent's reasoning traces and thought process. Lab research by OpenAI and DeepMind found that combining behaviour and reasoning analysis boosts detection accuracy by around 35%, and Adrian is the first tool to put that into a deployable security control. You understand not just what decisions an agent made, but why, and what it is planning to do next. Similarly, most tools in this space are machine learning classifiers trained to spot patterns in their training data. Adrian takes a different approach: it uses world models that understand risk through reasoning. It correlates behaviours across a session, holds a working understanding of what the agent is meant to be doing, and assesses each new action against that. The thought process is closer to a human reviewer's than to pattern matching against examples it has seen before. ## When to use Adrian If your agent has write access to any system, takes actions on external services, or operates with any meaningful autonomy, you need runtime monitoring. If you are shipping a tool-less chatbot, you do not need this yet. If you are unsure, start in Audit mode (notify-only, no intervention) and let the events tell you. ## Quick look ```python theme={null} import adrian adrian.init(api_key="adr_live_...", ws_url="wss://adrian.secureagentics.ai/ws") # Your LangChain / LangGraph agent runs unchanged - every call is captured. # Calling the Anthropic SDK directly works the same way. ``` The example points `ws_url` 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. Wrap a LangChain agent with two lines of code and see your first detection. # Quickstart Source: https://docs.adrian.secureagentics.ai/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. Calling the Anthropic SDK directly instead of using a framework? The steps below are the same up to step 3. From there, follow the [Anthropic SDK](/reference/anthropic-sdk) reference. Go to [app.adrian.secureagentics.ai](https://app.adrian.secureagentics.ai) and create an account. 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. ```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. ``` ```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. 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. 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. 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