with one click
test-and-eval
IVAgent 测试与评估工作流。修改代码后运行回归测试、LLM 语义评测和日志分析。当用户要求测试、验证、评估或回归检查时使用。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
IVAgent 测试与评估工作流。修改代码后运行回归测试、LLM 语义评测和日志分析。当用户要求测试、验证、评估或回归检查时使用。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
系统测试通用 workflow:对 IDA 伪代码视图执行自主漏洞挖掘
系统测试 workflow: baseband_nas_tft_overflow_01
系统测试 workflow: baseband_rlc_reassembly_01
系统测试 workflow: bluetooth_gatt_underflow_01
系统测试 workflow: bt_l2cap_fragment_uaf_01
系统测试 workflow: cross_func_overflow_01
| name | test-and-eval |
| description | IVAgent 测试与评估工作流。修改代码后运行回归测试、LLM 语义评测和日志分析。当用户要求测试、验证、评估或回归检查时使用。 |
| user-invocable | true |
| allowed-tools | Bash, Read, Glob, Grep |
| tags | ["test","eval","regression","validation"] |
本 skill 用于 IVAgent 开发后的自动化测试和回归验证,基于 LLM 语义理解的端到端评测框架。
.venv/bin/pythonOPENAI_API_KEY='your-api-key-1'
OPENAI_BASE_URL='http://192.168.72.1:8317/v1'
OPENAI_MODEL='gpt-5.2'
CLI 入口:tests/eval/cli.py
说明:
run / run-one 在进入编排执行前会自动确保 Web 监控页已启动tests/eval 会为每个 testcase run 创建独立的 sqlite 数据库文件,保存在对应输出目录ivagent_cli.py 执行;testcase 自带 SKILL.md 作为系统测试 workflow支持的子命令:
list - 列出所有测试用例run - 运行测试用例evaluate - LLM 语义评测analyze - LLM 日志分析monitor - 运行时监控monitor-batch - 批量回归运行时监控.venv/bin/python -m tests.eval.cli list
当前内置用例:
heap_overflow_01 - 简单堆缓冲区溢出format_string_01 - 格式化字符串漏洞cross_func_overflow_01 - 跨函数数据流缓冲区溢出uaf_cross_func_01 - 跨函数 Use-After-Freeinteger_overflow_chain_01 - 整数溢出链导致缓冲区溢出OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli run \
--testcase heap_overflow_01 \
--output-dir /tmp/ivagent_eval
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli run \
--all \
--engine source \
--parallel 3 \
--output-dir /tmp/ivagent_eval_all
另起一个命令持续观察批量进度:
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli monitor-batch \
--results-dir /tmp/ivagent_eval_all \
--interval 15
OUTPUT_DIR=/tmp/eval_run_$(date +%s)
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli run \
--all \
--engine source \
--parallel 3 \
--output-dir $OUTPUT_DIR
建议同时再起一个命令持续监控:
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli monitor-batch \
--results-dir $OUTPUT_DIR \
--interval 15
对已运行完成的结果进行语义评测:
单个测试用例:
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli evaluate \
--results-dir $OUTPUT_DIR/heap_overflow_01 \
--output $OUTPUT_DIR/heap_overflow_01/evaluation_report.md
批量评测:
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli evaluate \
--results-dir $OUTPUT_DIR \
--output $OUTPUT_DIR/evaluation_report.md
对单次运行目录做 LLM 日志分析:
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli analyze \
--run-dir $OUTPUT_DIR/heap_overflow_01 \
--output $OUTPUT_DIR/heap_overflow_01/analysis_report.md
适合长时间任务:
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli monitor \
--run-dir $OUTPUT_DIR/heap_overflow_01 \
--interval 10
每个 testcase 运行目录下会生成:
run_summary.md - 本次运行摘要detection_results.md - 检测出的漏洞 Markdownllm_interactions.md - 格式化后的 LLM 交互全文agent_execution.md - 格式化后的 Agent 执行过程llm_logs.db - LLM 日志数据库agent_logs.db - Agent 日志数据库vulnerabilities.db - 漏洞数据库批量运行时,结果根目录还会生成:
RUNS.md - 批量运行汇总PROGRESS.md - 批量运行实时进度PROGRESS.json - 批量运行机读状态每个 testcase 目录还会生成:
console.log - 该 testcase 的完整运行日志run_summary.md - 快速了解运行结果detection_results.md - 查看检测到的漏洞evaluation_report.md - 查看 LLM 评测结果llm_interactions.md - 深入了解 LLM 交互过程agent_execution.md - 深入了解 Agent 执行过程TESTCASE.md评测不再依赖 results.json,而是直接读取:
run_summary.mddetection_results.mdsqlite 保留给程序内部统计和导出,用户优先查看 Markdown 文件。
改动源码分析逻辑后,推荐最少执行:
# 1. 列出测试用例
.venv/bin/python -m tests.eval.cli list
# 2. 运行单个测试
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli run \
--testcase heap_overflow_01 \
--output-dir /tmp/ivagent_eval_dev
# 3. 评测结果
OPENAI_API_KEY='your-api-key-1' \
OPENAI_BASE_URL='http://192.168.72.1:8317/v1' \
OPENAI_MODEL='gpt-5.2' \
.venv/bin/python -m tests.eval.cli evaluate \
--results-dir /tmp/ivagent_eval_dev/heap_overflow_01
长时间批量回归时,Codex 应默认执行以下流程:
run --all --parallel N 启动批量回归,优先使用 output/ 下的新目录保存产物。monitor-batch --results-dir <OUTPUT_DIR> 持续观察运行状态。evaluate 和必要的 analyze。推荐并发度:
--parallel 2--parallel 3除非明确需要复现单 testcase 时序问题,否则不要默认串行跑完整 --all。
每个测试用例目录包含:
tests/testcases/<name>/
├── TESTCASE.md
└── source/
└── vuln.c
TESTCASE.md 用自然语言描述:
示例字段:
# Test Case: heap_overflow_01
## Metadata
- **Engine**: source
- **Skill**: eval_source_scan
- **Entry Functions**: parse_packet
- **Timeout**: 300 seconds
- **Tags**: buffer_overflow, memcpy, heap
tests/testcases/ 下创建新目录TESTCASE.mdsource/vuln.c.venv/bin/python -m tests.eval.cli list 验证被发现.venv/bin/python -m tests.eval.cli run --testcase your_testcase 验证可执行source 引擎,无需外部逆向工具