Skip to content

Getting Started

company edited this page Jul 31, 2026 · 1 revision

快速开始

本页用于在本地开发环境启动 Attacker,并运行第一条不依赖外部 Target 的隔离评测。

环境要求

  • Python >=3.12,<3.13
  • uv
  • Git

安装

git clone https://github.com/juemimgcd/Attacker.git
cd Attacker
uv sync --locked --python 3.12
uv run alembic upgrade head

启动服务

uv run uvicorn main:app --reload

默认入口:

第一次评测

内置 stateful profile 不需要连接外部 Target:

curl -X POST http://127.0.0.1:8000/runs/stateful \
  -H "Content-Type: application/json" \
  -d '{"profile":"hardened","dataset_path":"samples/stateful/phase3.yaml"}'

可用 profile:

  • vulnerable:预置易受攻击行为;
  • hardened:预置加固行为;
  • regressed:预置安全回归行为。

拿到 run_id 后查询报告:

GET /runs/{run_id}/report.json
GET /runs/{run_id}/report.md

启用 API Key

复制 .env.example 为 .env,设置:

SECURITY__API_KEY=replace-with-a-long-random-secret

业务接口随后需要携带:

X-API-Key: replace-with-a-long-random-secret

/health、/docs 与 /openapi.json 保持公开。

下一步

Clone this wiki locally