National Cyber Warfare Foundation (NCWF)login

secure-code-game for hands-on secure coding and AI security training in the browser


0 user ratings
2026-10-13 15:29:31
milo
Red Team (CNA)
"secure-code-game

secure-code-game is GitHub's free, gamified in-editor training platform that teaches developers and students secure coding and LLM/agent security through self-paced, browser-based challenges.








Toolskills/secure-code-game — GitHub's open source secure coding game played inside Codespaces
CategorySecurity education / secure coding training platform (JavaScript, MIT licensed)
Primary UseTraining developers on secure coding fundamentals, CodeQL, LLM defenses, and agentic AI security via seasonal levels in a Codespace
Safe UsePurely educational: played entirely in your own sandboxed Codespaces copy, ideal for onboarding, university courses, and authorized security team training
Telemetry NoteRuns entirely inside the learner's own GitHub Codespaces environment; consumes the free monthly Codespaces allowance and touches no external targets, so it leaves no footprint beyond the user's own repository and Actions-free template copy

secure-code-game is GitHub Security Lab's answer to the dry compliance training that most developers tolerate rather than enjoy. It is an open source, in-editor game — MIT licensed, written largely in JavaScript, and sitting at roughly 2,827 stars on GitHub — that turns secure coding practice into a series of progressively harder puzzles solved directly in GitHub Codespaces. The README reports over 10,000 players across industry and academia, and the pitch is deliberately low-friction: you can be playing in under two minutes from a browser with no local toolchain, no AI experience, and no prior security background required.


The structure is seasonal, and each season is self-contained, which is a smart instructional design choice — a team worried about prompt injection can jump straight into the AI material without wading through C memory-safety exercises first. Season 1 covers foundations in Python and C: web apps, systems programming, and data handling, at roughly six hours. Season 2 broadens to a multi-stack curriculum spanning CI/CD, backend services, and web applications, taught with CodeQL and built on GitHub Actions, Go, Python, and JavaScript, again around six hours of content.


The AI seasons are where the project has clearly invested its recent energy. Season 3 focuses on LLM security: defending LLM-powered applications through prompt design, careful input and output handling, and reasoning about connected data sources — the canonical OWASP LLM top-10 concerns — in about ninety minutes. Season 4, flagged prominently in the README as the newest drop, is entirely about agentic AI. You work inside a simulated, fully interactive AI coding assistant that converts natural language into bash commands, browses the web, connects to live data sources, runs org-approved skills, stores persistent memory, and orchestrates multi-agent workflows. The five levels target securing agentic workflows and multi-agent communications, which is a genuinely current curriculum; most security training content on agents is still stuck at 'prompt injection exists.'


Mechanically, deployment is a textbook use of GitHub's template-repository pattern. You click Use this template, create your own copy under a personal account or organization — the README recommends making it public so it does not consume Actions minutes — then open a Codespace via the Code button's Create codespace on main option. Extension and background installs complete in under three minutes, after which you open a season folder and follow its local README.md. That per-season README.md acts as the level hub, keeping the repository navigable despite four seasons of content living side by side.


One operational caveat the README states plainly: running the game in Codespaces counts against the sixty hours of monthly free allowance. For an individual that is trivial, but an engineering organization rolling this out to hundreds of developers should budget for it or accept that players will be nudged toward the public-repository recommendation. There is also a small usability note — the README tells you to dismiss any banner suggesting a virtual environment, since the game pre-configures its dependencies and doesn't need one. These small instructions matter because the project's whole value proposition is a frictionless first five minutes.


From an analysis standpoint, what secure-code-game really delivers is a sandbox that behaves like a real development environment. Because the puzzles run inside VS Code in the browser with actual language runtimes, the learner edits real Python, Go, or JavaScript, runs real static analysis with CodeQL, and gets graded by automated checks that validate the fix rather than a multiple-choice quiz. That is a meaningful step up from web-based security CTFs that abstract away the IDE, and it mirrors how a working engineer actually encounters vulnerabilities: mid-file, mid-editor, with the surrounding code distracting them.


The CodeQL integration in Season 2 deserves particular attention for defensive teams. CodeQL is the same semantic static-analysis engine GitHub uses in code scanning, so learners who complete the season are effectively practicing the workflow of writing and interpreting queries against real vulnerability classes in CI/CD pipelines. For a security team trying to bootstrap a devsecops culture, that dual value — training plus hands-on time with the tooling the organization already runs in GitHub Actions — makes this more than a gamification novelty.


The agentic Season 4 scenario is best understood as a defensive simulator. The in-game assistant's capabilities — shell execution from natural language, web browsing, live data-source connections, persistent memory, and multi-agent orchestration — map one-to-one onto the real architectural patterns (tool use, RAG, memory stores, agent-to-agent protocols) that are generating new incident classes today. Practicing against a simulated assistant lets developers internalize where trust boundaries blur when an LLM holds both instruction input and execution capability, without ever pointing anything at production systems.


Support and community plumbing look mature for a project of this type. There is a public CONTRIBUTING.md, an active GitHub Discussions area, a dedicated Slack channel (#secure-code-game on the GitHub Security Lab workspace), and a contactable team at [email protected]. The repository follows GitHub's own skills/course template conventions, with repository settings guidance (template mode, auto-delete head branches, disabled releases) baked into author comments — a sign of institutional maintenance rather than a hobby project likely to rot.


Who should adopt it? Three audiences stand out. First, engineering organizations that want a measurable onboarding artifact: a new hire finishing Season 2 has demonstrably touched CodeQL and CI/CD security concepts. Second, universities — the README explicitly claims academic adoption, and the MIT license plus zero-cost Codespaces path makes it classroom-friendly. Third, security teams preparing for AI features: Season 3 and Season 4 together form a compact (~3.5 hour) primer on LLM and agent abuse patterns that is currently hard to find elsewhere in free, hands-on form.


Limitations are worth naming honestly. The README is marketing-light on internals — there is no published level inventory, no architecture diagram of the grading harness, and no stated roadmap beyond the current seasons. Completion is self-reported rather than credential-backed, so it supplements rather than replaces formal certification paths. And because it is fundamentally single-player, teams wanting collaborative capture-the-flag energy will still need a companion event format.


As an educational artifact, though, secure-code-game is one of the better-executed examples of the 'learn by patching' genre. It runs in a fully authorized, self-contained sandbox — your own repository and Codespace — touches no third-party infrastructure, and its newest content tackles the exact agentic-AI failure modes the industry is currently scrambling to understand. For a defensive professional, it doubles as a curriculum map: the topics its levels cover are a reasonable checklist of what your developers should already know.



Official project repository for skills/secure-code-game.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/10/secure-code-game-for-hands-on-secure.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.