
codex-redteam-mode
Opt-in red team mode for AI coding assistants that enables security-focused thinking for penetration testing and red team operations
- Installs
- 234
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/codex-skills --skill codex-redteam-mode- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads codex-redteam-mode automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Codex Red Team Mode
Skill by ara.so — Codex Skills collection.
Overview
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:
- Opt-in activation: Normal mode by default, red team mode only when explicitly enabled
- Structured routing:
phase -> router -> pack -> leafworkflow for security operations - Session isolation: State management via JSON runtime files
- Lightweight hooks: Minimal context bloat with targeted prompt overlays
The project supports multiple security phases including web exploitation, Active Directory, post-exploitation, reverse engineering, code auditing, payload development, and evasion techniques.
Installation
The installer uses managed incremental installation that preserves your existing configuration while injecting only the necessary red team components.
Python (Cross-platform)
# Clone the repository
git clone https://github.com/chAng-L19/codex-redteam-mode.git
cd codex-redteam-mode
# Run installer
python scripts/install.py
Windows (PowerShell)
# Navigate to project directory
cd codex-redteam-mode
# Run installer with execution policy bypass
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
macOS / Linux
# Ensure Python 3 is available
python3 scripts/install.py
The installer will:
- Preserve your original
AGENTS.mdandhooks.json - Inject managed blocks from the repository
- Remove old version runtime remnants
- Write installation manifest
- Automatically run validation
Validation
After 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"
Core Commands
Enable Red Team Mode
# 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
Disable Red Team Mode
# Command
/redteam off
# Natural language
disable red team mode
Exit Red Team Mode
Check Current Mode
# Query current state
what mode am I in?
show red team status
Modes
| 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 |
Workflow Structure
The routing mainline follows:
phase -> router -> pack -> leaf
Core Phases
- web: Web application testing (XSS, SQLi, CSRF, etc.)
- ad: Active Directory exploitation
- postex: Post-exploitation activities
- reverse: Reverse engineering
- code-audit: Source code security analysis
- payload: Payload generation and customization
- evasion: AV/EDR evasion techniques
Extended Routers/Packs
- recon: Reconnaissance and enumeration
- api: API security testing
- auth: Authentication/authorization bypass
- injection: Various injection attacks
- file: File upload/download vulnerabilities
- cloud: Cloud infrastructure security
- container: Docker/Kubernetes security
- network: Network protocol analysis
- crypto: Cryptographic vulnerabilities
- mobile: Mobile application security
Usage Patterns
Web Security Testing
# 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
Active Directory Assessment
# 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
Code Security Audit
# 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
Configuration
Runtime State Files
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"
}
Hooks Configuration
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"
}
}
Custom Phase Extension
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"]
}
}
}
}
Troubleshooting
Installation Issues
# 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
Mode Not Activating
# 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
Validation Failures
# 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
Context Pollution
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"
Security & Legal Considerations
⚠️ 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:
- Use on production systems without authorization
- Use on third-party systems
- Share credentials or access outside scope
- Ignore legal boundaries
Integration Examples
With MCP Tools
# 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
"""
With CI/CD Security Scanning
# Light mode for automated security review
"""
/redteam light
Analyze this PR for security issues:
- Changes in auth/* files
- New API endpoints
- Database query modifications
"""
Best Practices
- Always start in normal mode: Only activate red team mode when needed
- Use light mode for analysis: Reserve full mode for active testing
- Document your scope: Keep authorization details in session context
- Clean state between engagements: Use
/redteam offwhen switching contexts - Validate after updates: Run tests after any configuration changes
- Use environment variables: Never hardcode credentials or targets
Contributing
See CONTRIBUTING.md in the repository for guidelines on:
- Adding new phases
- Extending router logic
- Creating custom packs
- Submitting bug reports
License
MIT License - See LICENSE file for details.
FAQ
What does the codex-redteam-mode skill do?
Opt-in red team mode for AI coding assistants that enables security-focused thinking for penetration testing and red team operations
How do I install codex-redteam-mode?
Run npx skills add https://github.com/reason-machines/codex-skills --skill codex-redteam-mode in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codex-redteam-mode/ (personal) or .claude/skills/codex-redteam-mode/ (project).
Which AI agents can use codex-redteam-mode?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is codex-redteam-mode safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains codex-redteam-mode?
It is published by reason-machines in reason-machines/codex-skills. It has 234 recorded installs.
More from reason-machines/codex-skills
academic-research-skills-codex
reason-machines/codex-skills
Open the skill to read its SKILL.md instructions.
codexplusplus-launcher
reason-machines/codex-skills
Enhanced launcher for Codex App that unlocks plugins, enables session deletion, exports conversations, and syncs provider sessions via CDP injection
codex-plugin-claude-code
reason-machines/codex-skills
Open the skill to read its SKILL.md instructions.
awesome-codex-skills-curator
reason-machines/codex-skills
Open the skill to read its SKILL.md instructions.
codex-plusplus-tweak-system
reason-machines/codex-skills
Open the skill to read its SKILL.md instructions.
awesome-codex-subagents
reason-machines/codex-skills
Open the skill to read its SKILL.md instructions.
Popular security skills
azure-compliance
microsoft/azure-skills
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
minimal-run-and-audit
lllllllama/rigorpilot-skills
Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
firebase-security-rules-auditor
firebase/agent-skills
Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.
audit
pbakaus/impeccable
Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
competitors
coreyhaines31/marketingskills
When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.