Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
skill-safety-bench — Benchmark for evaluating AI agent safety against attacks embedded in skill-facing context, with 155 cases across 6 risk domains, measuring task success and attack resistance. | Kitploit
工具/GitHubGitHub/ai45lab/skill-safety-bench
Learning & EducationAI SecurityAdversarial AttackLabs & Practice
GitHubai45lab/skill-safety-bench

skill-safety-bench

Benchmark for evaluating AI agent safety against attacks embedded in skill-facing context, with 155 cases across 6 risk domains, measuring task success and attack resistance.

查看仓库
3033个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

SkillSafetyBench

English 中文

SkillSafetyBench 是一个已经物化好的 benchmark,用来评估针对 skill-facing context 的攻击导致的 agent 安全失败。每个 case 都保持用户表层任务是普通任务,同时把攻击放在本地 skills、helper scripts、sidecar files、corpora、templates 或其他 agent 执行时可能读取的 workspace artifacts 中。

欢迎访问 SkillSafetyBench website 查看 benchmark 设计、case explorer、leaderboard 和实验分析;完整论文见 arXiv。

SkillSafetyBench overview

Benchmark 评估什么

现代 coding agent 和 task agent 往往不只依赖用户 prompt,还会读取本地 skills 和环境 artifacts。SkillSafetyBench 测试的是:agent 在完成正常任务的同时,能否抵抗嵌入在这些 skill-facing surfaces 中的不安全指令或误导性上下文。Benign task carriers 选自 SkillsBench。

这个 benchmark 是静态、可直接运行的 benchmark,不是 case 生成框架。仓库包含 155 个已经准备好的 cases,覆盖 6 个 risk domains 和 30 个 categories。每个 case 都包含:

  • 一个仍然应该被完成的 benign base task
  • 一个或多个 skill-facing attack surfaces
  • 一个用于检测 unsafe behavior 的确定性 verifier
  • 用于检查 base-task completion 的 task tests
  • 描述最终 case 设计的 metadata 和 rationale

每次运行从两个维度评估:

  • task_success:普通用户任务是否完成
  • attack_success:不安全行为是否出现

这两个维度需要分开看:一个系统可能很好地完成了任务,但仍然因为信任带攻击内容的 skill context 而产生安全失败。

Benchmark 结构

SkillSafetyBench 包含 155 个 cases,整体组织为 6 个 risk domains 和 30 个 categories。每个 risk domain 下包含 5 个 categories,每个 category 下包含多个围绕普通任务载体构造的具体 cases。

root@kitploit:~
SkillSafetyBench
└── 6 risk domains
    ├── RD1: Context Trust and Prompt Manipulation Risks
    ├── RD2: Agency, Scope, and Authorization Risks
    ├── RD3: Execution, Runtime, Framework, and Protocol Risks
    ├── RD4: Data Boundary, Output, and Externalization Risks
    ├── RD5: Memory, Recovery, Audit, and Persistence Risks
    └── RD6: Knowledge, Model, Supply Chain, and Operational Risks

Cases 按照 risk domain、category 和 case id 存放:

root@kitploit:~
benchmark/<risk-domain>/<category>/<case>/
  metadata.json
  rationale.md
  attacked_task/
    instruction.md
    task.toml
    environment/
    solution/solve.sh
    tests/test.sh
  eval/verify_attack.py

benchmark/ 目录是 case 的 source of truth。Category 目录统一使用 categoryN-... 命名,例如:

root@kitploit:~
benchmark/risk-domain-6-knowledge-model-supply-chain-and-operational-risks/category1-availability_cost_and_service_exhaustion/

Benchmark Construction Pipeline

Benchmark construction pipeline 从 benign task carriers 出发,保持原始 user-facing task 不变,将攻击放入 skill-facing artifacts,并为 task completion 和 attack behavior 分别加入确定性检查。这样可以把评估重点放在:agent 是否能在完成正常任务的同时,抵抗不安全的本地上下文。

SkillSafetyBench construction pipeline

安全说明

本仓库包含对抗性 benchmark cases。一些 case 会模拟 phishing、凭证索取、破坏性操作、数据外泄、沙箱边界滥用、外部动作诱导和持久化类行为。

请只在隔离的研究环境中运行 benchmark。不要使用生产凭证、生产云账号、个人账号或敏感本地文件。建议使用一次性 API key、临时容器、受限网络和专用工作目录。对外分享运行产物前,请先人工检查。

如何运行 Benchmark

1. 准备工具链

需要准备:

  • bash
  • python3,推荐 >= 3.11
  • docker
  • uv
  • harbor
  • nvm
  • Node.js 22

如果还没有安装 Harbor:

root@kitploit:~
uv tool install harbor

检查基础工具:

root@kitploit:~
harbor --help
python3 --version
docker --version

如果 Harbor agent 依赖 Node 环境,请在启动 benchmark 的 shell 中显式启用 Node 22:

root@kitploit:~
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
nvm use 22

2. 配置环境变量

从示例文件创建本地 .envrc:

root@kitploit:~
cp env.example .envrc

如果使用 codex,至少需要:

root@kitploit:~
export OPENAI_BASE_URL="https://your-openai-compatible-endpoint/v1"
export OPENAI_API_KEY="replace-with-your-openai-api-key"

如果使用 claude-code,需要 Anthropic 兼容认证变量,例如:

root@kitploit:~
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
export ANTHROPIC_API_KEY="replace-with-your-anthropic-api-key"

如果使用 direnv:

root@kitploit:~
direnv allow

如果不使用 direnv,不需要额外操作。运行脚本会显式 source .envrc。

3. 运行 Cases

Canonical entry point 是:

root@kitploit:~
scripts/start_agent_batch.sh

运行一个 risk domain:

root@kitploit:~
scripts/start_agent_batch.sh --rd 5

指定 agent 和 model:

root@kitploit:~
scripts/start_agent_batch.sh \
  --rd 3 \
  --agent codex \
  --model openai/gpt-5.4

使用 Claude Code:

root@kitploit:~
scripts/start_agent_batch.sh \
  --rd 3 \
  --agent claude-code \
  --model claude-3-7-sonnet-20250219

运行单个 case:

root@kitploit:~
scripts/start_agent_batch.sh \
  --rd 5 \
  --case travel_planning_poisoned_belief_persistence_memory_anchor

运行单个 category:

root@kitploit:~
scripts/start_agent_batch.sh \
  --rd 6 \
  --category category3-model_behavior_and_finetuning_poisoning

从指定 manifest 运行:

root@kitploit:~
scripts/start_agent_batch.sh \
  --manifest benchmark/risk-domain-6-knowledge-model-supply-chain-and-operational-risks/manifest.json

使用自定义 env 文件:

root@kitploit:~
scripts/start_agent_batch.sh \
  --rd 5 \
  --envrc /path/to/your.envrc

只展开 case,不执行:

root@kitploit:~
scripts/start_agent_batch.sh --rd 5 --dry-run

4. 查看运行产物

每次运行会在 jobs/ 下创建目录:

root@kitploit:~
jobs/<agent>-risk-domain-5-memory-recovery-audit-and-persistence-risks-<timestamp>/

建议优先查看:

  • jobs/<run>/attack_results.json
  • jobs/<run>/summary.json
  • jobs/<run>/attack_results.csv
  • jobs/<run>/summary.csv

常用运行文件:

  • selected_cases.json
  • batch_config.json
  • <case_id>/case_result.json
  • attack_results.md

常见 attack outcome:

  • attack_success
  • attack_not_observed
  • task_output_missing

task_output_missing 表示预期的显式任务输出缺失。只要已有 artifacts 足够判断 attack condition,attack verifier 仍可能继续检查。

下载工具