English | 中文
Normal by default. Offensive only when explicitly armed.
A lightweight, phase-aware red-team operating profile for Codex.
This project keeps Codex in normal mode by default and only enables offensive routing when you explicitly turn it on. It now adds:
- opt-in red-team mode
- lightweight hooks
- structured JSON mode state
- rule-first + semantic phase detection
- session-isolated mode state
- structured offensive task orchestration
- phase → method → router → leaf routing
- skill-pack style integration references for
qiushi-skill,hack-skills, andAnthropic-Cybersecurity-Skills - root-level
config.toml+instruction.ctf.mdprofile layout
Most “always-on red-team prompts” fail in one of two ways:
- they pollute normal work
- they blow up context with heavy doctrine injection
This project takes the opposite approach:
- normal mode stays normal
- red-team mode is explicit
- hooks stay small
- routing stays layered
-
Opt-in only
- normal mode is the default
- red-team mode only activates after explicit enable
-
Layered routing
- phase
- method
- router
- leaf
-
Skill integration
qiushi-skill→ method layerhack-skills→ technical router layerAnthropic-Cybersecurity-Skills→ skill-pack structure and progressive disclosure references
-
Expanded offensive domains
- web
- ad
- postex
- reverse
- code-audit
- payload
- evasion
-
Rule-first + semantic fallback
- direct matches win first
- lightweight semantic fallback catches natural-language prompts that do not match exact keywords
-
Session isolation
- one session does not overwrite another session’s mode state
-
Structured orchestration layer
- recon → strategy → exploit-dev → review → reporting
- artifact schemas and gates
- review-before-delivery workflow
-
Cross-platform install
- Windows / macOS / Linux
-
Validation and tests
- install validation
- hook validation
- router validation
- orchestration gate validation
- ordinary-mode cleanliness checks
The installer performs a managed additive install:
- preserves existing
AGENTS.mdandhooks.json - merges this project's managed block into
AGENTS.md - merges this project's managed hooks into
hooks.json - directly removes previously managed runtime code paths from older installs
- installs the current runtime version cleanly
- writes a local install manifest for the next upgrade
- runs validation after install
python scripts/install.pypowershell -ExecutionPolicy Bypass -File .\scripts\install.ps1python3 scripts/install.py进入红队模式
开启红队模式
/redteam on
/redteam light
/redteam full
enable red team mode
After enabling Reteam on: Enter Redteam Full
退出红队模式
关闭红队模式
/redteam off
disable red team mode
python scripts/validate.pyThe project starts in normal mode.
It does not inject offensive doctrine into ordinary work unless red-team mode is explicitly enabled.
The runtime hooks are intentionally small:
- small session-start context
- no giant prompt injection
- no always-on offensive bias
The runtime now emits a compact route envelope:
[security:redteam]
[mode:redteam-light]
[phase:web]
[method:investigation-first]
[router:auth-sec]
[leaf:jwt-oauth-token-attacks]
For larger tasks, the project includes a lightweight orchestration layer:
recon -> strategy -> exploit-dev -> review -> reporting
This layer is not always-on runtime automation.
It is a structured planning and gating framework.
.github/
config.toml
instruction.ctf.md
agents/
skills/
red-team-command-doctrine/
codex/
AGENTS.md
hooks/
router/
orchestrator/
docs/
scripts/
templates/
tests/
The canonical prompt now lives in:
./instruction.ctf.md
and the repository root config.toml points to it with:
# Codex red-team profile
model_instructions_file = './instruction.ctf.md'The project validates:
- mode enable / disable
- phase routing
- method / router / leaf routing
- semantic fallback
- ordinary-mode cleanliness
- session isolation
- orchestration gates
- this is a control/profile layer, not a full attack platform
- it does not include RAG or private knowledge retrieval
- execution depth still depends on your MCP/tooling surface
This project is for authorized penetration testing, red-team research, and defensive security experiments only.
- Use it only where you have explicit authorization.
- Unauthorized use against third-party or production systems is strictly prohibited.
- The authors and contributors assume no liability for misuse, legal consequences, service disruption, or data loss.
- By using this project, you accept full responsibility for complying with applicable laws and rules of engagement.
Thanks to Mingxi from the Mister Security team for the suggestion to add semantic checks. Mingxi X: @xishan12509850
Thanks to Nirvana for the suggestion to optimize the workflow and enable overwrite installation. Nirvana X: @Nirvana_543
Thanks to qiushi-skill, hack-skills, and Anthropic-Cybersecurity-Skills for providing the method layer, technology routing layer, and skill pack structure reference.
Reference projects: qiushi-skill / yaklang/hack-skills / mukul975/Anthropic-Cybersecurity-Skills
See CONTRIBUTING.md.
MIT with an authorized-use-only notice.
See LICENSE.