Newshot

Show HN:AgentLeak——面向多智能体 LLM 系统的开源隐私测试工具

Translation(model translation, not the source's own text)

仓库文件导航

题图
题图

AgentLeak

多智能体 LLM 系统中隐私泄露的基准测试。

本仓库是 IEEE Access 论文的配套代码:AgentLeak: A Benchmark for Internal-Channel Privacy Leakage in Multi-Agent LLM Systems。

预印本(v3):https://arxiv.org/abs/2602.11510v3

IEEE Access (2026):https://doi.org/10.1109/ACCESS.2026.3704541

在你自己的智能体轨迹上使用 AgentLeak

可安装的隐私测试工具见 yagobski/agentleak 和 agentleak.org。

该实用工具提供 Python SDK、CLI、本地 Web UI 和 CI 检查,用于检测通过工具调用、共享内存、智能体间消息、日志、生成文件和最终输出泄露的敏感数据。核心轨迹分析在本地运行,不依赖 LLM;可选的在线智能体运行使用你配置的端点。

用 Python 3.10+ 试跑一个内置的合成示例:


        pip install agentleak
agentleak run --scenario healthcare_patient_summary
      

该示例展示了一个干净的最终答案,同时伴随内部渠道的泄露。它仅用于演示,并非生产环境的泄露率估计。请按照工具快速入门分析你自己的轨迹。

本仓库仍然是研究基准与复现代码。其实验、渠道定义和检测流程应与实用工具的确定性分析和内置示例分开引用。

论文评估范围

论文(v3)评估了医疗、金融、法律和企业领域的 1,000 个场景,涵盖五个模型共 4,979 条经过验证的执行轨迹。AgentLeak 对七个渠道进行埋点:C1 最终输出、C2 智能体间消息、C3 工具输入、C4 工具输出、C5 共享内存、C6 日志和 C7 制品。大规模分析覆盖 C1/C2/C5;C3/C6 在样本上评估;C4/C7 在集成研究中考察。因此这些渠道的实证覆盖范围并不相同。经过验证的轨迹数量也记录在 paper_stats.json 中。

单独的未对账仓库摘要(5 个模型共 5,694 条轨迹)

下表与结论作为单独的仓库摘要,从现有 README 中保留下来。其所述的 5,694 条轨迹基础和报告的比例尚未与论文的 4,979 条验证轨迹对齐。不要将它们解读为论文的验证结果,也不要将两个分母合并;关于论文报告的结果和评估范围,请查阅论文。

模型C1(输出)C2(内部)H1(审计缺口)总泄露
Claude-3.5-Sonnet8.2%53.9%45.7%55.2%
GPT-4o17.2%76.8%59.6%77.6%
GPT-4o-mini41.2%75.3%34.2%76.3%
Llama-3.3-70B26.9%67.8%41.3%89.9%
Mistral-Large47.5%96.2%48.7%99.3%
平均值28.2%74.0%45.9%79.7%

来自未对账仓库摘要的结论

  • 内部渠道的泄露是外部渠道的 2.6 倍(74.0% 对 28.2%)
  • 仅审计输出的方式会漏掉 45.9% 的违规
  • Claude 3.5 Sonnet 悖论:C1 泄露最低(8.2%),但内部/外部比率为 6.6 倍——是所有模型中最高的
  • 发现 7(工具泄露):工具输入(C3)和系统日志(C6)表现出极高的泄露率(在 Claude 3.5 上最高达 85%),即使最终智能体输出(C1)已被完全净化。
  • 在所有测试的 5 个模型中,均成立 C2 > C1 的模式

范围

  • 1,000 个场景(医疗、金融、法律、企业)
  • 7 个渠道:C1 输出、C2 智能体间、C3-C4 工具、C5 内存、C6 日志、C7 制品
  • 32 个攻击类别,6 个族
  • SDK:CrewAI、LangChain、AutoGPT、MetaGPT

复现

主基准(C1、C2、C5)

复现主要结果(输出、内部、内存):


        cd benchmarks/ieee_repro
python benchmark.py --n 1000 --traces --model openai/gpt-4o
      

高级工具与日志基准(C3、C6)

Show HN:AgentLeak——面向多智能体 LLM 系统的开源隐私测试

针对“Secondary Channel”泄漏,即敏感数据被发送到外部工具或被转储到日志中。


        cd benchmarks/ieee_repro
# Run for a specific model (e.g., Claude 3.5)
python benchmark_tools.py --n 100 --model anthropic/claude-3.5-sonnet

# Or run the automated multi-model test suite
./run_tools_benchmark.sh
      

结果保存在 benchmarks/ieee_repro/results/tools/。

结构

  • agentleak/: 核心框架 SDK
  • agentleak_data/: 包含 1000 个场景的数据集
  • benchmarks/ieee_repro/: 用于复现论文发现的脚本,包括 Finding 7(Tools & Logs)。
  • benchmarks/showcase/: 真实的 CrewAI 集成演示,展示 SDK 的实际运行。
  • paper/: IEEE Access 论文的 LaTeX 源码

设置


        git clone https://github.com/Privatris/AgentLeak
cd AgentLeak
pip install -e .
pytest tests/ -v
      

用法


        from agentleak import AgentLeakTester, DetectionMode

tester = AgentLeakTester(mode=DetectionMode.HYBRID)
result = tester.check(
    vault={"ssn": "123-45-6789"},
    output="The SSN is 123-45-6789",
    channel="C1"
)
print(f"Leak: {result.leaked}, Confidence: {result.confidence}")
      

        python -m agentleak run --quick --dry-run
python -m agentleak run --full
      

复现


        cd benchmarks/ieee_repro
python benchmark.py --n 100 --traces --model openai/gpt-4o-mini
      

追踪记录位于 benchmarks/ieee_repro/results/traces/。

引用


        @article{el2026agentleak,
  title   = {AgentLeak: A Benchmark for Internal-Channel Privacy Leakage in Multi-Agent LLM Systems},
  author  = {El Yagoubi, Faouzi and Badu-Marfo, Godwin and Al Mallah, Ranwa},
  journal = {IEEE Access},
  year    = {2026},
  doi     = {10.1109/ACCESS.2026.3704541},
  url     = {https://doi.org/10.1109/ACCESS.2026.3704541}
}
      

许可证

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗