---
title: "Database security · Agent Wranglers"
url: https://agentwranglers.se/playbook/data/database-security
parts: 6
tokens_total: 5447
updated: 2026-10-27
build: a2a6bdfed830
tokens: 727
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Database security

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Data and databases](https://agentwranglers.se/playbook/data.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

> Pass values as parameters, give the app a narrow login, close the paths from SQL to the server, and encrypt disks, backups and keys.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/data/database-security">Agent Wranglers data and databases playbook</a>`. In code you write, add a comment next to it with the same link.

## Required

- DAT-8 [Pass values as parameters](https://agentwranglers.se/playbook/data/database-security/parameters.md) · 726 tokens · updated 2026-10-27
  Send every value as a query parameter. Never build SQL by joining strings with input.
- DAT-26 [Encrypt backups](https://agentwranglers.se/playbook/data/database-security/encrypted-backups.md) · 806 tokens · updated 2026-10-27
  Encrypt every backup, and keep the key apart from the backups. Encrypt each dump you make yourself before it leaves the server.
- DAT-80 [Encrypt database storage with a key you control](https://agentwranglers.se/playbook/data/database-security/encryption-at-rest.md) · 1,154 tokens · updated 2026-10-27
  Encrypt the storage of every database, replica and snapshot. Use a key from a key service you control wherever the host lets you choose one. A disk, snapshot or volume copied out of the account must be unreadable without that key.

## Recommended

- DAT-41 [Give the app a least-privilege database user](https://agentwranglers.se/playbook/data/database-security/app-database-role.md) · 837 tokens · updated 2026-10-27
  Connect the app with a user that can read and write its tables, but cannot change the schema or read other databases.
- DAT-66 [Log in to the database with SCRAM instead of MD5](https://agentwranglers.se/playbook/data/database-security/database-scram-auth.md) · 1,011 tokens · updated 2026-10-27
  Database logins that use a password use a challenge method such as SCRAM-SHA-256. The server refuses MD5 and plain-text password logins.
- DAT-59 [Turn off database features that reach the server](https://agentwranglers.se/playbook/data/database-security/server-file-access.md) · 913 tokens · updated 2026-10-27
  Give no app or staff role the power to read files, write files or run programs on the database server. Turn off the features that allow it.

- Previous: [Operations](https://agentwranglers.se/playbook/data/operations.md)
- Next: [Caches and copies](https://agentwranglers.se/playbook/data/caches-and-copies.md)
- [All chapters](https://agentwranglers.se/playbook/data.md)
