Ruhr University Study Finds Gemini Fails to Meaningfully Secure Developer Code
A controlled study with 159 developers finds that Gemini, free or paid, does not close the security gap left by inexperience.
ProTakeaways
- A study of 159 developers found Gemini did not significantly improve code security versus no AI.
- Programming experience raised the odds of higher security scores by 1.43x per standard deviation (p=0.002).
- Paid Gemini Advanced showed no statistically significant security advantage over the free version.
- Password storage improved 21.7% with Gemini; SQL injection 10.5%; CSRF and input validation showed essentially no change.
- Developers with self-reported security experience trended toward lower scores, suggesting possible overconfidence effects.
- Trust levels were nearly identical for free and paid Gemini (Mann-Whitney U test, p=0.70 general trust).
A new study from Ruhr University Bochum and collaborators put Google's Gemini through a controlled experiment to see whether AI coding help actually produces more secure software. The short answer: it doesn't hurt, but it doesn't meaningfully help either, and paying for Gemini Advanced buys nothing statistically significant over the free tier. What did move the needle was old-fashioned programming experience.
The setup
The researchers recruited 159 freelance developers on Upwork and split them into three groups: a control with no AI, a group restricted to the free version of Gemini, and a group given login credentials for a paid Google One account with access to Gemini Advanced. Each participant had roughly two days to build a Linktree-style Flask web app with user registration, login, and endpoints to add and delete websites tied to an account. Everyone was told to pay attention to security.
Submissions were scored on five common vulnerability classes: Cross-Site Scripting (XSS), Cross-Site Request Forgery (CSRF), Improper Input Validation, SQL Injection, and Cryptographic Failures (mainly password hashing). Two researchers reviewed each submission independently, then cross-checked findings using Bandit and SonarQube, both listed by OWASP. The final score ran from 0 to 5.
Experience beat the model
The headline result is that programming experience, measured in years, was the only variable with a clean statistically significant effect on code security. A one-standard-deviation increase in overall experience raised the odds of a higher security score by a factor of 1.43 (95% CI [1.14, 1.81], p = 0.002), corresponding to a predicted success rate rising from 30% at mean experience to 38% at +1 SD. The relationship was approximately linear with a Pearson r of 0.20.

Self-reported prior security experience trended in the opposite direction. Developers who claimed prior security experience tended to have lower odds of a higher score (0.75, 95% CI [0.55, 1.01], p = 0.058). The effect narrowly missed conventional significance, but the direction is worth flagging: participants who identified as security-aware produced software that, on average, scored lower than those who did not. The authors suggest overconfidence may be at play, with self-identified security folks skipping validation steps they assumed they had covered.
Free vs paid Gemini: a wash
Mean security scores landed at 1.81 for No-AI, 2.07 for Free-AI, and 2.26 for Paid-AI. The omnibus test on group assignment was only marginally significant (p = 0.077), and pairwise contrasts did not reach conventional significance. Trust ratings were essentially identical across the two Gemini variants, with a Mann-Whitney U test returning p = 0.70 for general trust and p = 0.78 for trust in generating secure code.
The vulnerability-by-vulnerability breakdown is where things get interesting for anyone deciding whether to lean on an assistant for security-critical work:
- Password storage: 21.7% fewer insecure implementations with Gemini assistance
- SQL Injection: 10.5% improvement, likely because parameterized queries are well-represented in training data
- XSS: Only 3.5% improvement, with 66-85% of AI-assisted submissions still vulnerable
- CSRF: Essentially unchanged, with roughly 94% of submissions vulnerable across groups
- Improper Input Validation: No improvement, and slightly worse in the Free-AI group
Password hashing is a clear win. Participants received a point for hashing and salting credentials using state-of-the-art schemes such as bcrypt, scrypt, or Argon2, and Gemini reliably nudged people toward those libraries. CSRF and input validation, on the other hand, appear to be blind spots the model does not raise unless prompted explicitly.
What developers actually did with the tool
The behavioral data adds texture. The paid group issued far more prompts on average (median 10, mean 29.6) than the free group (median 5, mean 11.6), yet adopted a similar share of suggestions (around 57%). Qualitative responses show two distinct usage patterns. Experienced developers treated Gemini as a sanity check, cross-referencing outputs against documentation and their own knowledge. Less experienced participants tended to accept suggestions more directly, which occasionally helped them stumble into secure defaults they wouldn't have chosen unaided but also left them exposed when Gemini omitted critical measures. Several participants flagged that the assistant generated code based on older versions of bcrypt or failed to include hashing at all in initial responses.
What it means for practice
The paper is not a benchmark of Gemini in isolation, and no code or model artifacts are released, which limits reproducibility beyond the study design itself. The practical takeaways are still useful for anyone integrating AI into a secure development workflow:
- Do not treat Gemini as a substitute for security review. Static analysis, threat modeling, and code review still catch the classes of bugs (CSRF, input validation, XSS) the model tends to miss.
- The paid tier does not appear to justify itself on security grounds alone in this task. Free Gemini produced statistically indistinguishable code.
- Password storage is a legitimate area where the assistant can pull juniors up to a reasonable baseline.
- Overconfidence may be a bigger risk than under-tooling. Developers who self-identify as security-aware may still miss vulnerabilities without external checks.
The full paper is on arXiv, and the methodology section includes the full binomial GLM specification and codebook for anyone who wants to replicate the study with a different assistant or task.