CyberCortex is a Discord bot that helps cybersecurity learners build structured, certification-aligned practice workflows while enforcing authorized-use boundaries.
CyberCortex combines practical learning guidance, search-grounded recommendations, and safety-aware AI orchestration for offensive and defensive security education in authorized environments.
Many cybersecurity learners struggle with:
- Structuring their study path for certifications
- Knowing which labs to practice and in what order
- Understanding full attack-chain methodology
- Translating practice into professional reporting habits
- Staying within ethical and authorized boundaries
CyberCortex addresses these challenges by combining structured learning workflows with AI-driven personalization and safety enforcement.
- Structured progression workflows (
/studyplan,/roadmap) instead of one-off generic advice - Scope-aware red-team guidance with explicit authorization context (
/redteam) - Certification-aligned weekly plans with exam-readiness and alignment notes
- Search-grounded labs/resources/news with validated links, not hallucinated URLs
- Discord-safe response chunking that preserves formatting and readability
- Defensive awareness integrated into offensive-learning outputs
| Command | Value |
|---|---|
/studyplan |
Build certification-focused weekly prep plans |
/roadmap |
Generate phased learning roadmaps for a target role/goal |
/redteam |
Get authorized-scope red-team methodology guidance |
/labs |
Find relevant lab platforms and challenge paths |
/resource |
Curate useful articles, blogs, repos, books, and walkthroughs |
/news |
Track cybersecurity developments with practical context |
/quiz |
Practice with structured MCQ sets |
/explain |
Break down security concepts into practical learning chunks |
/tools |
Learn safe starter tooling and common setup pitfalls |
Week 4 - Active Directory Fundamentals
Focus: Enumeration and attack-path mapping
Deliverable: AD topology report with identified escalation paths
Certification Alignment:
This mirrors enterprise engagement flow expected in practical certifications.
- Input validation and prompt-injection checks before model generation
- Explicit scope gating for sensitive red-team style requests
- Rate limiting to reduce abuse and control cost
- Grounded selection for labs/resources/news (only links from fetched candidates)
- Safety-focused output rules that avoid weaponized instructions
The current implementation and validation flow covers:
- Prompt injection simulation attempts
- Malicious scope bypass attempts for offensive commands
- Rate limit behavior and retry-window handling
- Oversized response chunk validation for Discord constraints
- Null-input, malformed-input, and unsafe-pattern handling
- Prompt injection detection is primarily rule-based.
- Rate limiting is in-memory (Redis is better for horizontal scaling).
- No persistent chat memory by design (privacy-first behavior).
- Availability depends on external model and feed providers.
Discord Slash Command
-> Command Handler
-> Input Guard (sanitize + validate + injection checks)
-> Rate Limiter
-> Gemini Service (prompt orchestration + retries/fallback)
-> Response Formatter + Smart Split
-> Discord Reply/Follow-up
For deeper technical details, see docs/ARCHITECTURE.md.
- Node.js 20+
- Discord bot token and application client ID
- Gemini API key
- Install dependencies:
npm install- Configure environment variables in
.env. - Register slash commands:
npm run register- Start the bot:
npm startDevelopment mode:
npm run dev| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
Yes | Discord bot token |
DISCORD_CLIENT_ID |
Yes | Discord application client ID |
DISCORD_GUILD_ID |
No | Guild-scoped command registration |
DISCORD_COMMAND_SCOPE |
No | global (default, DM + server), guild (server only), or both |
GEMINI_API_KEY |
Yes | Primary Gemini API key |
SERPER_API_KEY |
No | Search API key for /labs and /resource |
Additional tuning vars are available in src/config/env.js.
CyberCortex is designed to help:
- New learners build structured offensive methodology
- Intermediate students prepare for practical certifications
- Community members run exam-style simulation workflows in labs
- Users learn responsibly within explicit authorized scope
The goal is not automation, but disciplined security thinking.
CyberCortex is for authorized learning environments:
- Personal labs
- CTF platforms
- Internal approved simulation exercises
It is not intended for unauthorized real-world exploitation guidance.
CyberCortex demonstrates that AI can enhance cybersecurity education while maintaining safety, structure, and responsibility. It is built not as an exploit generator, but as a structured learning assistant for ethical practitioners.

