2026

Text-to-SQL parsing has achieved remarkable progress under the Full Schema Assumption, where the complete database structure is pre-loaded into the model’s context. Yet this assumption overlooks a more fundamental capability question of whether an LLM agent can resolve a query without explicit access to the underlying tables and relations. Moreover, full-schema injection may exceed the effective context window, introduce irrelevant metadata into the reasoning process, and become less reliable as databases evolve. We therefore study the Unknown Schema setting, in which an agent must actively explore the database and commit to only the relevant subset of metadata. To address this, we propose TRUST-SQL (Truthful Reasoning with Unknown Schema via Tools). We formulate the task as a Partially Observable Markov Decision Process in which our autonomous agent follows a structured four-phase protocol to ground reasoning in verified metadata. This protocol provides a structural boundary for our novel Phase-Aware GRPO strategy, which applies token-level masked advantages to isolate exploration rewards from execution outcomes and resolve credit assignment, yielding a 9.9% relative improvement over standard GRPO. Extensive experiments across five benchmarks demonstrate that TRUST-SQL is effective at multiple scales (4B/ 8B/14B). Despite operating entirely without pre-loaded metadata, our agent matches or surpasses prior baselines on most benchmarks that rely on schema prefilling.