ToolGate: Contract-Grounded and Verified Tool Execution for LLMs

Yanming Liu, Xinyue Peng, Jiannan Cao, Xinyi Wang, Songhang Deng +3 more
1/8/2026
cs.CLcs.AIcs.FL

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) augmented with external tools have demonstrated remarkable capabilities in complex reasoning tasks. However, existing frameworks rely heavily on natural language reasoning to determine when tools can be invoked and whether their results should be committed, lacking formal guarantees for logical safety and verifiability. We present \textbf{ToolGate}, a forward execution framework that provides logical safety guarantees and verifiable state evolution for LLM tool calling. ToolGate maintains an explicit symbolic state space as a typed key-value mapping representing trusted world information throughout the reasoning process. Each tool is formalized as a Hoare-style contract consisting of a precondition and a postcondition, where the precondition gates tool invocation by checking whether the current state satisfies the required conditions, and the postcondition determines whether the tool's result can be committed to update the state through runtime verification. Our approach guarantees that the symbolic state evolves only through verified tool executions, preventing invalid or hallucinated results from corrupting the world representation. Experimental validation demonstrates that ToolGate significantly improves the reliability and verifiability of tool-augmented LLM systems while maintaining competitive performance on complex multi-step reasoning tasks. This work establishes a foundation for building more trustworthy and debuggable AI systems that integrate language models with external tools.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liu2026toolgate,
  title  = {ToolGate: Contract-Grounded and Verified Tool Execution for LLMs},
  author = {Yanming Liu and Xinyue Peng and Jiannan Cao and Xinyi Wang and Songhang Deng and Jintao Chen and Jianwei Yin and Xuhong Zhang},
  year   = {2026},
  eprint = {2601.04688},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.04688v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.04688.svg)](https://codeofpaper.com/paper/2601.04688)

Discussion