A wrong SQL statement run once on a production database is hard to undo. NeoSQL puts several layers of safeguards against mistakes. Each safeguard is set by a different person and covers different executions, so make sure that the place you trust to protect you is not actually uncovered.
Safeguards come in layers
| Safeguard | Set by | What it does | Where it is available |
|---|---|---|---|
| Connection profile | You (personal setting) | Shows the environment with a color and watermark, and confirms or blocks executions with a protection mode | All projects |
| Dangerous SQL check | Always on (can be turned off per type on each connection) | Asks before running statements that remove a lot of data | All projects |
| Role-based DDL restriction and DDL approval | Whoever manages the project | Blocks DDL for chosen roles and routes it through approval | Account projects |
| AI and MCP connection policies | Whoever can change the connection's AI settings | Decides what AI and external MCP clients can change and whether they must ask | All projects (MCP on desktop) |
| Database account privileges | The database administrator | Anything the database does not allow is not executed from any tool | Every path, including outside NeoSQL |
Telling environments apart with connection profiles
A connection profile shows on screen which environment a connection belongs to, and decides how carefully executions are handled. Open the connection dialog with the menu and set it in the Profile tab.
- A profile is a personal setting. In an account project it is stored in your account, and in a local project in the project on this computer. It does not affect team members.
- In an account project, team members without permission to edit connections can still open the Profile tab.
Choosing an environment in the Environment option sets the Color, Background watermark and Protection mode options together. You can change each of them afterwards.
| Environment | Color | Background watermark | Protection mode |
|---|---|---|---|
| Local | Teal | Off | None |
| Dev | Blue | Off | None |
| Staging | Orange | Off | Confirm (DDL + risky DML) |
| Prod | Red | On | Confirm (DDL + risky DML) |
| Custom | Your choice | Your choice | Your choice |
- The chosen color is applied to the work tab badge (1) and to the line on the right of the SQL editor's line number area (2).
- With the Background watermark option on, the label (3) is laid across the background of the SQL editor and the ERD. If you leave the Label (optional) field empty, the connection name is used.
- Picking a Color yourself switches the environment to Custom. The protection mode and watermark stay as they are, but SQL session idle timeouts follow the values of the Custom environment.
Protection modes
| Protection mode | What it does |
|---|---|
| None | Asks nothing |
| Confirm (DDL + risky DML) | Asks before running DDL (statements starting with CREATE, ALTER, DROP, TRUNCATE, RENAME, GRANT and so on, and a SELECT … INTO that creates a table) and UPDATE or DELETE without WHERE. The confirmation title shows the environment and the connection name |
| Read-only (block non-SELECT) | Does not run statements that are not queries |
The protection mode applies to every path inside NeoSQL that writes to the database. Every path uses the same rule and the same confirmation window.
| Execution path | Protection mode |
|---|---|
| The Execute and Run Script buttons in the SQL editor | Applies |
| SQL run by AI Assistant | Applies. In the Read-only (block non-SELECT) protection mode, every statement that is not a query is blocked |
| SQL sent by an external MCP client | Applies. Each statement is checked, and if any one of several statements is blocked, none of them runs |
| Applying result grid edits (including choosing to apply when closing a tab), applying ERD changes to the database, changing and deleting objects in the explorer | Applies. Each screen shows the SQL to be run and then the check runs |
| Importing data from files, restoring dump files | Applies. With the Read-only (block non-SELECT) protection mode they do not start |
- The Read-only (block non-SELECT) protection mode looks into the body of a statement to decide whether it is a query. Even when a statement starts with
SELECT,WITH,SHOW,DESCRIBEorEXPLAIN, a statement that changes data insideWITH, aSELECT … INTOthat creates a table, and anEXPLAIN ANALYZEthat actually runs the statement are not treated as queries and are blocked. - When several statements run at once, each is checked, and if any one is blocked, none of them runs.
Dangerous SQL check
Regardless of the connection profile, the SQL editor asks once more before running the statements below.
| Statement | Confirmation title |
|---|---|
TRUNCATE | Dangerous Operation |
Every statement starting with DROP | Dangerous Operation |
An ALTER that removes something, such as ALTER TABLE … DROP COLUMN | Dangerous Operation |
UPDATE or DELETE without WHERE (including one that starts with WITH) | Confirm Execution |
- This check runs when you run with the Execute and Run Script buttons. If there are bind parameters, the statement with the values filled in is checked. The Run Script button gathers the matching statements and asks once before running. It does not run when you edit in the result grid.
- A
WHEREinside a subquery does not filter the target rows, so it does not count as aWHERE. - If you check the Don't ask again for this type on this connection option in the confirmation, that type is not asked again on the same connection until you restart the app (or reload the page on the web). Other connections and other projects are not affected.
- Role-based DDL restriction and the protection mode are checked first, and a statement they block is blocked without asking. On a connection with the Confirm (DDL + risky DML) protection mode, running an
UPDATEwithoutWHEREasks both checks in one window. The Don't ask again for this type on this connection option does not turn off the protection mode check. - When the confirmation opens, the focus is on the Cancel button. Pressing only
Enterdoes not run the statement.
Role-based DDL restriction and DDL approval in account projects
In an account project you can block DDL per role and have schema changes reviewed by an approver before they run. The project owner sets the DDL Restriction and Approver Role options per role in the tab. At first they are off for every role.
| When a team member with restricted DDL | Result |
|---|---|
| Runs DDL in the SQL editor | It is not run, and a message asks them to request the approver to apply it to the database |
| Applies ERD changes to the database | Instead of running the DDL, they enter a reason and request approval |
| Runs DDL through AI Assistant or an external MCP client | It is blocked. A confirmation cannot lift it |
- The approver reviews requests in the panel. The approver can edit the DDL, and clicking the Approve & Execute DDL button runs the DDL right away. The Reject button sends the request back.
- The people who can approve are the owner and team members whose role has the DDL Restriction item turned off. If the requester's role has an Approver Role item set, only that role or higher approves (DDL approval).
- Role-based DDL restriction only blocks running DDL in NeoSQL screens. If the connection's database account has DDL privileges, other tools that connect with the same database account are not blocked. Where DDL must be blocked, block it with the database account's privileges (see 'Why a read-only database account is recommended' below).
- When you turn off the DDL Restriction item for a role and save the settings, the unapplied changes of that role's members are discarded and their pending requests are cancelled. Process the requests you want to keep before turning it off.
- Sharing and roles are explained in Collaboration and permissions.
AI and MCP connection policies
What AI Assistant and external MCP clients can do on a connection is set per connection in the dialog opened with the AI Settings button at the top of the project screen.
| Option | AI Assistant | External MCP client (desktop) |
|---|---|---|
| Enabled off | Does not use the connection | Rejects requests for the connection |
| Schema changes off | Asks before running DDL | Shows the Confirm MCP DDL Execution dialog on the desktop. If you do not answer within 45 seconds, nothing runs |
| Schema changes on | Runs without asking | Runs without asking |
| Data changes off | Asks before running INSERT, UPDATE and DELETE | Runs them without committing and leaves the transaction open in the SQL tab for MCP. You commit or roll back yourself in NeoSQL |
| Data changes on | Runs without asking | Commits automatically |
- Role-based DDL restriction and the protection mode take effect before these policies. Even with Schema changes on, DDL does not run for team members with restricted DDL or on connections with the Read-only (block non-SELECT) protection mode, and the Confirm (DDL + risky DML) protection mode still asks.
- In an account project, only the project owner can change public connections, and only the connection's owner can change a private connection. In a local project, the user of this computer changes them.
- A connection newly created in a local project has Enabled on, and Schema changes and Data changes off.
- What is sent to AI is explained in AI and MCP, and the other options of the dialog in Project AI settings.
Why a read-only database account is recommended
NeoSQL's safeguards reduce mistakes, but they are not the last wall protecting your database.
- The dangerous SQL check runs only in the SQL editor. Other paths have only the protection mode.
- They judge statements by their shape, so a dangerous statement that looks safe, such as one with
WHERE 1=1, can get through. The app's own description of DDL restriction also says it cannot block everything and recommends restrictions on the database side as well. - The protection mode is a personal setting, so it differs between team members. It has no effect on other tools or applications that use the same database account.
Database account privileges are enforced by the database itself, so they apply equally to every tool and every path. For production databases, do the following.
- Create connections that only read data with a database account that has only
SELECTprivileges. Use such a connection when you open a production database to AI or external MCP clients too. - Separate the account that changes data from the account that runs DDL, and give DDL privileges only to approvers.
- Public connections in an account project share one database user and password across the team (Connections and execution targets). The privileges of the account you put in a public connection are the privileges of the whole team that uses it.
Things to keep in mind
- A connection without a connection profile has the protection mode None. When you create a production connection, set its profile first.
- Editing in the result grid and applying ERD changes to the database do not go through the dangerous SQL check. On a production database, always check the SQL shown before it runs.
- When you change data in a production database, turn off the Auto Commit switch, run the statement, check it and then commit. Transactions are explained in SQL execution and transactions.
Related pages
- Connection profiles: the options of the profile tab.
- Dangerous SQL confirmation: what the confirmation looks like and its buttons.
- DDL approval: the panel where approval requests are reviewed and run.
- Connect to a production database safely: the steps to connect to a production database with a secure connection and a profile.