In a previous article I said that you don’t have to learn AI to use AI. I pointed out that if you know the domain, you can use AI proficiently. I mentioned that you should know something about what you are doing but I didn’t go in depth. Today I will, at least in some way.
Speaking about security, the first thing I ask a model to do is check all the produced code against the top 10 OWASP categories. These are a collection of rules of thumb to avoid deploying a website full of vulnerabilities. It’s not all you have to know, but it’s a great starting point. Do you remember Pareto, 80/20, that kind of stuff? Here we are, with 20% of effort we are ahead of 80% of other vibe coders who don’t know this stuff.
So, the first prompt will be something like: “Check the codebase against the top 10 OWASP categories and fix all the vulnerabilities you find.” When the model says “All done!” I start investigating what it actually did and what it didn’t. So I ask questions like:
- “Did you implement a rate limit for executions on login, register, and password recovery?”. Add your website forms, all. You have to check that after a small number of tries, the website stops responding to the same IP. This is not a sophisticated system, but it’s a first defense layer against the laziest attackers. You can expand this argument with captchas or account lockouts.
- “Did you check all public APIs against oracles?”. I can’t give a security course here, but oracles are hints helping an attacker to understand if a user exists on the database or not. This is a huge simplification, but take it as it is. You don’t want oracles in your systems. Ask the model to help you to understand what it means if you want to improve your knowledge (and you should want).
- “Did you check input sanitization?”. All the data sent to the website must be sanitized to avoid several attack techniques, e.g. XSS, command injection, and unauthorized access to server files. You want form data to be sanitized.
- “Did you check that all database query are made with parametrized queries or with an ORM?”. This, with data sanitization, helps to avoid database injections.
Then you should at least read the top 10 OWASP categories and try to think about your application: where might I have problems? After you identified possible vulnerabilities, ask the model to check if all is good about mitigation on those.
If you want to learn a bit more (and you should, did I already write that?) you can search for SAST (Static Application Security Testing) and automated tests in general, to include in your CI/CD (Continous Integration / Continous Deployment) pipeline: but considering the title of this article, I am afraid these topics could be a bit too advanced at this time.
Will these steps make your website bulletproof? Of course not. But it will be much more secure than if you didn’t do any of this. So, start with this checklist, and feel free to expand it with your increasing knowledge. But please, don’t put anything online if you didn’t verify this at least.