Elena' s AI Blog

I Asked AI to Audit My Flask App. First, I Had to Audit the AI

27 Jul 2026 (updated: 24 Aug 2026) / 22 minutes to read

Elena Daehnhardt

Claude: a five-panel poster showing the four AI security skills (code reviewer, authorisation tester, runtime scanner, findings verifier), Bandit's exclude-flag bug dropping 4,011 false findings to 2, Trivy's docker-compose.yml coverage gap, the open-redirect and host-header-injection vulnerabilities found and fixed, and the six-rule checklist.


TL;DR:
  • I asked ChatGPT to draft a security-testing framework, then had Claude Sonnet 5 turn it into four reusable "skills" for reviewing Flask apps.
  • The skill set orchestrates Bandit, Semgrep, pip-audit, and Trivy, and uses OWASP ASVS 5.0 (released 30 May 2025) as its master checklist.
  • A live test against my own Flask app caught two mistakes in the skills' own instructions: Bandit's exclude flag silently skipping nothing when given bare directory names, and Trivy's built-in misconfiguration checks not covering docker-compose.yml at all.
  • The same test found two real vulnerabilities in my app — an open redirect and a password-reset email that trusted an attacker-controllable header — both fixed and verified the same day.
  • The four skills now live in my reusable skills repository, ready to run against the next Flask app I build, not just this one.

How to Audit a Flask App With Reusable AI Security Skills

I do not enjoy security audits. I suspect most developers do not put them at the top of their Friday-afternoon wish list either. They are the kind of task everyone agrees is important and nobody wants to do this week, which is exactly why “we will get to it eventually” projects stay unaudited until something goes wrong. I have a small Flask app I built to track my own AI subscriptions — which tools I actually use, what they cost, whether they are earning their place — and I wanted it checked properly before I trusted it with my own data. Not a five-minute glance. A real review.

So instead of asking an AI agent to vaguely “check the security” of my app, I built something I can reuse. This post is about that process: how a ChatGPT brainstorm turned into four reusable Claude skills, what tools they run under the hood, and — this is the part I actually want you to remember — how testing them against a real app immediately caught mistakes in their own instructions, before those mistakes could waste anyone’s time later.

If you build small tools with AI assistance the way I do (I wrote about my general workflow for turning prompts into deployed apps a while back), this is the missing piece: a repeatable way to check what you shipped actually holds up.


Why a Reusable AI Security Skill Beats a One-Off “Check My Security” Prompt

An AI skill is a versioned instruction file — scope, permitted tools, required output format — that an AI agent loads and follows the same way on every run, rather than a prompt improvised per conversation. That difference is the whole point of this post.

“Please check this app for security issues” is not an instruction. It is a wish. An AI agent given that prompt alone will either invent plausible-sounding vulnerabilities that are not real, or miss the boring, well-documented ones that actual scanners catch in seconds. Neither outcome is useful, and both waste your time verifying claims that should have been solid in the first place.

I asked ChatGPT to sketch out what a proper version of this would look like, treating it the way a security consultancy would: narrow, repeatable checks, each with a defined scope, a list of permitted tools, and an expected output format. ChatGPT’s answer was a ten-skill breakdown — a code reviewer, an authorisation tester, a test generator, a dependency auditor, a headers auditor, a dynamic scanner, an authenticated-journey scanner, an abuse tester, a secrets reviewer, and a findings verifier — plus its own advice not to start with all ten at once. Fewer, more reusable skills beat ten independent agents nobody keeps maintained.

I fed that whole brainstorm to Claude, which had just finished building the subscription-tracking app, and asked it to turn the recommendation into something real: a skill set generic enough to run against this app today and any other Flask app I build later, saved in my own reusable skills repository rather than living only in one conversation.

You've hit a Deep Dive tutorial.

I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):

Already a subscriber? Use the magic link from your last newsletter, or reset your password.

New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.



Citation
Elena Daehnhardt. (2026) 'I Asked AI to Audit My Flask App. First, I Had to Audit the AI', daehnhardt.com, 27 July 2026. Available at: https://daehnhardt.com/blog/2026/07/27/creating-and-using-security-scan-skills/
All Posts