$\lambda_A$: A Typed Lambda Calculus for LLM Agent Composition
Qin Liu

TL;DR
This paper introduces $ extbackslash lambda_A$, a formal typed lambda calculus for LLM agent composition, enabling rigorous analysis, error detection, and unification of various agent paradigms.
Contribution
It extends the simply-typed lambda calculus with features for agent modeling, proves key properties, and demonstrates practical tools and insights for real-world agent configurations.
Findings
94.1% of real-world GitHub agent configs are structurally incomplete under $ extbackslash lambda_A$
YAML-only lint precision is 54%, rising to 96-100% with combined YAML and Python AST analysis
Five mainstream agent paradigms embed as fragments of $ extbackslash lambda_A$
Abstract
Existing LLM agent frameworks lack formal semantics: there is no principled way to determine whether an agent configuration is well-formed or will terminate. We present , a typed lambda calculus for agent composition that extends the simply-typed lambda calculus with oracle calls, bounded fixpoints (the ReAct loop), probabilistic choice, and mutable environments. We prove type safety, termination of bounded fixpoints, and soundness of derived lint rules, with full Coq mechanization (1,519 lines, 42 theorems, 0 Admitted). As a practical application, we derive a lint tool that detects structural configuration errors directly from the operational semantics. An evaluation on 835 real-world GitHub agent configurations shows that 94.1% are structurally incomplete under , with YAML-only lint precision at 54%, rising to 96--100% under joint YAML+Python AST analysis on 175…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
