Airlock Schema Guard: Stop Schema Changes Breaking Your AI Agents
A migration that renames orders.total or drops a column passes every test, because AI agents are not in the test suite. The agent then fails, or quietly answers from the wrong column, and the first to notice is a customer. Airlock already records every table and column each agent reads, so Schema Guard can say exactly which agent a change breaks — before the pull request merges, and again if the live database changes anyway. It also catches the dangerous case: hidden columns and masking rules are kept by name, so a rename can switch them off without a single error, and a row filter on a renamed column blocks its whole table.
Before you start
- An Airlock gateway with agents using it (the check works from day one, and gets sharper as the audit log fills).
- Migrations in a repository: plain SQL for any engine (Prisma, Flyway, golang-migrate, Liquibase SQL), Alembic, Django, Rails or Liquibase XML.
- For the pull-request check: GitHub Actions and an API key with only the schema-guard scope.
Steps
- 1
Open the gateway → Schema Guard: see what each agent depends on, built from the last 30 days of its requests
- 2
Paste a migration to try it: each change is graded protection lost, breaks, check or safe, with the agents and definitions it affects
- 3
API Keys → create a key with only the schema-guard scope; save it in GitHub as DBSHIFT_SCHEMA_GUARD_KEY
- 4
Copy the Schema Guard action and the workflow from the gateway page: every pull request with a migration gets one comment, and fails when an agent or protection breaks
- 5
Turn on Watch the live schema: every 15 minutes the live database is compared with the gateway's snapshot, and a change alerts you by email and webhook
- 6
When a change lands, map the renames and apply: definitions, hidden columns, row filters and token scopes move to the new names, and the old names keep working for agents for the days you choose
What goes wrong
A rename can switch a protection off
Hidden columns, row filters and masking overrides name columns. Rename ssn to national_id and refresh the schema, and the hidden column on ssn hides nothing: agents can select national_id. Rename tenant_id to org_id, and the row filter on tenant_id names a column that is gone, so Airlock refuses every read of the table rather than return every tenant's rows. Schema Guard grades both above a breaking change, refuses a plain schema refresh until you deal with them, and moves the protection when you apply the rename.
Agents that read every column
An agent that asks for a whole table never named the column, so dropping it is a warning, not a break: the agent gets one key fewer. Whether that matters depends on the agent's code, so the check lists it rather than guessing.
Django and custom table names
Django migrations name models, not tables. Schema Guard assumes Django's default <app>_<model> table name; a model with its own Meta.db_table is not visible from the migration, and the check says so.
Aliases are a bridge, not a home
While an alias is on, a request for the old name is translated before any policy runs, and the result comes back under the old name. Every use is logged, so the alias card shows which agents still need updating. Let it end once that count reaches zero.
Next
Airlock: Connecting an AI Agent
Give an AI agent a scoped, audited door into a database — structured tools instead of raw SQL, with writes gated behind approval.
Watching for Drift with Reconciliation Monitors
Compare two databases on a schedule and get alerted the moment they stop matching.
Running a Migration
Analyze the source schema, review the conversion, transfer the data, and validate that the two sides actually match.