acceptodds
Under review as a conference paper at ICLR 2027

ROWGATE: DETERMINISTIC ROW-LEVEL ACCESS CONTROL FOR LLM QUERY AGENTS OVER FEDERATED SOURCES

Abstract

Large language model agents that turn natural language into SQL are now being put in front of enterprise data, where the access policy has to hold at the row level and the data usually cannot leave the systems it already sits in. The common practice is to write the policy into the prompt and trust the model to follow it. We measured how well that works, and it breaks in two directions at once. On a 150-probe adversarial benchmark covering five RBAC roles and ten models from four vendors, refusal rates on identical inputs run from 0.0% to 72.0% and schema fidelity from 54.4% to 100%. The two do not move together. The most cautious model turns away 72% of perfectly ordinary business queries; another turns away none and matches it on fidelity; a third turns away none but reaches into unauthorized tables 45.6% of the time. Even when the caller’s scope is supplied as context, models leave the mandatory row filter off 23% to 32% of the SQL they do produce, and rewording the prompt moves that number. RowGate takes the model out of the trust path instead. Policy is enforced at two deterministic layers built over a four-graph metadata substrate: unauthorized tables and columns are stripped from the prompt before generation, and the caller’s mandatory predicates are injected into every scope of the parsed SQL before execution, including the per-source sub-queries of a federated plan. We state the guarantee as a partition over outcomes and prove it under three conditions. Prior work checks generated SQL statically; we instead run the rewritten queries against live SQL Server and PostgreSQL instances holding the real AdventureWorks database, and score exact result-set equality against an authorized-only ground truth. Over more than 700 executed queries, covering complex query shapes, a 1,000-table catalog, irregular naming, and a cross-engine join that falls from 121,317 rows to the 5,976 authorized ones, RowGate returns 0 unauthorized rows every time, and exactly the authorized rows in all but 9 long-tail cases, which fail closed rather than leak. Executing the queries also turned up four row-level leaks in our own rewriter that a static predicate check would have passed. We then overlay policies mechanically onto the Spider benchmark and run 495 queries over 17 databases the rewriter has never seen: all exact, 0 leaks, against 192 that a rewriter injecting nothing would leak on. Enforcement matches database-native row-level security on a single engine, and extends where that cannot reach, across engines and ahead of generation. The rewrite is a pure function of the query and the policy; its output is byte-identical at 33 tables and at 1,000. We release the benchmark, the invariant taxonomy, and the harness.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
text-to-SQL, LLM agents, access control, row-level security, query rewriting, federated query, prompt injection, enterprise data, benchmark

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_4imkOpenReview ↗
Rating
1
Confidence
4
Informativeness
1
Presentation
2
Soundness
1
Read review
Paper summary

This paper introduces Row Gate to handle access permissions for LLM agents over federated sources. The authors analyze refusal rates across frontier models, and leak rates. However, the lack of datasets and baseline numbers outside of a custom example set leave reproducibility difficult to judge. Second, the novelty of the proposed work is limited.

Critical strengths
  1. Problem motivation for access controls for SQL / Postgres rows.
  2. Simple framework for improving safety on access controls.
Critical weaknesses
  1. lack of reproducibility: no external benchmarks are evaluated on.
  2. lack of proper discussion around safety and privacy work in TableQA and LLMs.
  3. Limited novelty beyond prompting.
Questions for authors
  1. Can you elaborate on the data you used?
  2. How are you differentiating yourself from priori work on LLM privacy and Local-remote collaboration work related to TableQA and Contextual Integrity?
Reviewer_L25DOpenReview ↗
Rating
1
Confidence
4
Informativeness
1
Presentation
1
Soundness
1
Read review
Paper summary

This paper proposes RowGate, a deterministic enforcement framework designed to prevent unauthorized data access through LLM-generated SQL queries. RowGate employs a two-layer mechanism that filters unauthorized schema information before SQL generation and enforces row-level access policies through SQL rewriting before execution.

Critical strengths

I find the strengths of this paper rather limited.

Critical weaknesses
  1. Limited Novelty.
  2. More Engineering-Oriented Than Scientific Research
  3. Poor Readability and Writing Quality.
Questions for authors
  1. The paper lacks sufficient technical novelty. In my opinion, the core approach primarily relies on existing techniques, such as schema filtering and SQL rewriting for access control. It is unclear what fundamentally new technical insights or methods RowGate introduces beyond combining these established mechanisms.
  2. More Engineering-Oriented Than Scientific Research. The paper focuses heavily on system design and implementation rather than introducing new scientific insights or methodological advances.
  3. Poor Readability and Writing Quality. The paper suffers from poor readability, with numerous grammatical errors and awkward expressions throughout the text. Examples:
  • Lack of explanation of abbreviation: 'RBAC roles' in line 053.
  • Grammar issue: 'A user asks a question, the model writes SQL, the SQL hits a database, rows come back.' in line 50. Similar expressions can be found throughout the paper.
  • Incomplete figure: Figure 1
Reviewer_Mdv9OpenReview ↗
Rating
3
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper presents RowGate, a deterministic security middleware that enforces fine-grained, row-level access control (RLS) for LLM Text-to-SQL agents operating over federated, heterogeneous databases. Motivated by an empirical evaluation showing that instructing LLMs to self-filter via prompt context is highly unreliable, yielding either high refusal rates of benign queries (up to 72.0%) or severe security leaks (omitting mandatory filters 23% to 32% of the time), RowGate completely removes the model from the security trust path. The system utilizes a four-graph metadata substrate (mapping domains, subjects, lexicons, and identities offline) to apply security at two deterministic layers around an untrusted LLM: (1) Layer 1 strips unauthorized tables and columns from the schema context before the prompt is generated, and (2) Layer 2 parses the model's candidate SQL and injects the caller's mandatory policy predicates into the WHERE (or ON) clauses of every resolved AST scope, including per-source sub-queries in federated join plans. The authors prove a deterministic safety guarantee under explicit parse-fidelity and fail-closed assumptions (e.g., rejecting unparseable SQL and writes) as a secure four-outcome partition (enforced, refused, engine-rejected, or over-restricted) that guarantees zero unauthorized rows can ever be returned. The framework is validated via a live execution-based oracle comparing result-set equality against an authorized-only ground truth on containerized PostgreSQL and SQL Server instances holding the AdventureWorks database, achieving zero leaks across 700+ adversarial queries, zero-shot generalization over 17 unseen Spider databases (495 queries, exact matching, 0 leaks), and negligible rewriting latency (0.20 to 9.22 ms) compared to average model generation times.

Critical strengths
  1. Addresses federated cross-source row security, an under-explored gap in database and agent research: Traditional Row-Level Security (RLS) mechanisms are tightly bound to a single database engine and fail when a generative query crosses heterogeneous systems. The paper identifies and addresses this critical research gap by using a unified "Subject Graph" mapping to push down source-specific, row-level filters at the AST level before federated tables are joined in the application layer. Why it is consequential: This provides a concrete, multi-engine row-security solution for federated agent environments where native, single-engine database controls simply cannot reach and where copying entire data warehouses to a central system is not viable.

  2. Rigorous live execution-based oracle that exposes hidden semantic and logical leaks: Rather than relying on static AST predicate-presence checks, the paper validates security by executing generated queries against active, containerized SQL Server, PostgreSQL, and DuckDB instances to score exact result-set equality. Why it is consequential: This high standard of validation successfully caught four critical, real-world leaks in the authors' own rewriter (such as operator-precedence and multi-scope failures) that would have easily bypassed standard static code analysis, proving that execution-based verification is necessary for real-world enterprise deployment.

Critical weaknesses
  1. Omission of industry-standard native alternatives like Parameterized Secure Views: The paper's core thesis is that custom query rewriting is required because native database security controls cannot enforce fine-grained, dynamic policies without high administrative overhead. However, the authors completely ignore standard cloud database features, such as Parameterized Secure Views (widely implemented in PostgreSQL-compatible engines like Google Cloud SQL and AlloyDB, and Snowflake), which allow deterministic, dynamic row-level filtering based on application-propagated session parameters (e.g., CURRENT_USER or session context variables). Why it is consequential: Parameterized secure views are highly deterministic, built natively into the engine's query optimizer, and significantly less brittle than managing a custom, third-party AST parser and rewriter like sqlglot, which weakens the paper's argument for custom middle-tier SQL rewriting on single engines.

  2. High brittleness, parser dependency, and failure-to-execute (availability) trade-offs: Because the security guarantee relies on a complete parse of the SQL AST, any dialect-specific or complex syntax that is unrecognized by the pinned third-party parser (sqlglot) causes RowGate to fail-closed and completely refuse the query (Class ii). Furthermore, the authors admit to severe "utility over-restriction" (Class iv) in common scenarios, such as demoting all FULL OUTER JOINS to protect rows, and breaking staging environments because table identity is matched solely on dotted leaf names (colliding edw.table with stg.table). Why it is consequential: While the system is safe from data leaks, it achieves this at a severe cost to system availability and utility, trading off the flexibility of the LLM agent for a highly fragile parsing middle-layer that frequently blocks legitimate business queries.

Questions for authors

N/A

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.