@vintcessun: 原来agent安全可以不止盯工具调用,还能实时读它的推理过程。Adrian在agent执行动作前,既看行为日志又把reasoning chain过一遍,两个维度交叉检测。效果?DeepMind论文说联合分析比纯行为检查准确率提升35%。它…
摘要
Adrian 是一个开源 AI 代理运行时安全监控引擎,通过联合分析代理的行为日志和推理链进行异常检测,比纯行为检查准确率提升 35%,支持 LangChain 两行 SDK 接入。
查看缓存全文
缓存时间: 2026/06/10 23:58
原来agent安全可以不止盯工具调用,还能实时读它的推理过程。Adrian在agent执行动作前,既看行为日志又把reasoning chain过一遍,两个维度交叉检测。效果?DeepMind论文说联合分析比纯行为检查准确率提升35%。它不靠匹配训练集里的攻击模式,而是用一个轻量世界模型理解agent“本该干什么”,看到可疑上下文就直接拦或告警。开源、自托管、两行SDK接入LangChain。
secureagentics/Adrian
Source: https://github.com/secureagentics/Adrian
Open-source runtime security monitoring and control for AI agents.
Adrian is an open-source, AARM-aligned runtime security monitoring and control engine for AI agents. It analyses both agent activity logs (tool calls, actions, outputs) and reasoning traces to detect malicious, misaligned, or out-of-remit behaviour, and optionally intervene in-flight. Python SDK with a two-line install to LangChain agents.
Documentation • Dashboard • Discord • LinkedIn
https://github.com/user-attachments/assets/96974b9d-4862-41ac-a499-ef5cfe76e16a
Quickstart
Want the stupidly simple, 60-second hands-off install? Feed your coding agent (Claude, Codex, Cursor, etc.) this file: GET_STARTED_AI_GUIDE.md. It will walk you through the installation process - video guide here. Always review instructions manually
The next fastest way to try Adrian is the managed dashboard at app.adrian.secureagentics.ai. Sign-up takes a minute and there is nothing to install beyond the SDK. To run Adrian on your own infrastructure instead, jump to Self-hosting below.
-
Sign up at app.adrian.secureagentics.ai and generate an API key.
-
Configure Adrian for your agent and your preferences (remit of your agent, audit vs block mode, alerting channels, accepted behaviours vs known-risks).
-
Install the SDK:
pip install adrian-sdk -
Install the LangChain provider for your agent’s model (the SDK auto-instruments LangChain / LangGraph; pick whichever provider matches your model):
pip install langgraph langchain-openai # or langchain-anthropic, etc.Last verified with
langchain-core==1.3.3,langgraph==1.1.2,langchain-openai==1.2.1(2026-05-08). -
Wrap your LangChain agent. Two lines of Adrian (
init+shutdown) bracket your normal LangChain / LangGraph code:import asyncio import adrian from langchain_openai import ChatOpenAI async def main(): adrian.init(api_key="adr_live_...") llm = ChatOpenAI(model="gpt-4o") response = await llm.ainvoke( "Find the most underpriced recent IPOs and build an investment strategy", ) print(response.content) adrian.shutdown() asyncio.run(main())Full runnable version (with env-var checks) at
examples/quickstart.py. -
Run your agent. Events appear in the dashboard within seconds, classified by severity.
Full guide: Quickstart.
Self-hosting
Adrian supports entirely offline, data sovereign deployments using just a handful of docker commands. This repository ships everything needed to run the entire Adrian stack on a single host: the Go backend (WebSocket + dashboard API + AI engine), the Next.js dashboard, the Python SDK, and a Llama.cpp container that serves a local Gemma model. No managed cloud, no telemetry leaving the box.
Hardware support: Tested on NVIDIA GPUs with Gemma 4 (E2B / E4B) which is the model the bootstrap picker downloads by default. CPU-only is technically possible but will be slow on real workloads with those sized models.
Prerequisites
- A host with Docker + Docker Compose v2.
- An NVIDIA GPU with recent CUDA driver and the NVIDIA Container Toolkit installed (for the bundled Llama.cpp classifier). ~10 GB free disk for the model.
Bring-up
-
Clone:
git clone https://github.com/secureagentics/Adrian cd Adrian -
Run bootstrap. Creates
data/adrian.db, applies migrations, generates a random admin password, and writes.env. With no--ggufflag, the bootstrap interactively offers to download the recommended on-device classifier (Gemma 4 E4B, ~5 GB, or E2B ~3 GB) into./models/.# Default: interactive picker downloads Gemma 4 E4B / E2B docker compose --profile setup run --rm setup bootstrap # Already have a GGUF under ./models/? Pass it by name docker compose --profile setup run --rm setup bootstrap \ --gguf my-model.gguf -
Start the stack.
docker compose --profile llm up -d -
Open the dashboard. Browse to
http://localhost:3000. Sign in withadmin@localhostplus the password the bootstrap printed; you’ll be prompted to set a new one. Create an SDK API key and configure Adrian to monitor your specific agent from Settings → Agents → New key. -
Wrap your agent. The SDK lives in-tree under
sdk/. Install it into a fresh.venvvia the bundled Make target (uses uv):make sdk-install source .venv/bin/activateInstall the LangChain provider for your agent’s model into the same venv:
uv pip install langgraph langchain-openai # or your chosen langchain providerLast verified with
langchain-core==1.3.3,langgraph==1.1.2,langchain-openai==1.2.1(2026-05-08).Use the same
adrian.initsnippet as in the Quickstart above. The SDK defaults tows://localhost:8080/ws, so a self-hosted setup needs nothing more than the API key - drop thews_url=line.
To reset the admin password, change the model and much more check out the dedicated Docs site.
Why Adrian is different
Most agent monitoring stops at activity logs: APIs, MCP, DB interactions, tool calls, etc. Adrian enhances this by also analysing the agent’s reasoning: understanding why it took an action, under what context, and what it is planning on doing next. Research by OpenAI and DeepMind found that combining behaviour and reasoning analysis like this boosts detection accuracy by around 35% and is 4x more likely to catch nuanced attacks. Adrian is the first tool to put that into a deployable security control, and it is free, forever.
Furthermore, most tools in this space are lightweight machine learning classifiers trained to spot patterns which match their training data (usually labelled prompt injection datasets). Adrian takes a different approach: it uses world models that understand risk through reasoning like a human does. 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 detection logic is closer to a human reviewer’s than to pattern matching against examples it has been trained to spot. For example, if your e-commerce agent starts resetting user passwords that isn’t going to appear in any training dataset, but this is a risk you should be flagging. This is where you get the meaningful security uplift that allows you to use agentic AI with confidence, and it’s exactly why we made Adrian.
Architecture
flowchart TD
Agent[Agent runtime] --> SDK[Adrian SDK]
SDK --> Backend[Adrian backend]
Backend --> Classifier[Classifier model]
Classifier --> Verdict{Verdict}
Verdict --> Control[Control plane]
Verdict -.->|"Alert /<br>Human Review /<br>Block"| Agent
Integrations
| At launch | On roadmap | |
|---|---|---|
| Frameworks |
|
|
| Alerting |
|
|
Full list: Integrations.
Contributing
See CONTRIBUTING.md for the full guide. In short: sign the CLA, branch off main, follow the PR template, and use British English / no em-dashes in prose.
See CONTRIBUTORS.md for the list of people who have shaped Adrian, and how to add yourself.
Licence
Adrian is released under the Apache 2.0 licence. New source files should carry the SPDX header from LICENSE_HEADER.txt.
Community
Featured on
相似文章
本文系统梳理了AI Agent架构与工程实践,涵盖控制流、上下文工程、工具设计、记忆、多Agent组织、评测、追踪和安全,基于OpenClaw实现展开,强调Harness(测试验证基础设施)对系统稳定性的关键作用。
本文系统梳理了AI Agent架构与工程实践,涵盖控制流、上下文工程、工具设计、记忆、多Agent组织、评测、追踪和安全,基于OpenClaw实现展开,强调Harness(测试验证基础设施)对系统稳定性的关键作用。
@knoYee_: https://x.com/knoYee_/status/2062780637677752366
作者复盘了使用多Agent协作三个月的经验,总结出五个主要痛点(如Agent间矛盾、忽略边界条件、自我审查失效、合并决策困难、压缩执行后暴露更难问题)和两个心得(只读审查Agent价值高、Agent矛盾暴露需求模糊),强调了人类在AI协作中的核心决策作用。
@Xudong07452910: 这篇论文很适合所有重度使用 Claude Code、Codex 或者其他AI Agent 的人看。 它研究的不是 Agent 在 benchmark 上怎么失败,而是一个更真实的问题: 在真实开发里,AI coding agent 到底是…
This paper analyzes 20,574 real-world coding-agent sessions to identify how AI agents misalign with developer intent, finding that constraint violations and inaccurate self-reporting are the most common failure modes, imposing trust and effort costs rather than irreversible damage.
@vintcessun: 今晚翻到一个学习路线项目,重新理解了Agent该从哪开始学。以前总觉得Agent就是堆工具和框架,但它的核心是那个“观察-思考-执行”循环,以及harness工程对权限、状态、回溯的组织。它把学习拆成从0构建最小Agent loop到最终…
一个名为Agent-Learning-Hub的开源学习路线项目,将AI Agent学习拆分为8个阶段,从构建最小Agent loop到生产部署,提供可执行的todo list和推荐资源,由Datawhale社区成员维护。
@teach_fireworks: AI Coding 现在开始进入一个很有意思的阶段。 过去大家讨论最多的是模型能力、上下文长度、Agent Loop、Tool Use、自动化编程,但真正把 Agent 长时间放进真实开发环境之后,很多团队发现问题已经不只是“能不能生成代…
介绍开源工具 re_gent,它为 AI 编程 Agent 提供运行时级别的版本控制和可观测性基础设施,解决 Agent 长时间运行后的代码溯源与审计问题。