An LLM Agentic Approach for Legal-Critical Software: A Case Study for Tax Prep Software
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large language models (LLMs) show promise for translating natural-language statutes into executable logic, but reliability in legally critical settings remains challenging due to ambiguity and hallucinations. We present an agentic approach for developing legal-critical software, using U.S. federal tax preparation as a case study. The key challenge is test-case generation under the oracle problem, where correct outputs require interpreting law. Building on metamorphic testing, we introduce higher-order metamorphic relations that compare system outputs across structured shifts among similar individuals. Because authoring such relations is tedious and error-prone, we use an LLM-driven, role-based framework to automate test generation and code synthesis. We implement a multi-agent system that translates tax code into executable software and incorporates a metamorphic-testing agent that searches for counterexamples. In experiments, our framework using a smaller model (GPT-4o-mini) achieves a worst-case pass rate of 45%, outperforming frontier models (GPT-4o and Claude 3.5, 9-15%) on complex tax-code tasks. These results support agentic LLM methodologies as a path to robust, trustworthy legal-critical software from natural-language specifications.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 15 of its 50 references that are in the map. First posted on arXiv 16 Sep 2025.
Builds on
15 of 50 references.
Closest ancestors · 2
Same direction, newest first
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving18 May
Other references · 13
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 140
- 2023Towards Better Chain-of-Thought Prompting Strategies: A Surveycited by 62
- 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
- 2024AgentLite: A Lightweight Library for Building and Advancing Task-Oriented LLM Agent Systemcited by 53
- 2023Gentopia: A Collaborative Platform for Tool-Augmented LLMscited by 26
- 2023METAL: Metamorphic Testing Framework for Analyzing Large-Language Model Qualitiescited by 20
- 2022Metamorphic Testing and Debugging of Tax Preparation Softwarecited by 7
- 2023On the Potential and Limitations of Few-Shot In-Context Learning to Generate Metamorphic Specifications for Tax Preparation Softwarecited by 3
- 2024Software Engineering Methods For AI-Driven Deductive Legal Reasoningcited by 3
1 more
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026LLM Agents in Law: Taxonomy, Applications, and Challengescited by 5
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistantscited by 4
- 2026Reproducible, Explainable, and Effective Evaluations of Agentic AI for Software Engineeringcited by 1
- 2026Right-Sizing LLM-Agent Decomposition in VAT Determination: A Pilot Controlled Sweepcited by 0
- 2026Making Duplicate Reimbursement Unrepresentable: A Verified Ethereum E-Invoice System for Humans and AI Agentscited by 0
- 2026Law And Order: Tax Law Autoformalizationcited by 0
- 2026Law And Order: Tax Law Autoformalization2 Oct 2026
- 2026Making Duplicate Reimbursement Unrepresentable: A Verified Ethereum E-Invoice System for Humans and AI Agents29 Sep 2026
- 2026Right-Sizing LLM-Agent Decomposition in VAT Determination: A Pilot Controlled Sweep24 Aug 2026
- 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistants29 May 2026
- 2026Reproducible, Explainable, and Effective Evaluations of Agentic AI for Software Engineering1 Apr 2026
- 2026LLM Agents in Law: Taxonomy, Applications, and Challenges8 Jan 2026
Similar, not cited
Close in wording, no citation either way
- 2023Large Language Models as Tax Attorneys: A Case Study in Legal Capabilities Emergence
- 2025Challenges in Testing Large Language Model Based Software: A Faceted Taxonomy
- 2026Bidirectional Empowerment of Metamorphic Testing and Large Language Models: A Systematic Survey
- 2026SteuerLLM: Local specialized large language model for German tax law analysis
- 2026Reasoners or Translators? Contamination-aware Evaluation and Neuro-Symbolic Robustness in Tax Law
- 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation
- 2024The Potential of LLMs in Automating Software Testing: From Generation to Reporting
- 2026LogicHunter: Testing LLM Agent Frameworks with an Agentic Oracle