International Symposium on Leveraging Applications of Formal Methods, Verification, and Validation • Kos, Greece
Time: Thursday, 29.10
Room: Room 2
Authors: Zac Garby, Andy Gordon, David Sands
Abstract: Large language models are increasingly deployed as agents: they plan, call tools, read untrusted data, and act on the results. This exposes them to prompt injection: data meant only to be read is obeyed as an instruction. The most principled defences replace content inspection with provenance—classifying data by source and keeping trusted and untrusted apart through a separation of duty (the dual-LLM pattern) and information-flow control. Yet the leading systems are hard to fully trust: flow tracking is easy to get wrong at its boundaries; deliberate relaxations are hard to audit; and hard-wiring the dual-LLM pattern bakes isolation into the architecture as a fixed design choice. We present LLMbda, an untyped call-by-value lambda calculus that makes provenance-based defence both expressible and provably sound, without committing to an architecture. It adds the operational core of agentic systems as first-class constructs: prompt-response conversations that can be forked and cleared, code generation, and dynamic information-flow control in which every value carries a label that every reduction propagates. Isolation becomes a policy a program expresses, and reclassification an explicit, auditable construct. Our central result is a termination-insensitive probabilistic noninterference theorem over the whole calculus, including code-generating agents, together with an insulated variant that holds even when the attacker chooses all untrusted inputs. The verified interpreter is itself the harness that calls the model—to our knowledge, the first LLM agent harness whose executable is the subject of machine-checked security theorems—so every agent inherits the guarantee. On the AgentDojo banking benchmark, an agent built within LLMbda (enforcement always on) matches, within confidence intervals, the utility of CaMeL, a leading dual-LLM defence, run without its policy checks (enabling them halves CaMeL’s utility), and resists all but two of 1296 attacked runs—on a provably sound foundation. Our agent harness and all our proofs are in Lean.