STELP: Secure Transpilation and Execution of LLM-Generated Programs
Swapnil Shinde, Sahil Wadhwa, Andy Luo, Akshay Gupta, Mohammad Shahed Sorower · 2026
Read STELP: Secure Transpilation and Execution of LLM-Generated Programs by Swapnil Shinde, Sahil Wadhwa, Andy Luo, Akshay Gupta, Mohammad Shahed Sorower (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-05467.txt.
Introduction
Swapnil Shinde and 4 co-authors propose STELP, a 2026 system for running code written by language models without letting risky code loose. Model-generated code can contain errors, vulnerabilities, or malicious pieces, yet automated production systems often cannot rely on human review. STELP transpiles and executes such programs inside a controlled, safer setting.
The team also contributes a human-validated dataset of insecure code snippets. Benchmarks on public datasets compare correctness, safety, and speed against an existing method, with STELP ahead by a wide margin, especially on risky snippets. The paper includes malicious examples, so the authors warn readers to run them with caution.
Catalog record
| CREATOR | Swapnil Shinde, Sahil Wadhwa, Andy Luo, Akshay Gupta, Mohammad Shahed Sorower |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 40 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-05467
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
STELP: Secure Transpilation and Execution of LLM-Generated Programs Swapnil Shinde, Sahil Wadhwa, Andy Luo, Akshay Gupta, Mohammad Shahed Sorower Abstract Rapid evolution of Large Language Models (LLMs) has achieved major advances in reasoning, planning, and function-calling capabilities. Multi-agentic collaborative frameworks using such LLMs place them at the center of solving software development-related tasks such as code generation. However, direct use of LLM generated code in production software development systems is problematic. The code could be unstable or erroneous and contain vulnerabilities such as data poisoning, malicious attacks, and hallucinations that could lead to widespread system malfunctions. This prohibits the adoption of LLM generated code in production AI systems where human code reviews and traditional secure testing tools are impractical or untrustworthy. In this paper, we discuss safety and reliability problems with the execution of LLM generated code and propose a S ecure T ranspiler and E xecutor of L LM-Generated P rogram (STELP) , capable of executing LLM-generated code in a controlled and safe manner. STELP secures autonomous production AI systems involving code generation, filling the critical void left by the impracticality or limitations of traditional secure testing methodologies and human oversight. This includes applications such as headless code generation-execution and LLMs that produce executable code snippets as an action plan to be executed in real time. We contribute a human-validated dataset of insecure code snippets and benchmark our approach on publicly available datasets for correctness , safety , and latency . Our results demonstrate that our approach outperforms an existing method by a significant margin, particularly in its ability to safely execute risky code snippets. Warning: This paper contains malicious code snippets that should be run with caution. * * footnotetext: Work performed while at Capital One. Introduction Improvements in reasoning and code generation abilities of LLMs have led to their growing adoption in complex and challenging use cases. Currently, a highly active area of research centers around developing multi-agentic system that can understand user queries, reason, generate action plans, and execute them along with function/tool calls ( 20 ; 38 ; 37 ; 22 ; 55 ) . In the software development domain, LLMs are being adopted for tasks such as code generation and repair ( 6 ; 60 ; 29 ; 46 ; 57 ) , garnering substantial interest from both academia and industry. These breakthroughs bring immense potential but also a key challenge for real-world adoption: How can we ensure the safe and accurate execution of LLM-generated code in production systems? LLMs are known to be vulnerable to hallucinations, malicious attacks, and other security risks ( 25 ; 33 ; 43 ) . Direct execution of LLM-generated code, especially with real-world tools, poses a major risk. Figure 1 a illustrates a simple scenario of an LLM generating an action plan or code infused with a hallucinated function call and a resource exhaustion attack. Even a small LLM-generated code snippet can potentially cause a cyber-outage resulting in significant damage ( 7 ; 36 ) . The widespread deployment and integration of autonomous multi-agentic code generation systems—whether for routine software development or for critical decision-making in high-stakes domains—presents a formidable challenge. This demands a safety-first LLM generated code execution engine that can reliably stop malicious and unintentional code execution. We propose a secure code execution engine inspired by Transpilers: programs that transform and compile code from one programming language to another. Various transpilers including ClojureScript , Nim , and Fable Python , not only enable cross-language compilation but can also facilitate code migration between versions of the same language. In addition, recent research explores the alignment of LLMs with computer systems ( 41 ; 30 ; 17 ) , which shares a philosophy similar to our work. Our primary contribution is the architecture of S ecure T ranspiler and E xecutor of L LM-Generated P rograms (STELP) engine to meet various security and reliability needs. It employs the transpiler paradigm to validate and transform potentially unsafe LLM-generated code into secure and executable code, incorporating safeguards that prevent faulty or malicious code blocks from running. We also contribute a quality-controlled, human-validated code dataset of 634 samples as part of our work, InjectedHumanEval * * * https://tinyurl.com/24aebhmr , to test the risk tolerance and safe execution capabilities of STELP. To the best of our knowledge, this is the first approach to enable safe, reliable, and controllable execution of LLM-generated code, configurable in accordance with an organization’s risk tolerance. We detail the underlying algorithms and provide implementation insights in Python, illustrating three key use cases: (i) Agentic systems, where LLMs generate code snippets, action plans with external function or tool calls; (ii) Code-generating LLMs in AI-driven software development; and (iii) Test harnesses for executing code-generation benchmarks. Background And Related Work LLMs have the ability to generate, understand, and reason with programming code. They are able to perform a wide range of tasks in typical programming workflows ( 23 ) , ( 56 ) , ( 58 ) , ( 52 ; 32 ) . Several tools, such as Github Copilot ( 18 ) , merge LLM code generation directly into integrated development environments (IDEs), increasing task completion speed ( 42 ) and the proportion of code contributed by LLMs ( 12 ) . Software development vulerabilities are classified by taxonomies such as CWE ( 9 ) by MITRE and OWASP Top 10 ( 40 ) . Defenses against these vulnerabilities span the entire development cycle, from security analysis and SAST during coding to integration tests, DAST in QA, and ongoing red-teaming and penetration testing in pre and post production. LLMs sometimes generate code with vulnerabilities and other code smells ( 3 ; 35 ; 51 ) . Recognizing these vulnerabilities is a crucial aspect of executing LLM-generated code and/or integrating it into software development production systems. In multi-agentic code generation systems ( 22 ; 45 ; 24 ; 13 ) specialized agents are developed to solve a specific subtask using LLMs, for instance, planning, programming, testing, etc. These agents communicates with each other iteratively exchanging and improving code snippet. In most cases it requires a human to review and accept generated code using a chat-bot in IDE. This human intervention prohibits adoption of LLM generated code in headless workflows and low latency code execution systems. In several agentic use cases, LLM-generated code must be executed immediately after generation. Traditional security operations may not meet those requirements, though one proposed approach in existing literature is to execute the LLM-generated code in isolated containerized sandboxes ( 16 ; 61 ; 15 ; 48 ; 8 ) . Other works focus on prompting the LLM (with or without feedback from compilers, executors, analysis systems, and/or formal verification) to steer it toward generating a secure code ( 31 ; 50 ) , and unified action space ( 54 ) . Code-generation LLMs themselves can be further optimized ( 14 ; 34 ) for better coding performance, or have decoding constraints applied to avoid generating known vulnerabilities ( 49 ) . Recent research from Meta’s CodeShield ( 39 ) addresses similar problem but offers limited security coverage and lacks configurable controls, like, external tool-calling failure recovery, feedback loop, etc. While valuable, these strategies have drawbacks. Sandboxes