DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to see which tables a caller is blocked from with Schemagate

Compare the same question for two callers and confirm restricted tables leave the prompt, with no database needed.

Who it is forA developer building a text-to-SQL agent who needs proof that a restricted table never reaches the model for a given role.

The problemSchema selection often runs before identity is checked, so the model can be handed a table the caller cannot read and then returns a misleading empty answer.

The outcomeYou see a restricted table absent for one caller and ranked first for a caller with the right role, with no database or model key.

What you need first

  • Python and pip installed
  • For your own database: a reachable Postgres, Oracle, MySQL or SQL Server URL, and the matching schemagate extra
  • Optional: a model key only if you want generated answers or AI descriptions

Steps

  1. Run pip install schemagate to install the library.
  2. Run schemagate demo "salary by employee" and confirm hr_compensation is absent from the result.
  3. Run schemagate demo "salary by employee" --principal okta:hr --role payroll and confirm the table now appears first.
  4. Run schemagate demo "salary by employee" --prompt if you want to read the DDL the model would receive. (inferred, check the README)

Prompt for your agent

Install schemagate with pip, then run `schemagate demo "salary by employee"` and again with `--principal okta:hr --role payroll`. Report which tables appear in each result and confirm hr_compensation is absent for the first caller and present for the second.

Caveat. The demo runs on the bundled 42-object sample schema, so the results show the mechanism but not how your own grants will behave until you run it against your database.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for ashishsinha1602/schemagate and "See which tables a caller is blocked from"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer