Coding with AI tools

Stage 8 · Lesson 3 of 6

Insecure patterns AI repeats

Security and licences

Models learned from public code, including insecure code, so the same flaws appear again and again: SQL built by joining strings, which allows ; HTML output without escaping, which allows cross-site scripting (XSS); eval on user input; TLS certificate checks turned off to fix a connection error; CORS set to allow any website; weak or home-made password hashing; and missing checks that the user is allowed to do the action.

Learn this list well enough to spot each in seconds during review. Put concrete rules in your instructions file, such as "always use parameterised queries", rather than asking the tool to act as a security expert, which OpenSSF's guide notes does not help.

Common trapassuming code is safe because it works and the tests pass.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Practise

Keep handy

  • Scan your repository and its history for leaked keys before you push

  • What common open source licences require, in plain language

Also worth your time

Mark this stage as not done?