- Start with what is exposed to the internet and what holds data. Fix secrets and access rules before anything else.
- Research finds AI-assisted and human code both ship vulnerabilities, and that most vulnerable changes merge without any security discussion.
- Finish by turning every fix into a test, so the next AI-generated change cannot quietly undo it.
Why the order matters
AI coding tools produce working software quickly, and the security evidence is mixed rather than damning. In Veracode's 2025 tests, 45 percent of AI coding tasks produced code with a known flaw 1. A 2026 study of 21,454 agent-written pull requests found vulnerabilities in 11.5 percent, close to the human rate in the same study, and found that almost none of the vulnerable changes received security review 2. The practical conclusion is that the risk is less about who wrote the code and more about whether anyone checked it. With limited time, check the places where a single mistake exposes the most.
Step 1: Inventory what is live
List every deployed app, its address, its hosting, its database and storage, the third-party services it calls and the AI models it uses. Note who can publish changes. Many organizations discover AI-built tools nobody in IT knew about; see Shadow AI is a governance problem first.
Step 2: Find and rotate secrets
Search the code, the history and the browser bundle for keys and tokens. GitGuardian's 2026 research reports that commits co-authored by one popular coding agent leaked secrets at roughly twice the baseline rate 3. Rotate anything found, move secrets server-side, and add secret scanning to every repository.
Step 3: Test access rules with real accounts
Broken access control is first on the OWASP Top 10:2025 4. If the browser talks directly to a hosted database, the rules on each table and storage bucket are the control 5. Test with two ordinary accounts and a signed-out session: can one user read or change another's records? Can someone outside the team join it?
Step 4: Check sign-in, payments and admin paths
Confirm that every sensitive action checks who the user is on the server, every time. Confirm that prices, plans and refunds cannot be changed from the browser. Look for admin routes that are hidden but not protected.
Step 5: Review dependencies and agent tools
Pin versions, remove unused packages and check for known vulnerabilities. If the app or its builders use agents with tools or MCP servers, inventory those too; see The tool layer.
Step 6: Review the AI features themselves
If the app includes AI features, map them against the OWASP Top 10 for LLM Applications 2025 6. The highest-value check is whether any feature combines private data, untrusted content and a way to send data out 7.
Step 7: Make it stick
Turn each fix into a regression test. Add required human review for changes to sign-in, access rules, payments and secrets. Write the secure patterns you settled on into the instructions your AI coding tools use. See The code verification flywheel.
What this means for your team
- Inventory first: you cannot secure what you have not listed.
- Fix secrets and access rules before cosmetic findings.
- Test with accounts that should be refused.
- Require human review on the change types that matter most.
- Keep every reproduction as a test.
This is Swallowtail Systems™ analysis of public sources. Figures belong to the organizations cited, and we link every one. Nothing here describes a client engagement.
Case studies on this topic
Sources
- Veracode, 2025 GenAI Code Security Report
- Le, Vijayanandan et al., "On the Security of Agentic Pull Requests in GitHub: An Empirical Study", University of Calgary
- GitGuardian, The State of Secrets Sprawl 2026
- OWASP Top 10:2025
- Supabase documentation, Row Level Security
- OWASP Gen AI Security Project, Top 10 for LLM Applications 2025
- Simon Willison, "The lethal trifecta for AI agents" (June 16, 2025)