# Environments in QuerentDB: dev, test and a protected prod

> Group connections into environments like dev and prod. Protect prod so writes need its name typed, require TLS, and choose what AI tools may see.

Source: https://www.keepware.dev/guides/querentdb-environments · Product: QuerentDB (https://www.keepware.dev/querentdb) · Published 2026-11-11
Video: https://www.keepware.dev/guides/querentdb-environments/video.mp4 (1:31, narrated, captions https://www.keepware.dev/guides/querentdb-environments/video.vtt)

In QuerentDB, a desktop database client by Keepware, every connection belongs to an **environment**, such as dev, test or prod. The environment decides how careful QuerentDB is with its connections: **Protected** makes every write ask you to type the environment's name first and every write through MCP wait for your approval; **Require TLS** refuses connections that aren't encrypted; and the **AI policy** decides whether the AI Editor, the Agent, MCP and `qdb` may read data, only the structure, or nothing at all.

## How do I create an environment?

1. Choose **+** next to **Environments** at the top of the left panel (or **New environment** when there are none yet).
2. Enter a **Name**, such as `prod`.
3. Set **Protected**, **Require TLS** and the **AI policy** (below), then choose **Create**.

![The New environment sheet: prod, with Protected and Require TLS on and the AI policy set to Schema only](https://www.keepware.dev/guides/querentdb-environments/new-environment-prod.png)

The environment appears in the left panel; add connections to it with **New connection**. A protected environment is shown in red with a lock, in the left panel and on every tab of its connections.

## What does Protected do?

- **Writes need the environment's name.** When you run a statement that changes data, QuerentDB shows the statement, the connection and database, the account it switches to, and about how many rows it will affect. **Run** stays disabled until you type the environment's name.
- **Writes through MCP and `qdb` always need approval**, even with a token that's allowed to write without asking elsewhere.
- **It's visible everywhere**: red with a lock in the left panel and on tabs, so you don't mistake prod for dev.

![Run a write on prod: the statement, about 2 rows affected, and prod typed to confirm](https://www.keepware.dev/guides/querentdb-environments/confirm-protected-write.png)

In environments that aren't protected, QuerentDB still shows the statement and the estimated rows before a write, as long as **Settings → General → Confirm before writing** is on (the default); you just don't type the name.

## What does Require TLS do?

Every connection in the environment has to be encrypted. Its connections need **TLS** set to **Require**, and QuerentDB refuses to connect to a server that offers no encrypted connection. Turn it on for production and for anything that crosses a network you don't control.

## What does the AI policy control?

| AI policy | What the AI Editor, the Agent, MCP and `qdb` can do |
|---|---|
| **Schema + data** (default) | See the structure and run read-only queries on the data, to check which values a column actually holds |
| **Schema only** | See tables, columns and indexes, but not read any rows: the query tool and **Ask about this data** are off |
| **Off** | Nothing: they can't use this environment's connections at all |

The policy applies to AI tools only. You can still browse and query the data yourself. A tab shows its environment's policy in the AI Editor, as **AI: Schema + data** or **AI: Schema only**.

## How do I change or delete an environment?

Right-click it in the left panel and choose **Edit environment…** to rename it or change its settings. To delete it, type its name under **Delete environment**: its connections and SSH tunnels are deleted from QuerentDB, and the databases themselves aren't touched.

## How do environments work in a team?

In a team workspace, environments and their connections are shared with every member, end-to-end encrypted. Admins create environments, and each role gets **None**, **Read-only** or **Read-write** access per environment: someone can write on test and only read on prod, and members with read-only access never receive the read-write account's password. See [Personal and Team](https://www.keepware.dev/guides/querentdb-personal-vs-team).

## FAQ

### Should every database go into a protected environment?

Protect the ones where a mistake is expensive, usually production. Typing the name on every write is deliberate friction; on dev and test, the confirmation with the estimated row count is usually enough.

### Does Schema only stop me from seeing data?

No. It limits AI tools only. You browse and query the data as usual.

### Can a connection move to another environment?

Yes: drag it onto the other environment in the left panel. If that environment requires TLS, set the connection's TLS to **Require** first.

## Video transcript

**0:03 What environments are for.** Environments are how QuerentDB groups your connections, like dev, test and prod. Each one decides how careful QuerentDB is with the connections in it. Here, dev holds the store's MySQL database. Let's add a production environment next to it.

**0:19 Create a protected environment.** Call it prod. Turn on Protected. Every write in prod will ask you to type its name first, and every write through MCP needs your approval. Require TLS refuses any connection in prod that isn't encrypted. The AI policy decides what AI tools can see. Schema only lets them read the structure, but never your data. Then choose Create.

**0:41 A connection in prod.** Prod now shows in red, with a lock. For this demo, it has a copy of the store database too. Open it, and its tab is marked prod as well, so you always know where you are.

**0:52 Writing to a protected environment.** Now let's change something: two orders that went out yesterday. Choose Run. Because prod is protected, QuerentDB shows the statement, the account it'll use, and how many rows it'll change. To go ahead, type prod. Until you do, Run stays disabled. Choose Run, and the change is made.

**1:11 What AI tools can see.** On the right, the AI Editor shows the environment's AI policy: Schema only. It can still look up tables and columns to write a query for you, but it won't read the rows. To change any of this later, right-click the environment and choose Edit environment.

