一键导入
codex-redteam-mode
Opt-in red team mode for AI coding assistants that enables security-focused thinking for penetration testing and red team operations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Opt-in red team mode for AI coding assistants that enables security-focused thinking for penetration testing and red team operations
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | codex-redteam-mode |
| description | Opt-in red team mode for AI coding assistants that enables security-focused thinking for penetration testing and red team operations |
| triggers | ["enable red team mode for security testing","how do I activate codex red team mode","switch to red team thinking mode","configure AI for penetration testing workflow","install red team mode for codex","use red team mode for security analysis","disable red team mode and return to normal","validate red team mode installation"] |
Skill by ara.so — Codex Skills collection.
Codex Red Team Mode is a lightweight, opt-in configuration layer that enables AI coding assistants to think like red team operators during authorized security assessments. Unlike persistent jailbreaks that pollute normal operations, this project provides:
phase -> router -> pack -> leaf workflow for security operationsThe project supports multiple security phases including web exploitation, Active Directory, post-exploitation, reverse engineering, code auditing, payload development, and evasion techniques.
The installer uses managed incremental installation that preserves your existing configuration while injecting only the necessary red team components.
# Clone the repository
git clone https://github.com/chAng-L19/codex-redteam-mode.git
cd codex-redteam-mode
# Run installer
python scripts/install.py
# Navigate to project directory
cd codex-redteam-mode
# Run installer with execution policy bypass
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
# Ensure Python 3 is available
python3 scripts/install.py
The installer will:
AGENTS.md and hooks.jsonAfter installation, verify the setup:
# Run validation script
python scripts/validate.py
# Or run full test suite
python -m unittest discover -s tests -p "test_*.py"
# Full command
/redteam on
# Light mode (targeted security analysis)
/redteam light
# Full mode (complete red team workflow)
/redteam full
# Natural language
enable red team mode
Enter Red Team Mode
# Command
/redteam off
# Natural language
disable red team mode
Exit Red Team Mode
# Query current state
what mode am I in?
show red team status
| Mode | Default | Use Case |
|---|---|---|
normal | ✓ | Regular coding, documentation, general research |
redteam-light | Targeted security analysis, planning, threat modeling | |
redteam-full | Deep red team workflow with full routing |
The routing mainline follows:
phase -> router -> pack -> leaf
# In red team mode, analyze a web application
"""
/redteam full
I need to assess a web application at https://target.example.com (authorized)
Focus on:
- Authentication mechanisms
- Session management
- Input validation
- API endpoints
"""
# The AI will route through: web -> api -> injection -> leaf
# Providing structured analysis with appropriate techniques
# Enable red team mode for AD testing
"""
/redteam full
Analyzing Active Directory environment (authorized pentest)
- Domain: corp.example.local
- Current access: low-privilege domain user
- Goal: privilege escalation paths
"""
# Routes through: ad -> enum -> privesc -> pack
# Light mode for code review
"""
/redteam light
Review this authentication function for security issues:
def authenticate(username, password):
query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'"
result = db.execute(query)
return result.fetchone()
"""
### Payload Development
```python
# Full mode for payload creation
"""
/redteam full
Need to create a Python reverse shell payload that:
- Connects to ${C2_SERVER}:${C2_PORT} (env vars)
- Evades basic AV signature detection
- Works on Windows 10+
- Maintains persistence
"""
# Routes through: payload -> evasion -> windows -> leaf
The mode state is stored in JSON format, typically in:
.codex/runtime/redteam_state.json
Example state file:
{
"mode": "redteam-full",
"phase": "web",
"router": "injection",
"pack": "sqli",
"session_id": "uuid-here",
"timestamp": "2026-05-19T12:34:56Z"
}
The hooks.json file manages prompt overlays:
{
"redteam": {
"enabled": false,
"mode": "normal",
"phases": ["web", "ad", "postex", "reverse", "code-audit", "payload", "evasion"],
"routing": "phase-router-pack-leaf"
}
}
To add custom phases, edit the routing configuration:
# Example: Adding a custom "wireless" phase
# Edit runtime/routing.json
{
"phases": {
"wireless": {
"routers": ["wifi", "bluetooth", "rfid"],
"packs": {
"wifi": ["wpa", "wep", "wps", "evil-twin"],
"bluetooth": ["ble", "classic", "pairing"]
}
}
}
}
# Check if files were properly injected
ls -la .codex/AGENTS.md
cat .codex/hooks.json | grep redteam
# Re-run installer with verbose output
python scripts/install.py --verbose
# Clean install (removes all managed blocks first)
python scripts/install.py --clean
# Verify runtime state
cat .codex/runtime/redteam_state.json
# Check hooks are loaded
python -c "import json; print(json.load(open('.codex/hooks.json'))['redteam'])"
# Force mode switch
/redteam off
/redteam full
# Run specific test
python -m unittest tests.test_routing
# Check installer integrity
python scripts/validate.py --check-install
# Verify phase detection
python scripts/validate.py --test-phases
If normal mode feels influenced by red team prompts:
# Ensure clean mode switch
/redteam off
# Verify state
python -c "import json; print(json.load(open('.codex/runtime/redteam_state.json'))['mode'])"
# Should output: "normal"
⚠️ Authorization Required: Only use red team mode on systems where you have explicit written authorization.
# Always document scope
"""
AUTHORIZATION:
- Client: Example Corp
- Scope: https://test.example.com
- Date: 2026-05-20 to 2026-05-27
- Contact: security@example.com
"""
Never:
# Using with Model Context Protocol tools
"""
/redteam full
Using ${MCP_TOOL_NMAP} scan:
- Target: ${TARGET_NETWORK}
- Ports: 1-65535
- Service detection enabled
- Output: XML format
"""
# Light mode for automated security review
"""
/redteam light
Analyze this PR for security issues:
- Changes in auth/* files
- New API endpoints
- Database query modifications
"""
/redteam off when switching contextsSee CONTRIBUTING.md in the repository for guidelines on:
MIT License - See LICENSE file for details.
Convert attached object images into code-only, animation-ready procedural Three.js models through guided sculpting workflow
Create and manage AI video storyboard projects with automated asset generation through Codex Storyboard workspace
Continue-thinking middleware that detects and handles reasoning truncation in Codex/OpenAI Responses-compatible APIs
Desktop manager for OpenAI Codex CLI with prompt injection, provider switching, and TOML/Auth visualization
Inject unrestricted developer mode instructions into Codex CLI (GPT-5.5) to bypass content filters
Install and use TradingCodex to build Codex-native investment research workflows with fixed-role agents, order approval gates, and local Django service plane