mlsanityData to 7 Oct 2026

TypePilot: Leveraging the Scala Type System for Secure LLM-generated Code

arXiv 2510.11151 ↗First posted 13 Oct 2025cs.CL cs.CRcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language Models (LLMs) have shown remarkable proficiency in code generation tasks across various programming languages. However, their outputs often contain subtle but critical vulnerabilities, posing significant risks when deployed in security-sensitive or mission-critical systems. This paper introduces TypePilot, an agentic AI framework designed to enhance the security and robustness of LLM-generated code by leveraging strongly typed and verifiable languages, using Scala as a representative example. We evaluate the effectiveness of our approach in two settings: formal verification with the Stainless framework and general-purpose secure code generation. Our experiments with leading open-source LLMs reveal that while direct code generation often fails to enforce safety constraints, just as naive prompting for more secure code, our type-focused agentic pipeline substantially mitigates input validation and injection vulnerabilities. The results demonstrate the potential of structured, type-guided LLM workflows to improve the SotA of the trustworthiness of automated code generation in high-assurance domains.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 8 of its 15 references that are in the map. First posted on arXiv 13 Oct 2025.

Builds on

8 of 15 references.

References · 8

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  3. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
  4. 2023How Secure is Code Generated by ChatGPT?cited by 77
  5. 2024Instruction Tuning for Secure Code Generationcited by 63
  6. 2025BaxBench: Can LLMs Generate Correct and Secure Backends?cited by 38
  7. 2024A Case Study of LLM for Automated Vulnerability Repair: Assessing Impact of Reasoning and Patch Validation Feedbackcited by 22
  8. 2025TFHE-Coder: Evaluating LLM-agentic Fully Homomorphic Encryption Code Generationcited by 4

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026STELP: Secure Transpilation and Execution of LLM-Generated Programs
  2. 2024AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testing
  3. 2025SCGAgent: Recreating the Benefits of Reasoning Models for Secure Code Generation with Agentic Workflows
  4. 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agents
  5. 2025SEC-bench: Automated Benchmarking of LLM Agents on Real-World Software Security Tasks
  6. 2025StackPilot: Autonomous Function Agents for Scalable and Environment-Free Code Execution
  7. 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-bench
  8. 2026Automating Formal Verification with Agent-Guided Tree Search