Ch07 Security And Tests
# Chapter 7 — Security, Testing, and Not Getting Sued
> **Hours 29-34.** The five leak sites, the 20-point audit, and the tests.
**The premise:** "Claude Code writes functional code. It does not write secure code
by default. It'll store passwords in plain text if you don't specify hashing. It'll
skip input validation if you don't ask for it. It'll leave API endpoints open to
the public if you don't mention authentication. It's not malicious. It's optimizing
for 'does it work?' not 'is it safe?'" (ch07:9)
> ⚠ **This chapter's checklist is a FLOOR, NOT A CERTIFICATION.** A 20/20 does not
> mean your app is secure. See [`DISCLAIMER.md`](../DISCLAIMER.md). Before you take
> payments or store health data, pay a security professional to review it.
---
## The five places AI-generated code leaks data
**ch07:25-114** · These aren't obscure edge cases. They're the same five problems, project after project.
### 1. Authentication that looks right but isn't
**ch07:35**when to use it
Community prompt sourced from the open-source GitHub repo regardo911/claude-code-beginners (MIT). A "Ch07 Security And Tests" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
codingcommunitydeveloper
source
regardo911/claude-code-beginners · MIT
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions