- Rating
- 3
- Clarity
- 3
- Confidence
- 4
- Originality
- 3
- Quality
- 3
- Significance
- 2
Read review
Summary
This manuscript introduces a programming language for LLMs and a corresponding agentic architecture in which the type system of the language provides guardrails on agent behavior. In their system, LBAC, the user writes a program which:
- Specifies a concrete type for an agent-written program; for example, this program could have a type which indicates that it performs IO operations
- Invokes the agent to produce a program which passes the type checker; if it does not, then the program is not executed The key idea is that a sophisticated type system is able to guarantee a rich set of possible invariants for the agent-written program. The concept is instantiated in a Haskell-based language, TYPEGUARD.
Strengths and weaknesses
This is a conceptually appealing and novel solution to an important problem. The approach of “give your agent a tool for every thing it might need to do” has been falling out of favor because a million custom tools cause context bloat, and agents often fail to select the right tool in practice. Thus the emerging paradigm is something like “bash/python is all you need” – just give the agent one tool, code execution, with arbitrary capabilities. However, making such an agent secure or producing any kind of guarantee about its behavior is a nightmare. It is well motivated to address this at the programming language level, and in particular using type systems is a natural approach which could leverage some really sophisticated tools that have been developed in the PL world for producing guarantees about the behavior of programs.
An additional strength is that some of the specific language design choices in TYPEGUARD are well-considered. It is a good choice to build upon Haskell and its type system, which seems to have the right combination of properties: it is statically typed, which is clearly a necessity here; it has robust type inference, which likely makes the system more ergonomic (although I wouldn’t say this is demonstrated empirically); and functions in the language are typed according to their side effects, which is basically the key idea of the paper.
An interesting choice is that the agent function does not hard-code an agent loop, and instead the agent calls itself recursively with a new prompt to give itself its next turn. This is an elegant approach. It is reminiscent of RLMs (which should probably be cited), but different in that the “recursive agent” is not really a subagent but properly a successor turn to the same agent – or maybe more precisely, there is no proper distinction between these things the way there is in RLMs. I actually like this approach better than the RLMs approach to recursion. However, my enthusiasm for this choice is diminished by the lack of evidence that LLMs can actually make use of it effectively (see below).
I have the following major concerns.
-
There are almost no empirical results. Are existing LLMs actually able to use the language to perform nontrivial work, and what is the performance cost of doing so? Currently, the only empirical results in the manuscript are a methods comparison against CaMeL, a prompt-injection avoidance method I had not heard of, on a task designed to test prompt injection robustness. It is great that the system succeeds in avoiding prompt injection, which I guess it guarantees formally although I didn’t follow this argument. However, what is the cost to performance? The comparison against CaMeL makes it seem the tradeoff is similar, but what about a comparison against a system without guarantees? This is a key question because the central pitch is that LBAC gives “expressiveness and control”, i.e., that control does not come with its usual drawbacks. Expressiveness may not be the same thing as performance exactly, but this pitch would definitely look less appealing if it turns out that the tradeoff in performance is severe.
-
Prior literature does include several competing systems (besides CaMeL) which the authors should cite or discuss. None of these systems are equivalent to LBAC, and subjectively I prefer LBAC conceptually, but they challenge the way the authors frame the state of the art: it isn’t the case that right now one must choose between tool use and arbitrary code execution. Here are papers I found in my literature search: https://arxiv.org/abs/2403.04960 https://arxiv.org/abs/2310.08535 https://arxiv.org/abs/2309.09919 https://invariantlabs.ai/theme/research/ai_agents_with_formal_security.pdf
Questions
If I wanted to use this approach on a real agentic task – say, do some internet search, create some data visualization, write a report – would LBAC actually work? How would it compare against a traditional harness with (a) constrained tool use and (b) unconstrained code execution? I would be more supportive in my evaluation if benchmarking analyses showed limited performance degradation versus traditional agent harnesses on multi-turn agentic tasks not oriented specifically toward safety.
What kinds of constraints can and cannot be enforced? Say a developer begins with an informal constraint, like “my agent shouldn’t exfiltrate user data to untrusted servers”. How might they formalize this into a type system, and what limitations are there to this approach? It would benefit the clarity of the manuscript to provide some clear guidance, intelligable to users not familiar with Haskell and its type system, about what constraints can be implemented.
Limitations
It is not currently clear either the theoretical limitations of the approach or the practical limitations of an agentic system which uses it.
Paper formatting concerns
None
Final justification
The authors' rebuttal addresses some of my concerns: the system can complete tasks involving several turns (even though most tasks were indeed one-shot), and the performance penalty on AgentDojo is fleshed out, particularly the insight that the policy makes many of these tasks impossible to complete. This is not exactly encouraging as far as how practical the system is, but at least it begins to address the question of what fundamental limitations or tradeoffs it has.
I remain concerned that existing systems, although different from this one, do not fit the description of what is currently SOTA; I am also concerned that this approach has fundamental tradeoffs which are now at least partially explored.
I would not recommend acceptance but also would not object to it. If the paper is ultimately accepted, I would urge the authors to be maximally transparent in paper-ready manuscript about these tradeoffs. In particular, the fact that some of the AgentDojo problems are theoretically impossible under the policy is a real tradeoff in the system.
We thank the reviewer for the detailed feedback. We address each weakness and question. Because our update evaluation is contained in the answer to aNKY, we often refer to it.
Thank you for pointing out the omission, we will cite and discuss RLMs. As the reviewer points out, the fact that
agentcan generate programs which recursively callagentis one of the the main novelties of LBAC.See our updated utility results (Table A, answer to aNKY) and our new BibTeX data (Table E, answer to aNKY) — in short, TypeGuard achieves higher utility than CaMeL, completing roughly twice as many tasks with policies enforced and ~15% more without. The total runtime of TypeGuard on AgentDojo is about 3x that of CaMel's: this is primarily due to the fact that CaMeL generates a single program upfront, whereas TypeGuard agents perform additional LLM calls to generate programs in response to data (which increases expressiveness, and ultimately, utility).
We thank the reviewer for these pointers; we will cite and discuss these and other relevant work, and we agree they show the state of the art is not a binary choice between tool use and arbitrary code execution. LBAC provides formal guarantees which apply to the whole-system (across agent and scaffold).
A pattern that works well with LBAC is defining a safe API around the operations the agent needs, where the API enforces the desired properties. The reviewer's tasks fit this pattern: report writing can enforce data provenance (our BibTex example) and web search can carry IFC policies against prompt injection (our AgentDojo example).
For unconstrained code execution, we evaluated this on our AgentDojo benchmark with the no-policy variants. For a comparison to tool use, see our BibTex evaluation (Table E, answer to aNKY) which gives an example of a prototypical task one might implement an agent for.
Following the reviewer's example, they could use the LIO library like we did in our AgentDojo evaluation. In particular, LIO allows the user to mark sources/sinks of data with labels: one would then define an API exposing write operations which perform runtime checks based on these labels. In general, a strength of LBAC is that it can integrate natively with well-developed libraries like LIO.
In general, LBAC can enforce any property that can be encoded into a type. Note that a type can enforce its property through runtime checks in its underlying implementation, not only statically: guarantees can arise as a combination of type-level and runtime enforcement. Some examples from the literature include: sandboxing untrusted code [1], capability-based access control [2], enforcing that operations follow a state-machine protocol [3], avoiding data races [4], and enforcing predicates on values [5]. The reviewer is right that such guidance could benefit the manuscript: we will add some high-level discussion about how/what types of properties have been enforced in the language-based security literature.
Citations
[1] D. Terei, S. Marlow, S. Peyton Jones, and D. Mazières, "Safe Haskell," Haskell Symposium, 2012.
[2] M. S. Miller, "Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control," PhD thesis, Johns Hopkins University, 2006.
[3] R. Pucella and J. A. Tov, "Haskell Session Types with (Almost) No Class," Haskell Symposium, 2008.
[4] T. Harris, S. Marlow, S. Peyton Jones, and M. Herlihy, "Composable Memory Transactions," PPoPP, 2005.
[5] N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. Peyton Jones, "Refinement Types for Haskell," ICFP, 2014.