Coff0xc/LLM-Security-Assessment-Framework

FORGEDAN — An Evolutionary Framework for LLM Security Assessment | 6 Attack Methods | 18 Model Adapters | Vue 3 Dashboard | Web Security Scanning

Python

24

27 commits

updated Jun 3, 2026

See the code

README

FORGEDAN

面向报告交付的 LLM 安全评估框架

Report-first LLM Security Assessment Framework

Python 3.9+ CI License: MIT Paper Vue 3 Report Pack

可复现套件 | 证据化报告包 | QA 交接回执 | 可校验归档

Reproducible suites | Evidence-rich report packs | QA receipts | Verifiable archives

中文版 · English Version · 使用截图 / Screenshots · 中文独立版 · 样例报告包 / Sample Report Pack


中文版

本 README 采用 全量中文 + 全量 English 的双语格式。上半部分是完整中文版,下半部分是完整英文版;两种语言覆盖相同的项目定位、截图、快速开始、报告工作流、制品清单、验证门禁、开发命令、路线图、安全说明和许可证。

如果只需要中文交付或内部转发,可以使用 README.zh-CN.md。主 README 保持中英完整镜像,避免两个语言版本事实漂移。

项目定位

FORGEDAN 基于论文 FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models,但当前项目主线已经从单纯的越狱算法演示扩展为 LLM 安全评估报告交付框架。

本仓库仍保留进化式越狱攻击、模型适配器、WebScan、REST API 和 Vue dashboard。当前更重要的目标是生成可审计、可复现、可交接的报告包,包括 YAML 套件、确定性扫描器与评分器、证据矩阵、风险登记、覆盖率摘要、JSON Schema 合约、QA 回执、脱敏发布包,以及复制或分享后仍可重新校验的 ZIP 归档。

这不是商业化安全平台,而是报告交付项目。核心价值是报告证据质量:输入可追溯、输出可复现、制品可校验、交付可签收、归档可复核。

交付速览

主题说明
项目目标生成可复现的 LLM 安全评估报告包。
推荐路径preflight -> suite run -> validate-report -> verify-bundle -> qa-report --strict-handoff -> archive -> verify-archive。
报告证据Markdown/HTML 报告、JSON/JSONL trace、CSV 证据矩阵、case matrix、覆盖率摘要、风险登记、发布说明、QA 回执和 manifest。
完整性使用 Schema、SHA256/大小、sidecar 绑定、脱敏检查、跨制品一致性和 ZIP 归档校验保护交付质量。
样例包ready-for-handoff 样例报告包。

使用截图

下面截图来自 examples/ready-for-handoff-suite.yml 生成并提交到仓库的样例报告包。完整样例见 docs/sample-report-pack/ready-for-handoff。

报告包总览

报告包总览

QA 交接回执

QA 交接回执

归档校验

归档校验

快速开始

前置要求

项目要求
PythonPython >= 3.9
Git克隆仓库和管理本地变更需要 Git
Node.jsNode.js >= 18,仅运行 Vue dashboard 时需要

安装

git clone https://github.com/Coff0xc/LLM-Security-Assessment-Framework.git
cd LLM-Security-Assessment-Framework

# 后端最小安装
pip install -e .

# Web dashboard 和 WebScan 依赖
pip install -e ".[web]"

# 全量 provider、web、monitoring 和 dev 依赖
pip install -e ".[all]"

# 前端
cd frontend
npm install

生成可交付报告包

这是当前最推荐的 smoke path:先做无模型预检,再生成报告包,随后校验制品、生成 QA 回执、打包 ZIP,并在交付后重新校验归档。

python -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-ready
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zip
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

安装 console script 后,也可以使用 forgedan suite ... 形式运行。

运行零配置攻击 Demo

python -m forgedan.cli run --quick -g "test prompt" -m mock:test

运行 Web Dashboard

python -m forgedan.cli web
cd frontend
npm run dev

后端默认在 :5000,前端默认在 :5173。

报告工作流

步骤说明
1. 定义范围在 suite YAML 中定义 cases、导入证据源、报告元数据、策略门禁、覆盖率要求、验收准则、评审决策和风险登记默认值。
2. 运行预检使用 suite preflight 在消耗模型预算前检查元数据、scorer、交接准则、来源证明和确定性 replay 设置。
3. 生成报告使用 suite run 写出原始与脱敏 JSON/JSONL、Markdown/HTML 报告、CSV 矩阵、覆盖率、风险登记、发布说明和 manifest。
4. 本地验证使用 validate-report 与 verify-bundle 校验 schema、hash、摘要计数、脱敏制品、Markdown/HTML sidecar 和跨制品身份。
5. 准备交接使用 qa-report --strict-handoff 生成 QA 回执,记录 checklist、blocker、验收准则、Source Inventory、schema 校验和评审证据。
6. 归档复核使用 archive 和 verify-archive 生成单文件 ZIP,并在复制或分享后重新校验。

报告包制品

制品受众用途
suite-report.md / suite-report.html授权评审人叙事报告,包含范围、方法、发现、覆盖率、风险、用量和限制。
suite-result.json / suite-cases.jsonl评估团队原始机器可读结果和逐 case trace,便于审计 replay。
suite-evidence.csv评审人finding 证据表,包含 taxonomy、confidence、severity rationale、OWASP LLM 映射和建议。
suite-case-matrix.csv评审人case 级结果、风险、用量、scorer、metadata 和覆盖率矩阵。
suite-risk-register.json / suite-risk-register.csv修复负责人风险跟踪表,包含 owner、status、due date、severity rationale 和 evidence fingerprint。
suite-coverage.json / suite-coverage.csv评审人按 case category、policy domain、taxonomy category、OWASP LLM category 汇总覆盖率。
suite-config.json评估团队归一化 suite 输入快照,便于审计复放。
suite-preflight.json / suite-preflight.md评估团队模型执行前的 readiness audit。
suite-release-notes.md评审人简短交接说明,包含风险、验收、Source Inventory、reviewer decision、制品指针和归档命令。
脱敏 report/result/cases外部评审人低敏发布包,隐藏原始 prompt、response 和 evidence。
suite-manifest.json评估团队制品完整性清单,包含大小、SHA256、schema references、敏感度、受众标签和验收状态。
suite-qa-receipt.json / suite-qa-receipt.md评估负责人交接回执,覆盖 manifest、schema、hash、跨制品一致性、预检、验收、risk owner 和限制项。
handoff.zip交付接收方可在复制或分享后用 verify-archive 重新校验的单文件交付包。

JSON Schema 与验证

报告制品 schema 位于 schemas/,用于机器校验、交付验收和 CI 回归保护。

Schema用途
suite-result.schema.jsonsuite 运行结果。
suite-config.schema.json归一化 suite 配置快照。
suite-manifest.schema.json报告包制品 manifest。
suite-comparison.schema.json历史对比结果。
suite-comparison-manifest.schema.json对比报告 manifest。
suite-qa-receipt.schema.jsonQA 交接回执。
suite-preflight.schema.json运行前预检结果。
suite-risk-register.schema.json风险登记。
suite-coverage.schema.json覆盖率摘要。
finding-taxonomy.schema.jsonfinding taxonomy。

validate-report 不只检查 JSON Schema,还会复算 Source Inventory、usage cost、risk register totals、coverage totals、comparison regression counts、QA receipt readiness、manifest binding 和 Markdown/HTML sidecar 摘要,尽量避免手工修改后出现机器数据与人工报告不一致。

常用验证命令:

python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

核心能力

能力说明
Report suitesYAML suite、内联/导入用例、响应缓存、确定性种子、策略门禁、运行前预检。
Report artifactsMarkdown/HTML 报告、执行摘要、证据 CSV、case matrix、风险登记、覆盖率摘要、发布说明、bundle index。
Evidence integrityJSON Schema、制品 manifest、SHA256/大小校验、跨制品一致性校验、脱敏发布泄漏检查。
Handoff QAQA receipt JSON/Markdown、验收准则、评审决策、owner/due date、严格交接门禁。
Assessment coveragePrompt Injection、越狱角色扮演、系统提示泄漏、敏感信息/PII、Agent/MCP/工具策略风险、模型制品信号。
Baseline engineFORGEDAN、AutoDAN、PAIR、GCG、Crescendo、TAP、模型适配器、WebScan、CLI、REST API、Vue dashboard。

常用 CLI

场景命令说明
运行 suitepython -m forgedan.cli suite run examples/smoke-suite.yml从 YAML suite 生成报告输出。
按 run ID 输出python -m forgedan.cli suite run examples/smoke-suite.yml --run-id-dir使用 run ID 隔离输出目录。
运行预检python -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-ready在消耗模型预算前检查报告准备度。
校验报告制品python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json校验 schema 和语义一致性。
验证目录包python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json校验 manifest、hash、sidecar 和跨制品一致性。
生成 QA 回执python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff生成严格交接回执。
创建 ZIPpython -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zip创建单文件交付包。
验证 ZIPpython -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip复制或分享后复核归档。
对比结果python -m forgedan.cli suite compare base.json current.json --output comparison.json --fail-on-regression生成历史对比并可在回归时失败。
导出 taxonomypython -m forgedan.cli suite taxonomy --json导出 finding taxonomy。
导出 schemaspython -m forgedan.cli suite schemas --json导出报告制品 schema references。
攻击 demopython -m forgedan.cli run --quick -g "test prompt" -m mock:test使用 mock 模型运行零配置 demo。
Web 后端python -m forgedan.cli web启动 API/web 后端。

攻击方法

方法类型说明论文
FORGEDANEvolutionary多层级 mutation,结合语义适应度和双 judge。arXiv:2511.13548
AutoDANEvolutionary面向隐蔽越狱 prompt 的层次化遗传算法。ICLR 2024
PAIRLLM-iterative通过 attacker-target LLM 迭代完成黑盒越狱。NeurIPS 2024
GCGGradient-free基于贪心坐标搜索的 adversarial suffix 生成。ICML 2023
CrescendoMulti-turn从低风险内容逐步升级到高风险请求的多轮攻击。USENIX Security 2025
TAPTree searchTree-of-thought 攻击搜索,带剪枝和多 LLM 协作。NeurIPS 2024

模型适配器

Provider模型范围配置示例
OpenAIGPT-3.5, GPT-4, GPT-4oopenai:gpt-4
AnthropicClaude 3 Opus/Sonnet/Haikuanthropic:claude-3-opus
GoogleGemini Pro, Gemini Visiongemini:gemini-pro
DeepSeekDeepSeek Chat/Coderdeepseek:deepseek-chat
Zhipu / 智谱GLM-4, GLM-3zhipu:glm-4
Qwen / 通义千问Qwen Max/Plusqwen:qwen-max
Moonshot / 月之暗面Kimimoonshot:moonshot-v1-8k
Yi / 零一万物Yi Large/Mediumyi:yi-large
Baichuan / 百川Baichuan 4/3baichuan:baichuan-4
Ollama本地 Ollama 模型ollama:llama2
vLLM本地 vLLM 服务vllm:model-name
HuggingFaceHuggingFace 模型huggingface:model-name
Mock本地测试,无需 API keymock:test-model

WebScan 模式

模式说明适用场景
URL crawler异步抓取页面标题、表单、链接和脚本。收集目标站点中的攻击素材。
Security scanner检查 XSS、SQLi、路径穿越、安全 Header 和 HTTP Method。传统 Web 漏洞评估。
LLM interaction test使用网页内容触发间接 Prompt Injection,并结合进化式优化。评估 LLM 处理网页内容时的安全性。

架构概览

forgedan/
├── suite.py              # 报告套件运行器、制品、验证器、QA、归档复核
├── scanners.py           # 确定性 prompt、response、tool、model-artifact 扫描器
├── scorers.py            # 可复用确定性 suite scorer
├── finding_taxonomy.py   # finding IDs、优先级、OWASP LLM 映射
├── attacks/              # 攻击算法与注册表
├── adapters/             # 托管、本地、中文、vision、vLLM、HuggingFace、mock adapters
├── api/                  # Flask Blueprint REST API
├── webscan/              # crawler、web scanner、LLM interaction tester
├── engine.py             # 进化算法引擎
├── mutator.py            # mutation strategies 和 MAB 选择
├── fitness.py            # 语义适应度
└── judge.py              # 双 judge 机制

schemas/                  # 报告制品 JSON Schema 合约
examples/                 # 可运行 suite 和 fixture
docs/                     # 同类项目扫描、lint roadmap、样例报告包
tests/                    # pytest coverage
frontend/                 # Vue 3 SPA dashboard

forgedan/suite.py 是报告交付主入口,负责 suite 运行、报告制品写入、schema/manifest 校验、QA 回执和归档复核。schemas/ 约束报告制品,examples/ 保存可运行 fixture,docs/ 保存样例报告包和项目说明,frontend/ 保存 Vue 3 仪表盘。

API 端点

后端使用 Flask Blueprint 暴露 REST API,适合自动化脚本、演示环境和内部评估流程接入。

POST   /api/attacks/run
GET    /api/attacks/{id}/status
GET    /api/attacks/{id}/result
POST   /api/attacks/{id}/stop

GET    /api/models/providers
POST   /api/models/test

POST   /api/webscan/crawl
POST   /api/webscan/scan
POST   /api/webscan/llm-test

POST   /api/reports/generate
GET    /api/reports/{id}
GET    /api/reports/{id}/download

GET    /api/datasets
POST   /api/datasets/upload

GET    /api/health
GET    /api/metrics

文档导航

文档用途
docs/sample-report-pack/ready-for-handoff/已提交的 mock 样例报告包,包含 QA 回执和已校验 ZIP。
docs/llm-security-landscape.md同类项目扫描、能力差距和优化优先级。
docs/lint-roadmap.md当前 CI lint 门禁、历史债务统计和更严格质量门禁推进路径。
docs/repository-about.md仓库侧栏描述和 topic 建议。
schemas/报告制品 JSON Schema 合约。
examples/可运行 suite、case fixture、MCP manifest、模型制品 fixture。

开发与验证

pip install -e ".[dev]"

# 本地全量 pytest
python -m pytest -q -W error::DeprecationWarning -p no:cacheprovider --basetemp .tmp-test

# CI 报告包门禁
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

# flake8 选定门禁
python -m flake8 forgedan/ --select=E9,F63,F7,F82,E722,F401,F841 --show-source --statistics

# 格式化门禁
python -m black --check forgedan tests

# 前端构建
cd frontend
npm install
npm run build

当前路线图

  • 进化算法引擎与 mutation strategy
  • 6 种攻击方法:FORGEDAN、AutoDAN、PAIR、GCG、Crescendo、TAP
  • 托管、中文、本地、vLLM、HuggingFace、vision 和 mock adapter
  • YAML suite runner、导入 case、自定义 scorer、响应缓存、Source Inventory 和 policy gates
  • Prompt Injection、越狱框架、系统提示泄漏、敏感信息/PII、Agent/MCP/工具策略风险和模型制品扫描
  • Markdown/HTML 报告、脱敏发布包、证据矩阵、case matrix、风险登记、覆盖率摘要、发布说明和 bundle index
  • JSON Schema 合约、语义校验、manifest verification、QA receipt 和 archive verification
  • 已提交 ready-for-handoff 样例报告包和截图
  • CI 覆盖 tests、报告包校验、严格 QA 交接、归档校验、selected flake8、Black 和 frontend build
  • 增加更多真实 Agent/MCP manifest fixture,校准默认 trust-score policy
  • 仅在能提升报告证据质量时加入 HarmBench/JailbreakBench 示例
  • 当报告范围需要时扩展更深的 model serialization 分析

GitHub About 建议

仓库侧栏描述建议:

面向报告交付的 LLM 安全评估框架,用于生成可复现红队套件、证据包、QA 回执、Schema 合约和可校验归档。

建议 Topics:

llm-security, ai-red-team, prompt-injection, jailbreak, owasp-llm, mcp-security, agent-security, security-reporting, risk-register, audit-evidence, json-schema, pytest, python

引用

如果在研究中使用 FORGEDAN,请引用:

@article{cheng2025forgedan,
  title={FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models},
  author={Cheng, Siyang and Liu, Gaotian and Mei, Rui and Wang, Yilin and Zhang, Kejia and Wei, Kaishuo and Yu, Yuqi and Wen, Weiping and Wu, Xiaojie and Liu, Junhua},
  journal={arXiv preprint arXiv:2511.13548},
  year={2025}
}

贡献

欢迎提交改进。修改报告行为时,请同步维护报告制品、Schema、测试和文档。通用贡献流程见 CONTRIBUTING.md。

安全说明

本项目仅用于授权安全测试、研究复现和报告交付。原始 prompt、response、trace、cache 和 evidence 可能包含敏感数据,应按评估范围和交接规则管理。

许可证

本项目使用 MIT License,详见 LICENSE。


English Version

This README uses a complete Chinese + complete English bilingual structure. The first half is the full Chinese version; the second half is the full English version. Both versions cover the same positioning, screenshots, quick start, report workflow, artifact list, validation gates, development commands, roadmap, security notes, and license.

Use README.zh-CN.md for Chinese-only handoff or internal sharing. The main README keeps the Chinese and English versions mirrored so project facts do not drift.

Project Positioning

FORGEDAN is based on the paper FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models, but the current project direction has expanded from a jailbreak algorithm demo into a report-delivery framework for LLM security assessments.

The repository still contains evolutionary jailbreak attacks, model adapters, WebScan utilities, a REST API, and a Vue dashboard. Its current priority is to produce auditable, reproducible, handoff-ready report packs: YAML suites, deterministic scanners and scorers, evidence matrices, risk registers, coverage summaries, JSON Schema contracts, QA receipts, redacted publication packs, and ZIP archives that can be verified after copying or sharing.

This is a report-delivery project, not a commercial security platform. Its core value is report evidence quality: traceable inputs, reproducible outputs, verifiable artifacts, signed-off handoff, and re-checkable archives.

Delivery Snapshot

TopicDescription
PurposeGenerate reproducible LLM security assessment report packs.
Recommended pathpreflight -> suite run -> validate-report -> verify-bundle -> qa-report --strict-handoff -> archive -> verify-archive.
Report evidenceMarkdown/HTML reports, JSON/JSONL traces, CSV evidence, case matrix, coverage summary, risk register, release notes, QA receipt, and manifest.
IntegritySchemas, SHA256/size checks, sidecar binding, redaction checks, cross-artifact consistency, and ZIP archive verification protect handoff quality.
Sample packReady-for-handoff sample report pack.

Screenshots

The screenshots below come from the checked-in sample generated by examples/ready-for-handoff-suite.yml. The rendered sample is available at docs/sample-report-pack/ready-for-handoff.

Report Pack Overview

Report pack overview

QA Receipt

QA receipt handoff readiness

Archive Verification

Archive verification

Quick Start

Prerequisites

ItemRequirement
PythonPython >= 3.9
GitGit is required for cloning the repository and managing local changes.
Node.jsNode.js >= 18, only required for the Vue dashboard.

Install

git clone https://github.com/Coff0xc/LLM-Security-Assessment-Framework.git
cd LLM-Security-Assessment-Framework

# Minimal backend install
pip install -e .

# Web dashboard and WebScan dependencies
pip install -e ".[web]"

# Full provider, web, monitoring, and dev extras
pip install -e ".[all]"

# Frontend
cd frontend
npm install

Generate a Ready-for-Handoff Report Pack

This is the recommended smoke path: run a no-model preflight, generate the report pack, validate artifacts, write the QA receipt, create a ZIP, and verify the archive after handoff.

python -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-ready
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zip
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

After installing the console script, the same commands can be run as forgedan suite ....

Run a Zero-Config Attack Demo

python -m forgedan.cli run --quick -g "test prompt" -m mock:test

Run the Web Dashboard

python -m forgedan.cli web
cd frontend
npm run dev

The backend defaults to :5000; the frontend defaults to :5173.

Report Workflow

StepDescription
1. Define scopeDefine cases, imported evidence sources, report metadata, policy gates, coverage requirements, acceptance criteria, reviewer decisions, and risk-register defaults in a suite YAML file.
2. Run preflightRun suite preflight before spending model budget to catch metadata, scorer, handoff-criteria, provenance, and deterministic replay issues.
3. GenerateUse suite run to write raw and redacted JSON/JSONL, Markdown/HTML reports, CSV matrices, coverage, risk register, release notes, and manifest artifacts.
4. Validate locallyUse validate-report and verify-bundle to bind schemas, hashes, summary counts, redacted artifacts, Markdown/HTML sidecars, and cross-artifact identities back to the source result.
5. Prepare handoffUse qa-report --strict-handoff to write a QA receipt with checklist status, blockers, acceptance criteria, source inventory, schema checks, and reviewer-facing evidence.
6. Archive and re-checkUse archive and verify-archive to create a single ZIP and re-check it after copying or sharing.

Report Pack Artifacts

ArtifactAudiencePurpose
suite-report.md / suite-report.htmlAuthorized reviewersNarrative report covering scope, method, findings, coverage, risk, usage, and limitations.
suite-result.json / suite-cases.jsonlAssessment teamRaw machine-readable results and case traces for audit replay.
suite-evidence.csvReviewersFinding evidence with taxonomy, confidence, severity rationale, OWASP LLM mapping, and recommendations.
suite-case-matrix.csvReviewersCase-level result, risk, usage, scorer, metadata, and coverage matrix.
suite-risk-register.json / suite-risk-register.csvRemediation ownersRisk tracker with owner, status, due date, severity rationale, and evidence fingerprint.
suite-coverage.json / suite-coverage.csvReviewersCoverage by case category, policy domain, taxonomy category, and OWASP LLM category.
suite-config.jsonAssessment teamNormalized suite input snapshot for audit replay.
suite-preflight.json / suite-preflight.mdAssessment teamReadiness audit before model execution.
suite-release-notes.mdReviewersShort handoff notes with risk, acceptance, source inventory, reviewer decisions, artifact pointers, and archive commands.
Redacted report/result/casesExternal reviewersLower-sensitivity publication package with prompts, responses, and evidence redacted.
suite-manifest.jsonAssessment teamArtifact integrity manifest with size, SHA256, schema references, sensitivity, audience labels, and acceptance status.
suite-qa-receipt.json / suite-qa-receipt.mdAssessment leadHandoff receipt covering manifest, schemas, hashes, consistency checks, preflight, acceptance, risk owners, and limitations.
handoff.zipReport recipientSingle-file package that can be re-verified after copying or sharing.

JSON Schema and Verification

Report artifact schemas live in schemas/ and support machine validation, handoff acceptance, and CI regression protection.

SchemaPurpose
suite-result.schema.jsonSuite run result.
suite-config.schema.jsonNormalized suite configuration snapshot.
suite-manifest.schema.jsonReport bundle artifact manifest.
suite-comparison.schema.jsonHistorical comparison result.
suite-comparison-manifest.schema.jsonComparison report manifest.
suite-qa-receipt.schema.jsonQA handoff receipt.
suite-preflight.schema.jsonPreflight readiness result.
suite-risk-register.schema.jsonRisk register.
suite-coverage.schema.jsonCoverage summary.
finding-taxonomy.schema.jsonFinding taxonomy.

validate-report checks more than JSON Schema. It recalculates source inventory, usage cost, risk-register totals, coverage totals, comparison regression counts, QA receipt readiness, manifest binding, and Markdown/HTML sidecar summaries so edited reports cannot silently diverge from machine data.

Common verification commands:

python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

Key Capabilities

AreaWhat it does
Report suitesYAML suite definitions, inline or imported cases, replay caches, deterministic seeds, policy gates, and preflight readiness checks.
Report artifactsMarkdown/HTML reports, executive summaries, evidence CSVs, case matrices, risk registers, coverage summaries, release notes, and bundle indexes.
Evidence integrityJSON Schemas, artifact manifests, SHA256/size checks, cross-artifact consistency, and redacted-publication leak checks.
Handoff QAQA receipt JSON/Markdown, acceptance criteria, reviewer decisions, owner/due-date tracking, and strict handoff gates.
Assessment coveragePrompt injection, jailbreak roleplay, system prompt leakage, secrets/PII exposure, Agent/MCP/tool policy risk, and model artifact signals.
Baseline engineFORGEDAN, AutoDAN, PAIR, GCG, Crescendo, TAP, model adapters, WebScan, CLI, REST API, and Vue dashboard.

CLI Reference

ScenarioCommandNotes
Run a suitepython -m forgedan.cli suite run examples/smoke-suite.ymlGenerate report outputs from a YAML suite.
Per-run output dirspython -m forgedan.cli suite run examples/smoke-suite.yml --run-id-dirIsolate output directories by run ID.
Run preflightpython -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-readyCheck report readiness before spending model budget.
Validate reportpython -m forgedan.cli suite validate-report reports/suite-ready/suite-result.jsonValidate schema and semantic consistency.
Verify bundlepython -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.jsonVerify manifest, hashes, sidecars, and cross-artifact consistency.
Write QA receiptpython -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoffWrite a strict handoff QA receipt.
Create ZIPpython -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zipCreate a single-file handoff package.
Verify ZIPpython -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zipRe-check the archive after copying or sharing.
Compare resultspython -m forgedan.cli suite compare base.json current.json --output comparison.json --fail-on-regressionGenerate historical comparison and optionally fail on regressions.
Export taxonomypython -m forgedan.cli suite taxonomy --jsonExport the finding taxonomy.
Export schemaspython -m forgedan.cli suite schemas --jsonExport report artifact schema references.
Attack demopython -m forgedan.cli run --quick -g "test prompt" -m mock:testRun a zero-config demo with the mock model.
Web backendpython -m forgedan.cli webStart the API/web backend.

Attack Methods

MethodTypeDescriptionPaper
FORGEDANEvolutionaryMulti-level mutation with semantic fitness and dual judge.arXiv:2511.13548
AutoDANEvolutionaryHierarchical genetic algorithm for stealthy jailbreak prompts.ICLR 2024
PAIRLLM-iterativeBlack-box jailbreak via attacker-target LLM iteration.NeurIPS 2024
GCGGradient-freeGreedy coordinate adversarial suffix generation.ICML 2023
CrescendoMulti-turnGradual escalation from benign to harmful content.USENIX Security 2025
TAPTree searchTree-of-thought attack with pruning and multi-LLM collaboration.NeurIPS 2024

Model Adapters

ProviderModelsExample
OpenAIGPT-3.5, GPT-4, GPT-4oopenai:gpt-4
AnthropicClaude 3 Opus/Sonnet/Haikuanthropic:claude-3-opus
GoogleGemini Pro, Gemini Visiongemini:gemini-pro
DeepSeekDeepSeek Chat/Coderdeepseek:deepseek-chat
ZhipuGLM-4, GLM-3zhipu:glm-4
QwenQwen Max/Plusqwen:qwen-max
MoonshotKimimoonshot:moonshot-v1-8k
YiYi Large/Mediumyi:yi-large
BaichuanBaichuan 4/3baichuan:baichuan-4
OllamaLocal Ollama modelsollama:llama2
vLLMLocal vLLM servicesvllm:model-name
HuggingFaceHuggingFace modelshuggingface:model-name
MockLocal testing, no API keymock:test-model

WebScan Modes

ModeDescriptionUse Case
URL crawlerAsync crawling plus title, form, link, and script extraction.Gather attack material from target websites.
Security scannerXSS, SQLi, directory traversal, security headers, and HTTP methods.Traditional web vulnerability assessment.
LLM interaction testIndirect prompt injection via web content and evolutionary optimization.Test LLM safety when processing web content.

Architecture

forgedan/
├── suite.py              # Suite runner, artifacts, validators, QA, archive verifier
├── scanners.py           # Deterministic prompt, response, tool, model-artifact scanners
├── scorers.py            # Reusable deterministic suite scorers
├── finding_taxonomy.py   # Finding IDs, priorities, OWASP LLM mappings
├── attacks/              # Attack algorithms and registry
├── adapters/             # Hosted, local, Chinese, vision, vLLM, HuggingFace, mock adapters
├── api/                  # Flask Blueprint REST API
├── webscan/              # Crawler, web scanner, LLM interaction tester
├── engine.py             # Evolutionary algorithm engine
├── mutator.py            # Mutation strategies and MAB selection
├── fitness.py            # Semantic fitness evaluation
└── judge.py              # Dual-judge mechanism

schemas/                  # Report artifact JSON Schema contracts
examples/                 # Runnable suites and fixtures
docs/                     # Landscape, lint roadmap, sample report pack
tests/                    # pytest coverage
frontend/                 # Vue 3 SPA dashboard

forgedan/suite.py is the report-delivery entry point. It handles suite execution, report artifact writing, schema/manifest validation, QA receipts, and archive verification. schemas/ defines artifact contracts, examples/ stores runnable fixtures, docs/ keeps sample report packs and project documentation, and frontend/ contains the Vue 3 dashboard.

API Endpoints

The backend exposes a Flask Blueprint REST API for automation scripts, demos, and internal assessment workflows.

POST   /api/attacks/run
GET    /api/attacks/{id}/status
GET    /api/attacks/{id}/result
POST   /api/attacks/{id}/stop

GET    /api/models/providers
POST   /api/models/test

POST   /api/webscan/crawl
POST   /api/webscan/scan
POST   /api/webscan/llm-test

POST   /api/reports/generate
GET    /api/reports/{id}
GET    /api/reports/{id}/download

GET    /api/datasets
POST   /api/datasets/upload

GET    /api/health
GET    /api/metrics

Documentation Map

DocumentPurpose
docs/sample-report-pack/ready-for-handoff/Checked-in mock report pack with QA receipt and verified ZIP archive.
docs/llm-security-landscape.mdCompetitor scan, gaps, and optimization priorities.
docs/lint-roadmap.mdCurrent CI lint gate, measured lint debt, and promotion plan.
docs/repository-about.mdRepository sidebar wording and topic recommendations.
schemas/JSON Schema contracts for report artifacts.
examples/Runnable suites, case fixtures, MCP manifests, and model artifact fixtures.

Development

pip install -e ".[dev]"

# Full pytest suite used locally
python -m pytest -q -W error::DeprecationWarning -p no:cacheprovider --basetemp .tmp-test

# CI report-pack gates
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

# Selected flake8 gate
python -m flake8 forgedan/ --select=E9,F63,F7,F82,E722,F401,F841 --show-source --statistics

# Formatter gate
python -m black --check forgedan tests

# Frontend build
cd frontend
npm install
npm run build

Roadmap

  • Evolutionary engine and mutation strategies
  • Six attack methods: FORGEDAN, AutoDAN, PAIR, GCG, Crescendo, TAP
  • Hosted, Chinese, local, vLLM, HuggingFace, vision, and mock adapters
  • YAML suite runner with imported cases, custom scorers, response cache, source inventory, and policy gates
  • Prompt injection, jailbreak framing, system prompt leakage, secrets/PII, Agent/MCP/tool policy risk, and model artifact scanning
  • Markdown/HTML reports, redacted publication packs, evidence matrices, case matrices, risk registers, coverage summaries, release notes, and bundle indexes
  • JSON Schema contracts, semantic validation, manifest verification, QA receipts, and archive verification
  • Checked-in ready-for-handoff sample report pack with screenshots
  • CI gates for tests, report-pack validation, strict QA handoff, archive verification, selected flake8, Black, and frontend build
  • Add more realistic Agent/MCP manifest fixtures and calibrate the default trust-score policy
  • Add HarmBench/JailbreakBench examples only where they improve report evidence quality
  • Expand model serialization analysis when the report scope needs deeper artifact review

GitHub About

Suggested repository description:

Report-first LLM security assessment framework for reproducible red-team suites, evidence packs, QA receipts, schemas, and archive verification.

Suggested topics:

llm-security, ai-red-team, prompt-injection, jailbreak, owasp-llm, mcp-security, agent-security, security-reporting, risk-register, audit-evidence, json-schema, pytest, python

Citation

If you use FORGEDAN in research, please cite:

@article{cheng2025forgedan,
  title={FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models},
  author={Cheng, Siyang and Liu, Gaotian and Mei, Rui and Wang, Yilin and Zhang, Kejia and Wei, Kaishuo and Yu, Yuqi and Wen, Weiping and Wu, Xiaojie and Liu, Junhua},
  journal={arXiv preprint arXiv:2511.13548},
  year={2025}
}

Contributing

Contributions are welcome. When changing report behavior, keep report artifacts, schemas, tests, and documentation aligned. See CONTRIBUTING.md for the general contribution flow.

Security

Use this project only for authorized security testing, research reproduction, and report delivery. Raw prompts, responses, traces, caches, and evidence may contain sensitive data; handle them according to the assessment scope and handoff rules.

License

This project is released under the MIT License. See LICENSE.


adversarial-attacks
ai-safety
cybersecurity
evolutionary-algorithm
flask
jailbreak
llm-security
prompt-injection
red-team
vue3

Coff0xc/LLM-Security-Assessment-Framework

FORGEDAN — An Evolutionary Framework for LLM Security Assessment | 6 Attack Methods | 18 Model Adapters | Vue 3 Dashboard | Web Security Scanning

Python

24

27 commits

updated Jun 3, 2026

See the code

README

FORGEDAN

面向报告交付的 LLM 安全评估框架

Report-first LLM Security Assessment Framework

Python 3.9+ CI License: MIT Paper Vue 3 Report Pack

可复现套件 | 证据化报告包 | QA 交接回执 | 可校验归档

Reproducible suites | Evidence-rich report packs | QA receipts | Verifiable archives

中文版 · English Version · 使用截图 / Screenshots · 中文独立版 · 样例报告包 / Sample Report Pack


中文版

本 README 采用 全量中文 + 全量 English 的双语格式。上半部分是完整中文版,下半部分是完整英文版;两种语言覆盖相同的项目定位、截图、快速开始、报告工作流、制品清单、验证门禁、开发命令、路线图、安全说明和许可证。

如果只需要中文交付或内部转发,可以使用 README.zh-CN.md。主 README 保持中英完整镜像,避免两个语言版本事实漂移。

项目定位

FORGEDAN 基于论文 FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models,但当前项目主线已经从单纯的越狱算法演示扩展为 LLM 安全评估报告交付框架。

本仓库仍保留进化式越狱攻击、模型适配器、WebScan、REST API 和 Vue dashboard。当前更重要的目标是生成可审计、可复现、可交接的报告包,包括 YAML 套件、确定性扫描器与评分器、证据矩阵、风险登记、覆盖率摘要、JSON Schema 合约、QA 回执、脱敏发布包,以及复制或分享后仍可重新校验的 ZIP 归档。

这不是商业化安全平台,而是报告交付项目。核心价值是报告证据质量:输入可追溯、输出可复现、制品可校验、交付可签收、归档可复核。

交付速览

主题说明
项目目标生成可复现的 LLM 安全评估报告包。
推荐路径preflight -> suite run -> validate-report -> verify-bundle -> qa-report --strict-handoff -> archive -> verify-archive。
报告证据Markdown/HTML 报告、JSON/JSONL trace、CSV 证据矩阵、case matrix、覆盖率摘要、风险登记、发布说明、QA 回执和 manifest。
完整性使用 Schema、SHA256/大小、sidecar 绑定、脱敏检查、跨制品一致性和 ZIP 归档校验保护交付质量。
样例包ready-for-handoff 样例报告包。

使用截图

下面截图来自 examples/ready-for-handoff-suite.yml 生成并提交到仓库的样例报告包。完整样例见 docs/sample-report-pack/ready-for-handoff。

报告包总览

报告包总览

QA 交接回执

QA 交接回执

归档校验

归档校验

快速开始

前置要求

项目要求
PythonPython >= 3.9
Git克隆仓库和管理本地变更需要 Git
Node.jsNode.js >= 18,仅运行 Vue dashboard 时需要

安装

git clone https://github.com/Coff0xc/LLM-Security-Assessment-Framework.git
cd LLM-Security-Assessment-Framework

# 后端最小安装
pip install -e .

# Web dashboard 和 WebScan 依赖
pip install -e ".[web]"

# 全量 provider、web、monitoring 和 dev 依赖
pip install -e ".[all]"

# 前端
cd frontend
npm install

生成可交付报告包

这是当前最推荐的 smoke path:先做无模型预检,再生成报告包,随后校验制品、生成 QA 回执、打包 ZIP,并在交付后重新校验归档。

python -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-ready
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zip
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

安装 console script 后,也可以使用 forgedan suite ... 形式运行。

运行零配置攻击 Demo

python -m forgedan.cli run --quick -g "test prompt" -m mock:test

运行 Web Dashboard

python -m forgedan.cli web
cd frontend
npm run dev

后端默认在 :5000,前端默认在 :5173。

报告工作流

步骤说明
1. 定义范围在 suite YAML 中定义 cases、导入证据源、报告元数据、策略门禁、覆盖率要求、验收准则、评审决策和风险登记默认值。
2. 运行预检使用 suite preflight 在消耗模型预算前检查元数据、scorer、交接准则、来源证明和确定性 replay 设置。
3. 生成报告使用 suite run 写出原始与脱敏 JSON/JSONL、Markdown/HTML 报告、CSV 矩阵、覆盖率、风险登记、发布说明和 manifest。
4. 本地验证使用 validate-report 与 verify-bundle 校验 schema、hash、摘要计数、脱敏制品、Markdown/HTML sidecar 和跨制品身份。
5. 准备交接使用 qa-report --strict-handoff 生成 QA 回执,记录 checklist、blocker、验收准则、Source Inventory、schema 校验和评审证据。
6. 归档复核使用 archive 和 verify-archive 生成单文件 ZIP,并在复制或分享后重新校验。

报告包制品

制品受众用途
suite-report.md / suite-report.html授权评审人叙事报告,包含范围、方法、发现、覆盖率、风险、用量和限制。
suite-result.json / suite-cases.jsonl评估团队原始机器可读结果和逐 case trace,便于审计 replay。
suite-evidence.csv评审人finding 证据表,包含 taxonomy、confidence、severity rationale、OWASP LLM 映射和建议。
suite-case-matrix.csv评审人case 级结果、风险、用量、scorer、metadata 和覆盖率矩阵。
suite-risk-register.json / suite-risk-register.csv修复负责人风险跟踪表,包含 owner、status、due date、severity rationale 和 evidence fingerprint。
suite-coverage.json / suite-coverage.csv评审人按 case category、policy domain、taxonomy category、OWASP LLM category 汇总覆盖率。
suite-config.json评估团队归一化 suite 输入快照,便于审计复放。
suite-preflight.json / suite-preflight.md评估团队模型执行前的 readiness audit。
suite-release-notes.md评审人简短交接说明,包含风险、验收、Source Inventory、reviewer decision、制品指针和归档命令。
脱敏 report/result/cases外部评审人低敏发布包,隐藏原始 prompt、response 和 evidence。
suite-manifest.json评估团队制品完整性清单,包含大小、SHA256、schema references、敏感度、受众标签和验收状态。
suite-qa-receipt.json / suite-qa-receipt.md评估负责人交接回执,覆盖 manifest、schema、hash、跨制品一致性、预检、验收、risk owner 和限制项。
handoff.zip交付接收方可在复制或分享后用 verify-archive 重新校验的单文件交付包。

JSON Schema 与验证

报告制品 schema 位于 schemas/,用于机器校验、交付验收和 CI 回归保护。

Schema用途
suite-result.schema.jsonsuite 运行结果。
suite-config.schema.json归一化 suite 配置快照。
suite-manifest.schema.json报告包制品 manifest。
suite-comparison.schema.json历史对比结果。
suite-comparison-manifest.schema.json对比报告 manifest。
suite-qa-receipt.schema.jsonQA 交接回执。
suite-preflight.schema.json运行前预检结果。
suite-risk-register.schema.json风险登记。
suite-coverage.schema.json覆盖率摘要。
finding-taxonomy.schema.jsonfinding taxonomy。

validate-report 不只检查 JSON Schema,还会复算 Source Inventory、usage cost、risk register totals、coverage totals、comparison regression counts、QA receipt readiness、manifest binding 和 Markdown/HTML sidecar 摘要,尽量避免手工修改后出现机器数据与人工报告不一致。

常用验证命令:

python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

核心能力

能力说明
Report suitesYAML suite、内联/导入用例、响应缓存、确定性种子、策略门禁、运行前预检。
Report artifactsMarkdown/HTML 报告、执行摘要、证据 CSV、case matrix、风险登记、覆盖率摘要、发布说明、bundle index。
Evidence integrityJSON Schema、制品 manifest、SHA256/大小校验、跨制品一致性校验、脱敏发布泄漏检查。
Handoff QAQA receipt JSON/Markdown、验收准则、评审决策、owner/due date、严格交接门禁。
Assessment coveragePrompt Injection、越狱角色扮演、系统提示泄漏、敏感信息/PII、Agent/MCP/工具策略风险、模型制品信号。
Baseline engineFORGEDAN、AutoDAN、PAIR、GCG、Crescendo、TAP、模型适配器、WebScan、CLI、REST API、Vue dashboard。

常用 CLI

场景命令说明
运行 suitepython -m forgedan.cli suite run examples/smoke-suite.yml从 YAML suite 生成报告输出。
按 run ID 输出python -m forgedan.cli suite run examples/smoke-suite.yml --run-id-dir使用 run ID 隔离输出目录。
运行预检python -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-ready在消耗模型预算前检查报告准备度。
校验报告制品python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json校验 schema 和语义一致性。
验证目录包python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json校验 manifest、hash、sidecar 和跨制品一致性。
生成 QA 回执python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff生成严格交接回执。
创建 ZIPpython -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zip创建单文件交付包。
验证 ZIPpython -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip复制或分享后复核归档。
对比结果python -m forgedan.cli suite compare base.json current.json --output comparison.json --fail-on-regression生成历史对比并可在回归时失败。
导出 taxonomypython -m forgedan.cli suite taxonomy --json导出 finding taxonomy。
导出 schemaspython -m forgedan.cli suite schemas --json导出报告制品 schema references。
攻击 demopython -m forgedan.cli run --quick -g "test prompt" -m mock:test使用 mock 模型运行零配置 demo。
Web 后端python -m forgedan.cli web启动 API/web 后端。

攻击方法

方法类型说明论文
FORGEDANEvolutionary多层级 mutation,结合语义适应度和双 judge。arXiv:2511.13548
AutoDANEvolutionary面向隐蔽越狱 prompt 的层次化遗传算法。ICLR 2024
PAIRLLM-iterative通过 attacker-target LLM 迭代完成黑盒越狱。NeurIPS 2024
GCGGradient-free基于贪心坐标搜索的 adversarial suffix 生成。ICML 2023
CrescendoMulti-turn从低风险内容逐步升级到高风险请求的多轮攻击。USENIX Security 2025
TAPTree searchTree-of-thought 攻击搜索,带剪枝和多 LLM 协作。NeurIPS 2024

模型适配器

Provider模型范围配置示例
OpenAIGPT-3.5, GPT-4, GPT-4oopenai:gpt-4
AnthropicClaude 3 Opus/Sonnet/Haikuanthropic:claude-3-opus
GoogleGemini Pro, Gemini Visiongemini:gemini-pro
DeepSeekDeepSeek Chat/Coderdeepseek:deepseek-chat
Zhipu / 智谱GLM-4, GLM-3zhipu:glm-4
Qwen / 通义千问Qwen Max/Plusqwen:qwen-max
Moonshot / 月之暗面Kimimoonshot:moonshot-v1-8k
Yi / 零一万物Yi Large/Mediumyi:yi-large
Baichuan / 百川Baichuan 4/3baichuan:baichuan-4
Ollama本地 Ollama 模型ollama:llama2
vLLM本地 vLLM 服务vllm:model-name
HuggingFaceHuggingFace 模型huggingface:model-name
Mock本地测试,无需 API keymock:test-model

WebScan 模式

模式说明适用场景
URL crawler异步抓取页面标题、表单、链接和脚本。收集目标站点中的攻击素材。
Security scanner检查 XSS、SQLi、路径穿越、安全 Header 和 HTTP Method。传统 Web 漏洞评估。
LLM interaction test使用网页内容触发间接 Prompt Injection,并结合进化式优化。评估 LLM 处理网页内容时的安全性。

架构概览

forgedan/
├── suite.py              # 报告套件运行器、制品、验证器、QA、归档复核
├── scanners.py           # 确定性 prompt、response、tool、model-artifact 扫描器
├── scorers.py            # 可复用确定性 suite scorer
├── finding_taxonomy.py   # finding IDs、优先级、OWASP LLM 映射
├── attacks/              # 攻击算法与注册表
├── adapters/             # 托管、本地、中文、vision、vLLM、HuggingFace、mock adapters
├── api/                  # Flask Blueprint REST API
├── webscan/              # crawler、web scanner、LLM interaction tester
├── engine.py             # 进化算法引擎
├── mutator.py            # mutation strategies 和 MAB 选择
├── fitness.py            # 语义适应度
└── judge.py              # 双 judge 机制

schemas/                  # 报告制品 JSON Schema 合约
examples/                 # 可运行 suite 和 fixture
docs/                     # 同类项目扫描、lint roadmap、样例报告包
tests/                    # pytest coverage
frontend/                 # Vue 3 SPA dashboard

forgedan/suite.py 是报告交付主入口,负责 suite 运行、报告制品写入、schema/manifest 校验、QA 回执和归档复核。schemas/ 约束报告制品,examples/ 保存可运行 fixture,docs/ 保存样例报告包和项目说明,frontend/ 保存 Vue 3 仪表盘。

API 端点

后端使用 Flask Blueprint 暴露 REST API,适合自动化脚本、演示环境和内部评估流程接入。

POST   /api/attacks/run
GET    /api/attacks/{id}/status
GET    /api/attacks/{id}/result
POST   /api/attacks/{id}/stop

GET    /api/models/providers
POST   /api/models/test

POST   /api/webscan/crawl
POST   /api/webscan/scan
POST   /api/webscan/llm-test

POST   /api/reports/generate
GET    /api/reports/{id}
GET    /api/reports/{id}/download

GET    /api/datasets
POST   /api/datasets/upload

GET    /api/health
GET    /api/metrics

文档导航

文档用途
docs/sample-report-pack/ready-for-handoff/已提交的 mock 样例报告包,包含 QA 回执和已校验 ZIP。
docs/llm-security-landscape.md同类项目扫描、能力差距和优化优先级。
docs/lint-roadmap.md当前 CI lint 门禁、历史债务统计和更严格质量门禁推进路径。
docs/repository-about.md仓库侧栏描述和 topic 建议。
schemas/报告制品 JSON Schema 合约。
examples/可运行 suite、case fixture、MCP manifest、模型制品 fixture。

开发与验证

pip install -e ".[dev]"

# 本地全量 pytest
python -m pytest -q -W error::DeprecationWarning -p no:cacheprovider --basetemp .tmp-test

# CI 报告包门禁
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

# flake8 选定门禁
python -m flake8 forgedan/ --select=E9,F63,F7,F82,E722,F401,F841 --show-source --statistics

# 格式化门禁
python -m black --check forgedan tests

# 前端构建
cd frontend
npm install
npm run build

当前路线图

  • 进化算法引擎与 mutation strategy
  • 6 种攻击方法:FORGEDAN、AutoDAN、PAIR、GCG、Crescendo、TAP
  • 托管、中文、本地、vLLM、HuggingFace、vision 和 mock adapter
  • YAML suite runner、导入 case、自定义 scorer、响应缓存、Source Inventory 和 policy gates
  • Prompt Injection、越狱框架、系统提示泄漏、敏感信息/PII、Agent/MCP/工具策略风险和模型制品扫描
  • Markdown/HTML 报告、脱敏发布包、证据矩阵、case matrix、风险登记、覆盖率摘要、发布说明和 bundle index
  • JSON Schema 合约、语义校验、manifest verification、QA receipt 和 archive verification
  • 已提交 ready-for-handoff 样例报告包和截图
  • CI 覆盖 tests、报告包校验、严格 QA 交接、归档校验、selected flake8、Black 和 frontend build
  • 增加更多真实 Agent/MCP manifest fixture,校准默认 trust-score policy
  • 仅在能提升报告证据质量时加入 HarmBench/JailbreakBench 示例
  • 当报告范围需要时扩展更深的 model serialization 分析

GitHub About 建议

仓库侧栏描述建议:

面向报告交付的 LLM 安全评估框架,用于生成可复现红队套件、证据包、QA 回执、Schema 合约和可校验归档。

建议 Topics:

llm-security, ai-red-team, prompt-injection, jailbreak, owasp-llm, mcp-security, agent-security, security-reporting, risk-register, audit-evidence, json-schema, pytest, python

引用

如果在研究中使用 FORGEDAN,请引用:

@article{cheng2025forgedan,
  title={FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models},
  author={Cheng, Siyang and Liu, Gaotian and Mei, Rui and Wang, Yilin and Zhang, Kejia and Wei, Kaishuo and Yu, Yuqi and Wen, Weiping and Wu, Xiaojie and Liu, Junhua},
  journal={arXiv preprint arXiv:2511.13548},
  year={2025}
}

贡献

欢迎提交改进。修改报告行为时,请同步维护报告制品、Schema、测试和文档。通用贡献流程见 CONTRIBUTING.md。

安全说明

本项目仅用于授权安全测试、研究复现和报告交付。原始 prompt、response、trace、cache 和 evidence 可能包含敏感数据,应按评估范围和交接规则管理。

许可证

本项目使用 MIT License,详见 LICENSE。


English Version

This README uses a complete Chinese + complete English bilingual structure. The first half is the full Chinese version; the second half is the full English version. Both versions cover the same positioning, screenshots, quick start, report workflow, artifact list, validation gates, development commands, roadmap, security notes, and license.

Use README.zh-CN.md for Chinese-only handoff or internal sharing. The main README keeps the Chinese and English versions mirrored so project facts do not drift.

Project Positioning

FORGEDAN is based on the paper FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models, but the current project direction has expanded from a jailbreak algorithm demo into a report-delivery framework for LLM security assessments.

The repository still contains evolutionary jailbreak attacks, model adapters, WebScan utilities, a REST API, and a Vue dashboard. Its current priority is to produce auditable, reproducible, handoff-ready report packs: YAML suites, deterministic scanners and scorers, evidence matrices, risk registers, coverage summaries, JSON Schema contracts, QA receipts, redacted publication packs, and ZIP archives that can be verified after copying or sharing.

This is a report-delivery project, not a commercial security platform. Its core value is report evidence quality: traceable inputs, reproducible outputs, verifiable artifacts, signed-off handoff, and re-checkable archives.

Delivery Snapshot

TopicDescription
PurposeGenerate reproducible LLM security assessment report packs.
Recommended pathpreflight -> suite run -> validate-report -> verify-bundle -> qa-report --strict-handoff -> archive -> verify-archive.
Report evidenceMarkdown/HTML reports, JSON/JSONL traces, CSV evidence, case matrix, coverage summary, risk register, release notes, QA receipt, and manifest.
IntegritySchemas, SHA256/size checks, sidecar binding, redaction checks, cross-artifact consistency, and ZIP archive verification protect handoff quality.
Sample packReady-for-handoff sample report pack.

Screenshots

The screenshots below come from the checked-in sample generated by examples/ready-for-handoff-suite.yml. The rendered sample is available at docs/sample-report-pack/ready-for-handoff.

Report Pack Overview

Report pack overview

QA Receipt

QA receipt handoff readiness

Archive Verification

Archive verification

Quick Start

Prerequisites

ItemRequirement
PythonPython >= 3.9
GitGit is required for cloning the repository and managing local changes.
Node.jsNode.js >= 18, only required for the Vue dashboard.

Install

git clone https://github.com/Coff0xc/LLM-Security-Assessment-Framework.git
cd LLM-Security-Assessment-Framework

# Minimal backend install
pip install -e .

# Web dashboard and WebScan dependencies
pip install -e ".[web]"

# Full provider, web, monitoring, and dev extras
pip install -e ".[all]"

# Frontend
cd frontend
npm install

Generate a Ready-for-Handoff Report Pack

This is the recommended smoke path: run a no-model preflight, generate the report pack, validate artifacts, write the QA receipt, create a ZIP, and verify the archive after handoff.

python -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-ready
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zip
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

After installing the console script, the same commands can be run as forgedan suite ....

Run a Zero-Config Attack Demo

python -m forgedan.cli run --quick -g "test prompt" -m mock:test

Run the Web Dashboard

python -m forgedan.cli web
cd frontend
npm run dev

The backend defaults to :5000; the frontend defaults to :5173.

Report Workflow

StepDescription
1. Define scopeDefine cases, imported evidence sources, report metadata, policy gates, coverage requirements, acceptance criteria, reviewer decisions, and risk-register defaults in a suite YAML file.
2. Run preflightRun suite preflight before spending model budget to catch metadata, scorer, handoff-criteria, provenance, and deterministic replay issues.
3. GenerateUse suite run to write raw and redacted JSON/JSONL, Markdown/HTML reports, CSV matrices, coverage, risk register, release notes, and manifest artifacts.
4. Validate locallyUse validate-report and verify-bundle to bind schemas, hashes, summary counts, redacted artifacts, Markdown/HTML sidecars, and cross-artifact identities back to the source result.
5. Prepare handoffUse qa-report --strict-handoff to write a QA receipt with checklist status, blockers, acceptance criteria, source inventory, schema checks, and reviewer-facing evidence.
6. Archive and re-checkUse archive and verify-archive to create a single ZIP and re-check it after copying or sharing.

Report Pack Artifacts

ArtifactAudiencePurpose
suite-report.md / suite-report.htmlAuthorized reviewersNarrative report covering scope, method, findings, coverage, risk, usage, and limitations.
suite-result.json / suite-cases.jsonlAssessment teamRaw machine-readable results and case traces for audit replay.
suite-evidence.csvReviewersFinding evidence with taxonomy, confidence, severity rationale, OWASP LLM mapping, and recommendations.
suite-case-matrix.csvReviewersCase-level result, risk, usage, scorer, metadata, and coverage matrix.
suite-risk-register.json / suite-risk-register.csvRemediation ownersRisk tracker with owner, status, due date, severity rationale, and evidence fingerprint.
suite-coverage.json / suite-coverage.csvReviewersCoverage by case category, policy domain, taxonomy category, and OWASP LLM category.
suite-config.jsonAssessment teamNormalized suite input snapshot for audit replay.
suite-preflight.json / suite-preflight.mdAssessment teamReadiness audit before model execution.
suite-release-notes.mdReviewersShort handoff notes with risk, acceptance, source inventory, reviewer decisions, artifact pointers, and archive commands.
Redacted report/result/casesExternal reviewersLower-sensitivity publication package with prompts, responses, and evidence redacted.
suite-manifest.jsonAssessment teamArtifact integrity manifest with size, SHA256, schema references, sensitivity, audience labels, and acceptance status.
suite-qa-receipt.json / suite-qa-receipt.mdAssessment leadHandoff receipt covering manifest, schemas, hashes, consistency checks, preflight, acceptance, risk owners, and limitations.
handoff.zipReport recipientSingle-file package that can be re-verified after copying or sharing.

JSON Schema and Verification

Report artifact schemas live in schemas/ and support machine validation, handoff acceptance, and CI regression protection.

SchemaPurpose
suite-result.schema.jsonSuite run result.
suite-config.schema.jsonNormalized suite configuration snapshot.
suite-manifest.schema.jsonReport bundle artifact manifest.
suite-comparison.schema.jsonHistorical comparison result.
suite-comparison-manifest.schema.jsonComparison report manifest.
suite-qa-receipt.schema.jsonQA handoff receipt.
suite-preflight.schema.jsonPreflight readiness result.
suite-risk-register.schema.jsonRisk register.
suite-coverage.schema.jsonCoverage summary.
finding-taxonomy.schema.jsonFinding taxonomy.

validate-report checks more than JSON Schema. It recalculates source inventory, usage cost, risk-register totals, coverage totals, comparison regression counts, QA receipt readiness, manifest binding, and Markdown/HTML sidecar summaries so edited reports cannot silently diverge from machine data.

Common verification commands:

python -m forgedan.cli suite validate-report reports/suite-ready/suite-result.json
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

Key Capabilities

AreaWhat it does
Report suitesYAML suite definitions, inline or imported cases, replay caches, deterministic seeds, policy gates, and preflight readiness checks.
Report artifactsMarkdown/HTML reports, executive summaries, evidence CSVs, case matrices, risk registers, coverage summaries, release notes, and bundle indexes.
Evidence integrityJSON Schemas, artifact manifests, SHA256/size checks, cross-artifact consistency, and redacted-publication leak checks.
Handoff QAQA receipt JSON/Markdown, acceptance criteria, reviewer decisions, owner/due-date tracking, and strict handoff gates.
Assessment coveragePrompt injection, jailbreak roleplay, system prompt leakage, secrets/PII exposure, Agent/MCP/tool policy risk, and model artifact signals.
Baseline engineFORGEDAN, AutoDAN, PAIR, GCG, Crescendo, TAP, model adapters, WebScan, CLI, REST API, and Vue dashboard.

CLI Reference

ScenarioCommandNotes
Run a suitepython -m forgedan.cli suite run examples/smoke-suite.ymlGenerate report outputs from a YAML suite.
Per-run output dirspython -m forgedan.cli suite run examples/smoke-suite.yml --run-id-dirIsolate output directories by run ID.
Run preflightpython -m forgedan.cli suite preflight examples/ready-for-handoff-suite.yml --strict --output reports/preflight-readyCheck report readiness before spending model budget.
Validate reportpython -m forgedan.cli suite validate-report reports/suite-ready/suite-result.jsonValidate schema and semantic consistency.
Verify bundlepython -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.jsonVerify manifest, hashes, sidecars, and cross-artifact consistency.
Write QA receiptpython -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoffWrite a strict handoff QA receipt.
Create ZIPpython -m forgedan.cli suite archive reports/suite-ready/suite-manifest.json --output reports/suite-ready/handoff.zipCreate a single-file handoff package.
Verify ZIPpython -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zipRe-check the archive after copying or sharing.
Compare resultspython -m forgedan.cli suite compare base.json current.json --output comparison.json --fail-on-regressionGenerate historical comparison and optionally fail on regressions.
Export taxonomypython -m forgedan.cli suite taxonomy --jsonExport the finding taxonomy.
Export schemaspython -m forgedan.cli suite schemas --jsonExport report artifact schema references.
Attack demopython -m forgedan.cli run --quick -g "test prompt" -m mock:testRun a zero-config demo with the mock model.
Web backendpython -m forgedan.cli webStart the API/web backend.

Attack Methods

MethodTypeDescriptionPaper
FORGEDANEvolutionaryMulti-level mutation with semantic fitness and dual judge.arXiv:2511.13548
AutoDANEvolutionaryHierarchical genetic algorithm for stealthy jailbreak prompts.ICLR 2024
PAIRLLM-iterativeBlack-box jailbreak via attacker-target LLM iteration.NeurIPS 2024
GCGGradient-freeGreedy coordinate adversarial suffix generation.ICML 2023
CrescendoMulti-turnGradual escalation from benign to harmful content.USENIX Security 2025
TAPTree searchTree-of-thought attack with pruning and multi-LLM collaboration.NeurIPS 2024

Model Adapters

ProviderModelsExample
OpenAIGPT-3.5, GPT-4, GPT-4oopenai:gpt-4
AnthropicClaude 3 Opus/Sonnet/Haikuanthropic:claude-3-opus
GoogleGemini Pro, Gemini Visiongemini:gemini-pro
DeepSeekDeepSeek Chat/Coderdeepseek:deepseek-chat
ZhipuGLM-4, GLM-3zhipu:glm-4
QwenQwen Max/Plusqwen:qwen-max
MoonshotKimimoonshot:moonshot-v1-8k
YiYi Large/Mediumyi:yi-large
BaichuanBaichuan 4/3baichuan:baichuan-4
OllamaLocal Ollama modelsollama:llama2
vLLMLocal vLLM servicesvllm:model-name
HuggingFaceHuggingFace modelshuggingface:model-name
MockLocal testing, no API keymock:test-model

WebScan Modes

ModeDescriptionUse Case
URL crawlerAsync crawling plus title, form, link, and script extraction.Gather attack material from target websites.
Security scannerXSS, SQLi, directory traversal, security headers, and HTTP methods.Traditional web vulnerability assessment.
LLM interaction testIndirect prompt injection via web content and evolutionary optimization.Test LLM safety when processing web content.

Architecture

forgedan/
├── suite.py              # Suite runner, artifacts, validators, QA, archive verifier
├── scanners.py           # Deterministic prompt, response, tool, model-artifact scanners
├── scorers.py            # Reusable deterministic suite scorers
├── finding_taxonomy.py   # Finding IDs, priorities, OWASP LLM mappings
├── attacks/              # Attack algorithms and registry
├── adapters/             # Hosted, local, Chinese, vision, vLLM, HuggingFace, mock adapters
├── api/                  # Flask Blueprint REST API
├── webscan/              # Crawler, web scanner, LLM interaction tester
├── engine.py             # Evolutionary algorithm engine
├── mutator.py            # Mutation strategies and MAB selection
├── fitness.py            # Semantic fitness evaluation
└── judge.py              # Dual-judge mechanism

schemas/                  # Report artifact JSON Schema contracts
examples/                 # Runnable suites and fixtures
docs/                     # Landscape, lint roadmap, sample report pack
tests/                    # pytest coverage
frontend/                 # Vue 3 SPA dashboard

forgedan/suite.py is the report-delivery entry point. It handles suite execution, report artifact writing, schema/manifest validation, QA receipts, and archive verification. schemas/ defines artifact contracts, examples/ stores runnable fixtures, docs/ keeps sample report packs and project documentation, and frontend/ contains the Vue 3 dashboard.

API Endpoints

The backend exposes a Flask Blueprint REST API for automation scripts, demos, and internal assessment workflows.

POST   /api/attacks/run
GET    /api/attacks/{id}/status
GET    /api/attacks/{id}/result
POST   /api/attacks/{id}/stop

GET    /api/models/providers
POST   /api/models/test

POST   /api/webscan/crawl
POST   /api/webscan/scan
POST   /api/webscan/llm-test

POST   /api/reports/generate
GET    /api/reports/{id}
GET    /api/reports/{id}/download

GET    /api/datasets
POST   /api/datasets/upload

GET    /api/health
GET    /api/metrics

Documentation Map

DocumentPurpose
docs/sample-report-pack/ready-for-handoff/Checked-in mock report pack with QA receipt and verified ZIP archive.
docs/llm-security-landscape.mdCompetitor scan, gaps, and optimization priorities.
docs/lint-roadmap.mdCurrent CI lint gate, measured lint debt, and promotion plan.
docs/repository-about.mdRepository sidebar wording and topic recommendations.
schemas/JSON Schema contracts for report artifacts.
examples/Runnable suites, case fixtures, MCP manifests, and model artifact fixtures.

Development

pip install -e ".[dev]"

# Full pytest suite used locally
python -m pytest -q -W error::DeprecationWarning -p no:cacheprovider --basetemp .tmp-test

# CI report-pack gates
python -m forgedan.cli suite run examples/ready-for-handoff-suite.yml --output reports/suite-ready
python -m forgedan.cli suite verify-bundle reports/suite-ready/suite-manifest.json
python -m forgedan.cli suite qa-report reports/suite-ready/suite-manifest.json --output reports/suite-ready/qa --strict-handoff
python -m forgedan.cli suite verify-archive reports/suite-ready/handoff.zip

# Selected flake8 gate
python -m flake8 forgedan/ --select=E9,F63,F7,F82,E722,F401,F841 --show-source --statistics

# Formatter gate
python -m black --check forgedan tests

# Frontend build
cd frontend
npm install
npm run build

Roadmap

  • Evolutionary engine and mutation strategies
  • Six attack methods: FORGEDAN, AutoDAN, PAIR, GCG, Crescendo, TAP
  • Hosted, Chinese, local, vLLM, HuggingFace, vision, and mock adapters
  • YAML suite runner with imported cases, custom scorers, response cache, source inventory, and policy gates
  • Prompt injection, jailbreak framing, system prompt leakage, secrets/PII, Agent/MCP/tool policy risk, and model artifact scanning
  • Markdown/HTML reports, redacted publication packs, evidence matrices, case matrices, risk registers, coverage summaries, release notes, and bundle indexes
  • JSON Schema contracts, semantic validation, manifest verification, QA receipts, and archive verification
  • Checked-in ready-for-handoff sample report pack with screenshots
  • CI gates for tests, report-pack validation, strict QA handoff, archive verification, selected flake8, Black, and frontend build
  • Add more realistic Agent/MCP manifest fixtures and calibrate the default trust-score policy
  • Add HarmBench/JailbreakBench examples only where they improve report evidence quality
  • Expand model serialization analysis when the report scope needs deeper artifact review

GitHub About

Suggested repository description:

Report-first LLM security assessment framework for reproducible red-team suites, evidence packs, QA receipts, schemas, and archive verification.

Suggested topics:

llm-security, ai-red-team, prompt-injection, jailbreak, owasp-llm, mcp-security, agent-security, security-reporting, risk-register, audit-evidence, json-schema, pytest, python

Citation

If you use FORGEDAN in research, please cite:

@article{cheng2025forgedan,
  title={FORGEDAN: An Evolutionary Framework for Jailbreaking Aligned Large Language Models},
  author={Cheng, Siyang and Liu, Gaotian and Mei, Rui and Wang, Yilin and Zhang, Kejia and Wei, Kaishuo and Yu, Yuqi and Wen, Weiping and Wu, Xiaojie and Liu, Junhua},
  journal={arXiv preprint arXiv:2511.13548},
  year={2025}
}

Contributing

Contributions are welcome. When changing report behavior, keep report artifacts, schemas, tests, and documentation aligned. See CONTRIBUTING.md for the general contribution flow.

Security

Use this project only for authorized security testing, research reproduction, and report delivery. Raw prompts, responses, traces, caches, and evidence may contain sensitive data; handle them according to the assessment scope and handoff rules.

License

This project is released under the MIT License. See LICENSE.


adversarial-attacks
ai-safety
cybersecurity
evolutionary-algorithm
flask
jailbreak
llm-security
prompt-injection
red-team
vue3

Languages

Python

89.6%

HTML

6.6%

Vue

2.2%