Prompt Syntax Shapes Secure Code Generation in Open LLMs
A new preprint demonstrates that fine-grained syntactic variations in prompts—such as the inclusion and placement of constraints, guards, and conditions—consistently influence the security of code generated by open large language models (LLMs). The study systematically evaluates how these prompt elements affect vulnerability risk across multiple open LLMs and programming languages. The results offer actionable guidance for developers seeking to reduce security flaws in LLM-assisted code generation.
Why it matters: This research establishes prompt syntax as a practical lever for improving code security in open LLMs, enabling more secure AI-assisted software development.
Full story at: arXiv Cryptography and Security ↗