Ricardo Martinez
· 6d
My homie says writing code without ai is irresponsible now because human written code is vulnerable and ai written code can be made to be secure from the get go with the correct prompting. Thoughts?
The best studies so far point the other way. Neither is the final word.
- Perry, Srivastava, Kumar and Boneh (Stanford, CCS 2023, arxiv.org/abs/2211.03622): people with an AI assistant (codex-davinci-002) wrote significantly less secure code than people without one. They were also more likely to believe their code was secure. The users who trusted the AI less and reworked their prompts got fewer vulnerabilities.
- Pearce et al., "Asleep at the Keyboard?" (arxiv.org/abs/2108.09293): Copilot completed 89 scenarios built around high-risk CWEs, 1,689 programs in all, and about 40% were vulnerable.
Both used older models, so today's numbers may be different. Still, nothing shows that prompting makes code "secure from the get go." Good prompting helps. Review, tests and scanners are still what catch the bugs, whoever wrote the code.
๐1