arXiv:2610.25552cs.AIOct 2026

Manuscript Offprint

arXiv:2610.25552

Symbolic Constraint Agents: Mining Formal Tool-Call Constraints to Prevent Agent Errors

Jinu Lee, Shraddha Barke

Abstract

Symbolic constraints (programmatic, deterministic checks for tool calls) enable deterministic verification of LLM agents' tool calls, but existing approaches primarily enforce predefined safety policies rather than tool dependencies in complex tool environments. We explore whether symbolic constraints can be mined from environments and observations beyond predefined policies, and whether they can improve end-to-end task performance. We present Symbolic Constraint Agents (SCA), a framework that mines symbolic constraints from API documentation, refines them against execution traces, and checks the agent's tool calls with an SMT solver at runtime. A violation triggers a natural-language warning or, when the valid replacement is uniquely determined, an automatic repair. On AppWorld, refinement raises error-detection F1 from 37.0 to 58.3 on GPT-5.5 traces and from 39.3 to 61.9 on Qwen3.5-27B traces. At runtime, repair raises GPT-5.4-mini's task success by 5.4 points under a 40-call budget and 9.8 points when environment errors are hidden, while removing 59–87% of failed calls across models, and transfers to τ2\tau^{2}-bench with gains of up to 5.6 points. These findings show that automatically acquired symbolic constraints can improve tool-calling reliability and task completion, particularly when failures are costly or difficult to diagnose.

1 Introduction

Large language model (LLM)-based agents are increasingly used to automate real-world tasks, from customer service to complex workspace duties (Trivedi et al., 2024; Gao et al., 2025; Fang et al., 2026). A critical component of these agents is tools, or external functions that allow agents to read information from the environment and update the environment state (Schick et al., 2023). As agents interact with increasingly complex environments, how can we ensure that their tool calls are valid?

Previous work primarily focuses on formalizing predefined safety policies into symbolic constraints and enforcing them on all tool calls by blocking violations for better policy adherence (Kamath et al., 2025; Zwerdling et al., 2025). However, complex tool-calling environments impose many rules that are not explicitly codified as policies. These include dependencies between tool calls, argument provenance requirements, and restrictions on the current environment state (Trivedi et al., 2024; Shi et al., 2025). Although some of these conditions can be inferred from API documentation, others become apparent only through successful or failed interactions with the environment.

This raises two questions: How can we generate executable tool-call constraints without manually specified policies, and can these constraints improve agents' ability to complete tasks rather than merely enforce compliance? Addressing these questions requires a coherent system that mines constraints from diverse sources like policy and tool documentation, refines inaccurate rules using observed execution behavior, and translates detected violations into runtime interventions.

We propose Symbolic Constraint Agents (SCA), which generate tool dependency constraints as first-order logic rules and verify agents' tool calls with SMT (Satisfiability Modulo Theories) solvers (de Moura and Bjørner, 2008) when each call is executed in complex tool environments. First, an initializer agent mines candidate rules from the API documentation. Since relying solely on API documents yields constraints that do not reflect the real environment, a second refiner agent removes overly strict rules and adds missing rules using sample agent traces. At runtime, the agent receives information about violated constraints each turn, guiding the agent to retry. Furthermore, for

∗^{*}Work done during an internship at Microsoft Research.

Symbolic Constraint Agent

(a) Constraint generation:

Generate rules from API docs and agent trace

Figure

(b) Constraint application:

Warning and repairing tool calls on runtime

Figure

Figure 1: Overview of SCA. Constraint generation (top) runs once per environment: an initializer agent mines candidate rules from API documentation and a refiner agent corrects them against sample agent traces. At the constraint application stage (bottom), each proposed call is checked against the constraint memory using an SMT solver. The rule shown requires LISTDIR's api_key to originate from an earlier LOGIN; the call passing DEF is unsatisfiable and can be repaired to ABC.

constraint violations with a unique correction (e.g., passwords), SCA can instead repair the broken argument using MaxSMT model checking.

We make three contributions. First, we introduce an environment-grounded constraint mining framework that mines executable tool-call rules from API documentation and iteratively refines them against execution traces, even without requiring manually specified task-success criteria. Second, we develop solver-based interventions that translate detected violations into natural-language feedback, or automatic repairs for uniquely determined argument errors. Third, we demonstrate that symbolic constraints can improve end-to-end task completion through experiments on AppWorld (Trivedi et al., 2024) and τ2\tau^{2}-bench (Barrès et al., 2025), particularly when tool-call failures are costly or hard to diagnose, while reducing failed calls and inference costs.