Check an app built with Claude Code for security problems
Claude Code writes working code quickly. It does not always write code that keeps one customer's data away from another's. Here is a workflow that keeps you in control.
1. Run a local scan from inside Claude Code
Paste this prompt. Your agent explains each step and asks before installing or editing anything.
I want to check this project for security problems using the Exera Security local scanner. Please: 1. Explain what you are going to install and from where, and ask me before installing anything. 2. Install it from the official source only: https://github.com/Exera-Ltd/Exera-Security-Scanner (engine/ folder), into an isolated environment (for example `uv tool install ./engine` after cloning, or a virtualenv). 3. Run `exera-security privacy` and show me what will and will not leave my computer. 4. Run `exera-security scan .` in this project. It runs locally in private mode and uploads nothing. 5. Summarise the findings in plain language, most serious first, and say which are unverified. 6. For any fix, show me the change and ask before editing files. Add a regression test for each fix. 7. Re-run the scan to confirm the finding is gone. Do not commit, push or deploy without asking me.
2. Fix one finding at a time
For each finding, run exera-security show SEC-0001 --prompt claude-code. The prompt contains the evidence, the rule your app should follow (for example "customers may only read their own invoices"), and a requirement to add a regression test.
3. Verify, then re-scan
A fix is not done because the agent says so. Run your tests, then scan again. The finding's fingerprint should disappear.
What to watch for in AI-generated code
- Database lookups by id with no owner or organisation filter
- Supabase service-role keys in browser code, or tables without Row Level Security
- API routes that change data without checking the session
- Secrets in
.envfiles that are not in.gitignore - Debug settings and permissive CORS left on in production
Privacy note: in this workflow your coding agent reads the scan results. Claude Code processes that data according to its own provider settings. The Exera scanner itself uploads nothing.