AI Permissions

AI permissions decide what the AI may do in DbSchema. "The AI" means the AI Assistant and the AI agents that you connect through the MCP server, such as Claude Code. Both use the same tools, and the same permissions.

How AI permissions work

A tool is one action that the AI can ask DbSchema to do, such as "list the tables" or "run a query". Each tool has a mode:

  • With Allow, the tool runs without asking you.
  • With Ask, DbSchema asks you first.
  • With Off, the AI cannot use the tool.

The design is your DbSchema project: the tables, columns and diagrams that you see in DbSchema. The database is the real database on the server.

Three settings decide what the AI may do:

SettingWhat it decidesWhere
AI access of a connectionWhich databases the AI may useEach connection, in Database → Manage Connections
AI tool preset of a projectWhat the AI may do with the design of that projectFile → Properties
Global tool permissionsThe tools that are not part of a project, such as running SQL or opening a projectEdit → Settings → AI → Security

Each tool follows either the project's preset or the global tool permissions. A tool that uses a database also needs AI access on that database's connection.

This table shows which settings some common tasks need, with the default settings:

TaskWhat it needs
Review the designA preset that can read the design: any preset but No model access
Create a table in the designThe preset Edit access or Full access
Read the rows of the customers tableAI access on the connection. DbSchema asks you first.
Change a table in the databaseAI access on the connection, and a database user with that right. DbSchema always asks you first.

How DbSchema protects your database

  • Every connection starts without AI access.
  • In a database, the AI can do only what the connection's database user is allowed to do.
  • DbSchema always asks you before the AI changes a database. No setting and no preset can turn that question off.
  • When the AI only reads, DbSchema uses a read-only connection. Afterwards, DbSchema rolls back the transaction, so anything that the AI's statements changed is undone.
  • Everything that the AI reads from the design or from a database is sent to your AI provider. With Ollama, which runs the AI model on your own computer, nothing leaves your computer.

Allow the AI to use a database

  1. Choose Database → Manage Connections.
  2. Press the edit button of the connection.
  3. Open the Access and Model tab, and tick Allow AI tools to access this database connection.
  4. In the AI Access dialog, press Allow AI access.
The Access and Model tab of the PostgreSQL connection, with Allow AI tools to access this database connection ticked

The AI Access dialog sums up what you allow. Press Show Details to read every rule:

The AI Access dialog with the details shown: the AI reads and changes the database with the connection's Database User, DbSchema asks before every change, and the steps to give the AI a connection of its own

In the toolbar, a connection with AI access shows "AI access" below its name. To remove the access, untick Allow AI tools to access this database connection at any time.

Choose what the AI may do in a project

Each project has an AI tool preset. The preset controls the tools that work on the project's design: each one runs without asking, asks you first, or is off.

  1. Choose File → Properties.
  2. Choose a preset in AI Tool Preset.
  3. Press OK.
The Model Properties dialog with Edit access chosen in AI Tool Preset, and the note that says where the other AI settings are

DbSchema has four presets:

PresetRead the designChange the designDelete from the designSave the project fileRead the list of tables in a database
No model accessOffOffOffOffOff
Read onlyAllowOffOffOffAsk
Edit accessAllowAllowAskAskAsk
Full accessAllowAllowAllowAllowAllow

By default, new projects use the Edit access preset. To change that, choose another preset in Default tool preset for new projects, in Edit → Settings → AI → Security.

Even with Full access, DbSchema asks you before the AI changes a database. The preset decides what the AI does with the design; changes to a database always need your answer.

Set the global tool permissions

Some tools are not part of a specific project, such as running SQL, opening and creating projects, and changing settings. Their permissions are global.

  1. Choose Edit → Settings → AI → Security.
  2. Press Configure global tool permissions….
  3. Set the Mode of each tool, or of a whole group.
  4. Press OK.
The Global Tool Permissions dialog grouped by risk class: Read model tools such as project_list_open set to Allow, and Open UI tools such as project_open

Each tool has a risk class that describes the type of operation it performs. These are the risk classes, with their default modes for the global tools:

Risk classWhat the tool doesDefault
Read modelReads the designAllow
Open UIOpens a DbSchema window or dialogAllow
Edit modelChanges the designAllow
Change settingsChanges a DbSchema settingAsk
Read database metadataReads the list of tables and other objects in a databaseAsk
Read dataReads rows from a database, or shows how the database would run a queryAsk
Change databaseChanges the data or the structure of a databaseAsk

For tools in the Change database risk class, you can choose Ask or Off, but not Allow. If you choose Allow for a group, its Change database tools are set to Ask.

The AI → Security page of the DbSchema Settings: Configure database access, Configure per-project tools access, Configure global tool permissions, and Default tool preset for new projects set to Edit access

The other buttons on this page open the settings described above. Configure database access… opens the connections, and Configure per-project tools access… opens the project's preset.

Answer a confirmation

When a tool is set to Ask, DbSchema opens the Confirm the AI's request dialog. The AI waits for your answer before the tool runs.

The Confirm the AI's request dialog for data_sample on the PostgreSQL connection: risk class Read data, the arguments, the SELECT statement, and the buttons Allow, Allow until DbSchema exits and Don't allow

The dialog shows the requested tool, its connection, its risk class, the values that the AI passes to it, and the SQL statement to be run. Then choose one:

  • Allow runs this request.
  • Allow until DbSchema exits runs this request. Until you close DbSchema, requests of the same risk class on this connection run without asking you. A change to a database still asks every time.
  • Don't allow refuses the request.

See what the AI did

DbSchema records every request of the AI, whether it ran, failed or was refused.

  1. Choose Help → Output Logs.
  2. Open the AI tool calls tab.
The AI tool calls tab of the Output Logs: the time, the consumer, the tool, the outcome and the duration of each call

The Consumer column shows who made the request, for example MCP agent. Click a request to see the connection, the values that the AI passed to the tool, and your answer.

Advanced settings

Create a separate database connection for the AI

To limit what the AI can do in a database, give it a connection of its own, with a database user that has fewer rights:

  1. In Database → Manage Connections, select the connection and press Clone.
  2. In the clone, enter a database user with only the rights that the AI needs.
  3. Tick Allow AI tools to access this database connection on the clone, and untick it on the original connection.

Make your own preset

You cannot change the four built-in presets, but you can duplicate one and change the copy.

  1. In File → Properties, press the pencil button beside AI Tool Preset.
  2. Choose the preset to start from, and press Duplicate to edit.
  3. Type a name in Name, and set the Mode of each tool to Allow, Ask or Off.
  4. Press Close.
The AI Tool Presets dialog with Edit access selected: the note that built-in presets cannot be changed, the Duplicate to edit button, and the tools with their risk class and mode

Group by Risk class sorts the tools by the type of operation, such as Read model or Edit model. Changing the Mode of a group applies it to every tool in the group.

Common problems

The AI says that it has no database

No connection allows AI access yet. Tick Allow AI tools to access this database connection, as Allow the AI to use a database shows.

The AI cannot change my design

The project's preset is Read only or No model access. Choose File → Properties and set AI Tool Preset to Edit access.

I set a tool to Allow, but it still asks

The tool changes a database. DbSchema always asks you before such a tool runs, whatever its mode says.

The AI cannot run any SQL, but it can still read rows

Read-Only Mode is on, in Edit → Settings → SQL Editor. It stops every SQL statement that the AI writes, SELECT included. The tools that read sample rows of a table still work. Untick it to let the AI run queries again.

Next steps