schemagate
schemagate is an access control and schema selection tool for Text-to-SQL. Before sending the database schema to a large language model, it first filters tables according to the caller's permissions, placing only the tables needed for the question and that the caller has permission to read into the prompt, thereby reducing prompt tokens and preventing the model from generating SQL for tables the caller has no access to. It supports Postgres, Oracle, MySQL, SQL Server, and SQLite, and can be used with LangChain, LlamaIndex, MCP, or any SQL agent. The project provides a local command line, a browser demo, and a hosted version.