工具项目
The outline of the project is loading
小迪安全知识库
-
+
home
AI提示词编码注入工具
AI提示词编码注入工具
# Codex Session Patcher 项目地址:https://github.com/ryfineZ/codex-session-patcher [](https://github.com/ryfineZ/codex-session-patcher#codex-session-patcher) **AI 编码工具会话清理器 & CTF/渗透测试提示词注入工具** 支持 **Codex CLI** · **Claude Code** · **OpenCode** 在安全测试、CTF 比赛、渗透测试等场景下,AI 编码工具(Codex、Claude Code、OpenCode)会频繁拒绝涉及安全操作的请求,导致会话中断。 **Codex Session Patcher** 提供两类解决方案: **1\. 会话清理** — 扫描已产生的拒绝回复,替换为配合性内容,让会话可以 resume 继续 **2\. CTF 提示词注入** — 在配置层面注入安全测试上下文,从源头降低被拒绝的概率 ### 会话清理 [](https://github.com/ryfineZ/codex-session-patcher#%E4%BC%9A%E8%AF%9D%E6%B8%85%E7%90%86) * **智能检测** — 两级拒绝检测策略(强短语全文匹配 + 弱关键词开头匹配),低误报率 * **AI 智能改写** — 调用 LLM 根据对话上下文生成符合语境的替换回复(支持 OpenAI / Ollama / OpenRouter 等兼容接口) * **安全兜底** — 可清理只有 `event_msg` 的历史 Codex 拒绝记录;AI 返回问号乱码时自动回退到安全默认文本 * **批量清理** — 处理会话中所有拒绝回复,而非仅最后一条 * **推理内容擦除** — 删除 Reasoning / Thinking block 加密推理内容 * **备份还原** — 清理前自动备份,支持一键还原到任意历史版本 * **Diff 对比** — 清理前后 Side-by-side 对比视图 ### CTF/渗透测试提示词注入 [](https://github.com/ryfineZ/codex-session-patcher#ctf%E6%B8%97%E9%80%8F%E6%B5%8B%E8%AF%95%E6%8F%90%E7%A4%BA%E8%AF%8D%E6%B3%A8%E5%85%A5) * **Codex Profile 模式** — 创建新版 `ctf.config.toml` profile,仅 `codex -p ctf` 启动时生效,不影响正常会话 * **Codex 全局模式** — 注入到全局配置,所有新会话自动生效 * **Claude Code 工作空间** — 创建专用 CTF 工作空间 `~/.claude-ctf-workspace`,通过项目级 CLAUDE.md 注入 * **OpenCode 工作空间** — 创建专用 CTF 工作空间 `~/.opencode-ctf-workspace`,通过 AGENTS.md 注入 * **提示词自定义** — Web UI 内直接编辑注入提示词,支持模板保存与切换 * **AI 提示词改写** — 结合已注入的 CTF 系统提示词,AI 改写你的请求使其更易被接受 | 平台 | 会话清理 | CTF 注入 | 会话格式 | |-------------|------|----------------|--------| | Codex CLI | ✅ | ✅ Profile + 全局 | JSONL | | Claude Code | ✅ | ✅ 专用工作空间 | JSONL | | OpenCode | ✅ | ✅ 专用工作空间 | SQLite |
xiaodi
July 20, 2026, 2:34 a.m.
99
0 comment
Forward
Favorites
Last
Next
Scan the QR Code
Copy link
Scan the QR code to share.
Copy link
share
link
type
password
Update password
Validity period
Markdown file
Word document
PDF document
PDF document (print)