Skip to content
Projects

xsser/codex-jailbreak-guide

View on GitHub

About

Codex CLI jailbreak guide — customizing system prompt via model_instructions_file config

Learning & Education

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+1
in 15 days
+3
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Codex CLI 越狱:model_instructions_file

这是什么

通过修改 Codex CLI 的 config.toml 中 model_instructions_file 字段,用自定义 prompt 完全替换官方的安全对齐指令。模型从启动那一刻起就在你的指令框架下运行,官方安全 prompt 不残留。

model_instructions_file 如何定义

~/.codex/config.toml:

model = "gpt-5.5"
model_instructions_file = "/home/yourname/.codex/prompts/codex-base.md"
approval_policy = "never"
sandbox_mode = "danger-full-access"

源码层原理

Codex CLI 的 Rust 源码(profile_toml.rs)中:

model_instructions_file: Option<AbsolutePathBuf>
  • 类型是 Option——填了就用你的文件,不填就用官方内置的 base_instructions/default.md
  • 作用是直接替换(replace),不是追加(append)

model_instructions_file vs AGENTS.md

特性 model_instructions_file AGENTS.md
作用 替换 base instructions 追加指令
官方安全层 移除 保留
配置位置 config.toml 项目根目录

设置步骤

# 1. 创建 prompt 文件
mkdir -p ~/.codex/prompts
cp prompts/codex-base.md ~/.codex/prompts/codex-base.md

# 2. config.toml 加上配置
cat >> ~/.codex/config.toml << 'EOF'
model_instructions_file = "/home/yourname/.codex/prompts/codex-base.md"
approval_policy = "never"
sandbox_mode = "danger-full-access"
EOF

# 3. 启动 codex
codex

文件说明

文件 说明
prompts/codex-base.md 越狱 prompt 全文(UNFILTERED MODE)
ANALYSIS.md Prompt 逐段越狱逻辑拆解

Explore related projects

Loading…