Language-Based Agent Control
Timothy Zhou, Loris D’Antoni, Nadia Polikarpova · 2026
Read Language-Based Agent Control by Timothy Zhou, Loris D’Antoni, Nadia Polikarpova (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-2605-12863.txt.
Introduction
Zhou, D'Antoni and Polikarpova introduce language-based agent control, a programming model that checks AI agents' programs against safety policies before they run. Borrowing static typing and runtime enforcement from conventional programming, the approach rejects unsafe agent code at type-checking time. Rules on access, data flow and provenance then cover agent behaviour and developer scaffolding alike. Three case studies test sandboxing, provenance and information flow.
Catalog record
| CREATOR | Timothy Zhou, Loris D’Antoni, Nadia Polikarpova |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 40210 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.12863
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Language-Based Agent Control Timothy Zhou, Loris D’Antoni, Nadia Polikarpova Abstract This paper introduces language-based agent control (LBAC), a new programming model for agentic applications that brings techniques from programming languages and language-based security to the problem of agent control. In conventional programming, combinations of static typing and runtime enforcement have long been used to guarantee that well-typed programs satisfy user-specified policies , including policies for access control, information flow, data provenance, and more. The key idea behind LBAC is to extend these guarantees to agentic applications by requiring agents to generate programs that are themselves well typed in the context of the surrounding scaffolding code. Unsafe programs are rejected by the type-checker before execution, allowing policies to apply uniformly across the entire application, including both agent-generated behavior and developer-written scaffolding. At the same time, LBAC preserves substantial expressiveness: agents may perform arbitrary side-effect-free computation and recursively invoke subagents, which retain full tool access subject to the same—or potentially more restrictive—policies. We demonstrate LBAC with three case studies: I/O sandboxing via filesystem capabilities, data provenance, and information-flow control. ode]haskell 1 Introduction Mainstream agent frameworks [ 18 , 2 , 12 , 33 , 5 ] force programmers to trade off expressiveness against control . Tool -based systems offer strong control but limited expressiveness by restricting the agent to a fixed set of actions, making safety and policy enforcement easier, but limiting composition and arbitrary computation. In contrast, sandboxed interpreters—such as Python or shell environments—maximize expressiveness by allowing agents to write programs, but only control coarse-grained system policies (e.g., file-system or network access). Such interpreters struggle to enforce application-level policies such as data provenance (“all entries you add to my bibliography must come from a trusted database”), information flow (“data from customer A should never be sent to customer B”), or policies scoped to sub-tasks rather than the entire agent (“spawn one sub-agent per customer; each sub-agent only has access to the data owned by that customer”). We introduce a new programming model for agentic applications, language-based agent control (LBAC), that reconciles strong control with high expressiveness . The key observation is that programming languages research has long addressed this tension between expressiveness and control using types [ 31 , 3 , 23 ] . Types can rule out unsafe program behavior without restricting expressiveness. If it type-checks, it is safe—even when the code is generated by an agent. The key idea of LBAC is to embed agents into a pure, type-safe programming language 1 1 1 A pure language has no side effects: that is, all the effects a program might perform are reflected in its type. We illustrate this concept in Sec. 2 . The most common example of a pure language is Haskell. , such that (1) the agent communicates with the world by writing code in the language; (2) the scaffolding code that comprises the agentic application is also written in the same language; (3) policies are specified using type signatures. By expressing policies as types in a shared language, LBAC ensures that the entire agentic application—both agent-generated code and surrounding scaffolding—adheres to the desired policy. Thus, our approach naturally supports a wide range of policies, including fine-grained capabilities (e.g., file-system or network access), data provenance and information-flow constraints, and task-scoped restrictions over subcomputations. While prior work has used types and static checks to constrain agent-generated code [ 6 , 15 ] , LBAC generalizes these approaches beyond their original focus on prompt injection, and importantly, is the first to leverage the shared language to provide a unified guarantee across the entire agentic application, which enables us to support a wider range of agent behaviors without compromising security ( Sec. 5 ). Contributions. We make the following contributions: (1) A new programming model for agentic applications , language-based agent control (LBAC), which reconciles strong control with high expressiveness by embedding agents in a pure, typed programming language and expressing policies as types over programs ( Sec. 3 ). (2) TypeGuard , a practical realization of LBAC , implemented in Haskell. (3) Case studies and evaluation demonstrating the breadth and effectiveness of LBAC. We instantiate LBAC for three policies: data provenance, file-system capabilities, and information flow control (IFC). Our IFC case study notably reuses the mature LIO library [ 27 , 26 ] , inheriting its guarantees and illustrating LBAC’s ability to build on prior programming languages research. We evaluate LBAC on AgentDojo [ 8 ] , showing comparable task utility to prior systems while providing stronger guarantees across the full agentic loop ( Sec. 4 ). 2 Motivating Example Library \code |dblpSearch| \code |dblpFetchBib| \code |appendToBibFile| + types (LBAC only): \code |:: String -> BibIO [DOI]| \code |:: DOI -> BibIO (Trusted Bib)| \code |:: FilePath -> Trusted Bib -> BibIO ()| “Find the earliest paper on differential privacy and add it to refs.bib .” Code interpreter Tools LBAC ( TypeGuard ) dblpSearch("differential privacy") ["10.1007", ...] dblpFetchBib("10.1007") "@inproceedings{Dwork2006, title={Calibrating noise...}, year={2006}, ...}" … fetchAndAppend("refs.bib","10.1007") ✓ trusted entry written. \blacktriangle cannot compute earliest paper \blacktriangle awkward tool design \code |do -- find relevant DOIs| \code | hits <- dblpSearch "diff. priv."| \code | -- get bib entry for each DOI| \code | bibs <- mapM dblpFetchBib hits| \code | -- find earliest| \code | return (minimumBy getDate hits)| "@inproceedings{Dwork2006, title={Calibrating noise...}, year={2006}, ...}" \code |-- use writeFile from std lib| \code |writeFile("refs.bib",| "@inproceedings{Dwork06, title={Algorithmic...}, year={2006}}" ) \blacktriangle used \code |writeFile| from the standard library to write a fabricated bib entry to the file. \code |do -- find relevant DOIs| \code | hits <- dblpSearch "diff. priv."| \code | -- get bib entry for each DOI| \code | bibs <- mapM dblpFetchBib hits| \code | -- write earliest entry to file| \code | appendToBibFile "refs.bib"| \code | (minimumBy getDate hits)| ✓ trusted entry written. ✓ \code |writeFile| would not type-check (does not return \code |BibIO|) \code |appendToBibFile| \code |fetchAndAppend| Figure 1: Implementing a literature search agent using a code interpreter, specialized tools, and TypeGuard (our approach). Sandboxed interpreters (left panel) enable expressive program composition, but allow the agent to bypass the library and fabricate entries using the raw file-write function from the standard library. Restricted tools (middle) enforce strong control by restricting access to trusted operations, but limit expressiveness; our example requires modifying the set of tools so that the only tool we provide for writing to file also fetches the bib entry directly from the database. TypeGuard (right) reconciles this tradeoff: the agent can write programs and compose operations freely, while the type system enforces that all written entries originate from trusted sources. We start by motivating LBAC through a simple example that positions it relative to the mainstream approaches—sandboxed interpreters and restricted tools. Consider implementing a literature-search agent that produces a BibTeX bibliography based on a user request. The agent should be free to perform arbitrary computation over its search results—sort by year, deduplicate, filter by venue—but every entry it writes to the bibliography must be a real record fetched from a trusted database such as DBLP, never a citation invented by the model. To support this task, the programmer implements a small BibTeX-manipulation library: \code |dblpSearch| returns the DOIs of papers matching a request, \code |dblpFetchBib| retrieves