Module 9: Security
Proof rather than hope: systematic audits for secrets, hallucinated packages, vulnerable dependencies, exposed database tables, and the new attack surfaces AI tooling itself creates.
Lessons
- The leak that names no key. A short try-out, then three staged hunks. Choose what stays staged, commit, push, and watch a charge fail.
- Packages that prove themselves. Eight dependency changes in two batches. Give each a green light or a red flag, then install and commit.
- Deny rules that hold. Priya's committed settings.json, in two batches of four lines. Flag every line that does not do what she thinks, then commit and test.
- Text a stranger wrote. Four situations: a fetched page, a cloned repo, an MCP server, a script. Predict one, set up and run three.
- A gate on every commit. A pre-commit gate in five parts. Set each part, run it on a test commit, fix what turns red.
- Fresh check. A case you have not seen, in two decisions: what a refused Read call proves, and what it does not.
What you take away
- Treat any secret that touched a pushed commit as public: rotate first, clean history second
- Verify every AI-suggested package on the official registry before installing; slopsquatting is a real attack
- Triage vulnerabilities by reachability: fix what is exploitable in your context, document what you accept
- A table in an exposed schema without RLS is accessible to a role only with the required grants; check exposure, grants and row policies separately, then test actual role access
- MCP servers and fetched web content are attack surfaces: audit servers like dependencies, treat third-party text as data, never as instructions
Field exercises
- Run a Full Repository Security Scan
- Review Secret Configuration and Startup Checks
- Hunt Hallucinated and Typosquatted Packages
- Triage Known Vulnerabilities Like an Operator, Not a Checkbox
- Sweep Your Entire Git History for Leaked Secrets
- Audit Supabase RLS Before a Scanner Does It for You
- Audit Your MCP Servers Like the Dependencies They Are
- Red-Team Your Own Agent Against Prompt Injection
- Audit Project Security With BMAD
- Harden a project with security review