A Fast, Reliable, and Secure Programming Language for LLM Agents with Code Actions

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Mell, Stephen, Zhang, Botong, Mell, David, Li, Shuo, Ramalingam, Ramya, Yu, Nathan, Zdancewic, Steve, Bastani, Osbert
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913893755912192
author Mell, Stephen
Zhang, Botong
Mell, David
Li, Shuo
Ramalingam, Ramya
Yu, Nathan
Zdancewic, Steve
Bastani, Osbert
author_facet Mell, Stephen
Zhang, Botong
Mell, David
Li, Shuo
Ramalingam, Ramya
Yu, Nathan
Zdancewic, Steve
Bastani, Osbert
contents Modern large language models (LLMs) are often deployed as agents, calling external tools adaptively to solve tasks. Rather than directly calling tools, it can be more effective for LLMs to write code to perform the tool calls, enabling them to automatically generate complex control flow such as conditionals and loops. Such code actions are typically provided as Python code, since LLMs are quite proficient at it; however, Python may not be the ideal language due to limited built-in support for performance, security, and reliability. We propose a novel programming language for code actions, called Quasar, which has several benefits: (1) automated parallelization to improve performance, (2) uncertainty quantification to improve reliability and mitigate hallucinations, and (3) security features enabling the user to validate actions. LLMs can write code in a subset of Python, which is automatically transpiled to Quasar. We evaluate our approach on the ViperGPT visual question answering agent, applied to the GQA dataset, demonstrating that LLMs with Quasar actions instead of Python actions retain strong performance, while reducing execution time when possible by 42%, improving security by reducing user approval interactions when possible by 52%, and improving reliability by applying conformal prediction to achieve a desired target coverage level.
format Preprint
id arxiv_https___arxiv_org_abs_2506_12202
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Fast, Reliable, and Secure Programming Language for LLM Agents with Code Actions
Mell, Stephen
Zhang, Botong
Mell, David
Li, Shuo
Ramalingam, Ramya
Yu, Nathan
Zdancewic, Steve
Bastani, Osbert
Programming Languages
Artificial Intelligence
Cryptography and Security
Machine Learning
Modern large language models (LLMs) are often deployed as agents, calling external tools adaptively to solve tasks. Rather than directly calling tools, it can be more effective for LLMs to write code to perform the tool calls, enabling them to automatically generate complex control flow such as conditionals and loops. Such code actions are typically provided as Python code, since LLMs are quite proficient at it; however, Python may not be the ideal language due to limited built-in support for performance, security, and reliability. We propose a novel programming language for code actions, called Quasar, which has several benefits: (1) automated parallelization to improve performance, (2) uncertainty quantification to improve reliability and mitigate hallucinations, and (3) security features enabling the user to validate actions. LLMs can write code in a subset of Python, which is automatically transpiled to Quasar. We evaluate our approach on the ViperGPT visual question answering agent, applied to the GQA dataset, demonstrating that LLMs with Quasar actions instead of Python actions retain strong performance, while reducing execution time when possible by 42%, improving security by reducing user approval interactions when possible by 52%, and improving reliability by applying conformal prediction to achieve a desired target coverage level.
title A Fast, Reliable, and Secure Programming Language for LLM Agents with Code Actions
topic Programming Languages
Artificial Intelligence
Cryptography and Security
Machine Learning
url https://arxiv.org/abs/2506.12202