ashishsinha1602/schemagate
by Various
Text-to-SQL access control: schema selection that gives the LLM only the tables the caller is allowed to read. Row-level-security-aware table pruning for LangChain, MCP and any SQL
MCP
ashishsinha1602/schemagate
Added 18 Oct 2026
Overview
Open-source Python library that enforces access control in text-to-SQL pipelines by pruning database schemas to only the tables a caller may read. Integrates with LangChain, MCP, and other SQL agents, and supports PostgreSQL, Oracle, MySQL, and SQL Server. Reports a 75% reduction in prompt tokens by limiting schema context.
Best for
Best for
Teams building secure text-to-SQL agents on existing relational databases.
Use cases
- Restrict LLM-generated SQL to user-permitted tables
- Reduce token usage in text-to-SQL prompts
- Apply row-level security rules during schema selection
Notes
104 stars on GitHub. Last updated 2026-10-18. Licensed Apache-2.0.
Pros
- Works across major relational databases
- Plug into existing LangChain or MCP agents
- Cuts prompt size significantly for large schemas
Cons
- Requires explicit permission configuration per table and row
- Only prunes schema, does not rewrite SQL for row-level security
- Young project with modest adoption (104 stars)
Pairs with
Other entries in the index that connect to this one. Click through to see the chain.
Get the free Developer’s Field Guide
A 27-page field guide to the AI coding workflow with Claude. Claude Code, MCP servers, the prompt patterns that work, and what to delegate. Free.
Enter your work email. We send it straight over, plus a few short notes worth knowing. Unsubscribe any time.
