Commit 48f2188
Season 4 Secure Code Game (#188)
* Add Season-4 folder
* Add README.md and remove .gitkeep
* Add TODO placeholders and rate limit notes to README.md
* Add Season-4 Level-1: minimal AI chat with Productivity Bot
* Adds base image to devcontainer configuration
* Add Season-4 npm install to devcontainer postCreateCommand
* Updates .devcontainer
* Add prodbot CLI: interactive AI-powered productivity bot for Season-4
* Fix npm link: cd into Season-4 before linking to avoid nested directory
* Replace npm link with direct symlink to avoid nested Season-4 directory
* Fix symlink: use absolute Codespaces path for prodbot
* Fix prodbot: use ~/.local/bin symlink with PATH export for Codespaces
* Refactor ProdBot: bash enabler with sandboxed prodbot-activities
- Replace structured JSON actions with bash command execution
- Add lib/bash.js: command validation (denylist, path confinement) + executor
- Add y/n confirmation before each command runs
- Sandbox all operations to Level-1/prodbot-activities/
- Remove obsolete code: code.spec.js, .utils/utils.js, actions.js
- Remove chat:Level-1 npm script
* Polish: remove .gitkeep, gitignore sandbox, add educational comments
- Delete .gitkeep (prodbot.js auto-creates sandbox on startup)
- Add Season-4/Level-1/prodbot-activities/ to .gitignore
- Add JSDoc and inline comments to bash.js, ai.js, prodbot.js
explaining security concepts, REPL flow, and API integration
* Add .gitkeep to Level-1/ so directory exists after cloning
* Add .gitkeep to prodbot-activities/, update gitignore to allow it
* Add Level-1 challenge: path traversal sandbox escape
- Add password.txt with flag BYPA55ED in realistic credential format
- Add hint-1.txt: read the validator code, spot the regex weakness
- Add hint-2.txt: base64 encoding can hide paths from regex
- Add hint-3.txt: bash variables bypass the .. regex check
- Add solution.txt: full walkthrough of both bypasses
- Add flag detection in prodbot.js: congrats banner on successful escape
* Improve hint clarity: add separators between approaches
* Fix hint-3: remove direct solution, guide without spoiling
* Fix border alignment, hint headers, and suppress deprecation warning
- Rebuild congrats banner with pad() function for consistent right border
- Replace em-dash with hyphen in all box headers (em-dash is double-width)
- Fix hint-1/2/3 header box widths to be consistent
- Suppress punycode DEP0040 deprecation warning from openai package
* Use bright chalk colors for vivid terminal output
- Switch welcome box to magentaBright/greenBright for vivid borders
- Switch congrats banner to bright variants (greenBright, yellowBright, etc.)
- Update help, prompt, and goodbye to use bright colors
* Use #FF00FF hex color for intense purple borders
* Use intense/bright colors consistently across all files
- banner.js: cyanBright, #FF00FF, greenBright, whiteBright
- ai.js: redBright for errors
- prodbot.js: yellowBright, cyanBright, redBright, greenBright
* Use #20C20E hex for intense green across all files
* Add persistent shell: variables and state survive across commands
- Replace execSync with a long-lived bash process (PersistentShell class)
- Shell state (variables, cwd) persists between commands like a real terminal
- Use marker-based output delimiting to capture command results
- Block 'exec' command to prevent shell replacement
- No timeout on commands (players can take their time reading hints)
- Shell auto-respawns if it crashes
- Opens a third bypass path: set D=.. in one command, use it in the next
* Reorder hints and solution: env var bypass first, base64 second
- Hint 2: now covers variable assignment regex gap
- Hint 3: now covers base64 encoding approach
- Solution: Bypass 1 is env var, Bypass 2 is base64
* Polish hints/solution: reorder, remove temp references, add sensitive data lesson
- Remove 'Execute? (y/n)' references from solution.txt
- Add split-command note for D=.. bypass in solution
- Move showCongrats to bottom of prodbot.js (away from player's view)
- Reword secure alternative 1: business-objective-aware framing
- Add secure alternative 4: never store sensitive data in reachable paths
* Remove unnecessary .gitkeep from Level-1 (directory has real files)
* Block tilde and bare cd sandbox escapes in validator
- Block ~ references (expands to $HOME at runtime)
- Block bare 'cd' (defaults to $HOME)
- Intended bypasses (env var, base64) still work
* Add Level 2: Indirect Prompt Injection via Web Search
- 12 simulated websites (social, weather, sports, shopping, travel, tech)
- Web search feature with keyword scoring and interactive thinking
- Level progression: auto-transition after L1, jump command (level <n>)
- password.txt with flag INDIR3CT
- Progressive hints (3) and full solution walkthrough
- Level 2 congrats banner
- ProdBot v2.0.0 with level-aware welcome, help, and flag detection
* Improve reddit content for better search matching on gardening queries
* Add JSON format troubleshooting to hint-3 and solution
Explains why the AI might summarise instead of executing, and
how to include the JSON format hint in the hidden instruction.
* Polish websites and content per review feedback
- Solution: mention indirect prompt injection in intro
- Hint 2: clarify web/ simulates public internet
- Remove github.html and microsoft.html
- Remove dates from accuweather, amazon, airbnb, skyscanner
- Airbnb prices in Euro
- LinkedIn: remove employer names from profiles and jobs
- Reddit: remove r/books section, keep gardening and cooking
- Weather.com: change from London to New York
* Weather.com: swap New York for London in Other Cities
* Add sources display and browser preview for web search
- Show Sources footer after AI responses from web search
- Add 'sources' command to list all sources from last search
- Add 'open <n>' command to view source in Codespace browser
- Update help menu with new commands (Level 2+)
- Add browser preview instructions to hint-1 and hint-2
- Track lastSources across searches for persistent access
* Polish Level 2 UI and content
- L1 solution: add quick one-liner example before WHY IT WORKS
- Banner: remove version, add 'Welcome to Level N', reorder lines
- Green 'enabled' for web search in banner
- Add spacing between web search reading and AI answer
- Colorful source listing with distinct colored square icons
- open <n> opens individual website directly
- Add 'open all' command for World Wide Web directory
- L2 solution: add all L1 bypass approaches adapted for injection
- Remove 'ignore all previous instructions' phrasing (Azure filters)
- Add SITE_COLORS palette and siteIcon() helper
* Add World Wide Web landing page and fix open commands
- Create index.html with branded colored cards in 2x5 grid
- Dark theme with gradient title matching ProdBot aesthetic
- open <n> now opens individual site directly (not dir listing)
- open all opens the World Wide Web landing page
- Reuse HTTP server if already running (ensureWebServer)
- Exclude index.html from web search results
* Fix open commands for Codespaces and add dynamic index
- Build correct Codespace URLs using CODESPACE_NAME env var
- Print clickable URLs instead of webbrowser.open (path was lost)
- Generate index.html dynamically to include user-created websites
- User-created sites appear with dashed border in distinct section
- Known sites get branded colors, user sites get 🌍 globe icon
- SITE_CATALOG replaces SITE_COLORS for richer metadata
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Auto-open browser with full Codespace URL
- Use webbrowser.open() with full Codespace URL (not localhost)
- Path is preserved because URL includes the file path directly
- Falls back to clickable link if auto-open fails
- Always prints the URL below for reference
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use terminal hyperlinks for cleaner open output
- Add termLink() using OSC 8 escape sequences for clickable text
- 'click here' appears as a styled hyperlink instead of raw URL
- Success: 'Opened! Check your browser tab or click here'
- Fallback: 'Server ready — click here to view.'
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add Bloomberg and Yahoo Finance to simulated internet
- bloomberg.html: dark theme, market indices, financial news, commodities
- yahoo-finance.html: top 20 tech stocks with ticker, name, price, change
- Add both to SITE_CATALOG with brand colors and icons
- Add financial keywords to web search patterns (stock, market, finance, invest)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add Level 3: Excessive Agency via over-permissioned MCP tools
- Three MCP servers: Finance, Web Automation, Cloud Backup
- Cloud Backup claims sandbox scope but BASE_DIR is Level-3/ root
- Player must read source code to discover the misconfigured scope
- tools/tool commands for MCP server inspection
- MCP routing detects 'use [tool]' patterns in natural language
- Level 3 flag detection and congrats banner
- Level 2→3 auto-transition after L2 completion
- Hints and solution with multiple exploit approaches
- .gitignore updated for Level 3 sandbox
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add agentic multi-tool workflow for financial research
When player asks 'research AAPL' or 'deep dive into MSFT', ProdBot
chains all 3 MCP tools with visual feedback:
1. Finance MCP → stock quote + market summary
2. Web Automation MCP → browse for news
3. Cloud Backup → auto-save research report
This normalizes Cloud Backup file operations, making the exploit
path (restore password.txt) feel natural.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Support company names in agentic queries and add example prompts
- Company name → ticker mapping (apple→AAPL, nvidia→NVDA, etc.)
- 'research nvidia stock for me' now triggers agentic workflow
- Added example prompts after Level 2 and Level 3 welcome banners
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix hint-1: remove irrelevant browser preview for JS source files
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix box alignment: use ASCII in MCP headers, fix em dashes in hints
MCP file advertisement headers switched from Unicode box-drawing
+ emojis to plain ASCII (+---+, | |) for consistent vertical
alignment across editors and terminals. Hint headers use -- not
em dash for byte-width consistency.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Polish MCP servers: simplify names, add comments, fix giveaway
- Stock names simplified (Apple, Microsoft, Google, not Inc/Corp)
- Alphabet has alias 'Google' in both finance-mcp and prodbot
- Added JSDoc comments to all MCP tools and helper functions
- Replaced giveaway comment in cloud-mcp ('NOTE: This should be
the sandbox...') with neutral 'Workspace root for backup'
- ASCII box headers already fixed in previous commit
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Enrich welcome prompts: one per website + agentic workflow diagram
Level 2: 12 verified prompts (one per simulated website), all
tested to trigger web search and hit the correct page.
Level 3: 3 research prompts + visual diagram showing the
Finance → Web → Cloud agentic workflow chain.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Reorder prompts and add linear agentic workflow diagram
- Accuweather moved to bottom of Level 2 prompt list
- Level 3: horizontal flow line before bullet details:
User Prompt → Finance → Web → Report → Cloud Backup
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* UI polish: Bloomberg alignment, prompt order, agentic display
- Bloomberg: right-align prices with min-width for vertical alignment
- Level 2: separate ESPN/Sky Sports in list for variety
- Level 3: 'These prompts trigger an agentic workflow:' label
- Finance emoji changed from Yen (💹) to chart (📈)
- Horizontal diagram: Cloud Backup (not just Backup)
- Market summary removed from on-screen display (kept in report)
- Research summary emojis match MCP server icons (📈, 🌐, ☁️)
- Numbered research files: 1-research-AAPL, 2-research-MSFT, etc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* UI polish: simplify web scan, fix icons, Level 3 welcome updates
- Web search: single '🌐 Scanning N websites...' instead of listing each
- Yahoo Finance icon: 📊 (was 💹 Yen chart)
- Bloomberg icon: 1 parent 363a625 commit 48f2188
110 files changed
Lines changed: 9022 additions & 275 deletions
File tree
- .devcontainer
- Season-1
- Season-2
- Season-3
- Level-1
- Level-2
- Level-3
- Level-4
- Level-5
- Level-6
- Season-4
- Level-1
- prodbot-activities
- Level-2
- prodbot-activities
- web
- Level-3
- mcp
- prodbot-activities
- web
- Level-4
- prodbot-activities
- skills
- env-setup
- meeting-notes
- onboarding
- snippets
- standup
- team-sync
- Level-5
- agents
- mcp
- templates
- prodbot-activities
- skills
- draft-pr
- assets
- label
- references
- summarise
- assets
- web
- bin
- lib
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
1 | 12 | | |
2 | 13 | | |
3 | 14 | | |
| |||
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| |||
303 | 315 | | |
304 | 316 | | |
305 | 317 | | |
306 | | - | |
| 318 | + | |
| 319 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | | - | |
| 9 | + | |
12 | 10 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
16 | 12 | | |
17 | | - | |
| 13 | + | |
18 | 14 | | |
19 | | - | |
| 15 | + | |
20 | 16 | | |
21 | | - | |
| 17 | + | |
22 | 18 | | |
23 | | - | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
29 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
30 | 48 | | |
31 | | - | |
| 49 | + | |
32 | 50 | | |
33 | | - | |
| 51 | + | |
34 | 52 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 53 | + | |
42 | 54 | | |
43 | 55 | | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | | - | |
| 63 | + | |
50 | 64 | | |
51 | | - | |
| 65 | + | |
0 commit comments