Home

Database

This page lists the safe and destructive patterns in the MySQL, PostgreSQL, and SQLite shell guard packs. See Shell Tool for how these patterns are evaluated.

MySQL

Pack ID: database.mysql

Guards against destructive MySQL operations

Destructive patterns

Rule IDReasonSuggestionConfidence
database.mysql.drop_databasePermanently destroys the entire databaseUse mysqldump to backup firstHigh
database.mysql.drop_tablePermanently destroys a table and all its dataBackup the table first with mysqldumpHigh
database.mysql.truncateRemoves all rows without loggingUse DELETE FROM with a WHERE clauseMedium
database.mysql.delete_no_whereDeletes all rows from a tableAdd a WHERE clause. If your query already has a WHERE clause on a separate line, combine onto one lineMedium

PostgreSQL

Pack ID: database.postgresql

Guards against destructive PostgreSQL operations

Destructive patterns

Rule IDReasonSuggestionConfidence
database.postgresql.drop_databasePermanently destroys the entire databaseUse pg_dump to backup firstHigh
database.postgresql.drop_tablePermanently destroys a table and all its dataUse pg_dump -t <table> to backup first; use a transaction with BEGIN/ROLLBACK for safetyHigh
database.postgresql.truncateRemoves all rows without logging individual deletionsUse DELETE FROM with a WHERE clause for selective deletionMedium
database.postgresql.delete_no_whereDeletes all rows from a tableAdd a WHERE clause to limit deletion scope. If your query already has a WHERE clause on a separate line, combine them onto one line (e.g., DELETE FROM users WHERE active = false)Medium

SQLite

Pack ID: database.sqlite

Guards against destructive SQLite operations

Destructive patterns

Rule IDReasonSuggestionConfidence
database.sqlite.drop_tablePermanently destroys a tableBackup the database file firstHigh
database.sqlite.delete_no_whereDeletes all rows from a tableAdd a WHERE clause. If your query already has a WHERE clause on a separate line, combine onto one lineMedium

This documentation was generated from rust/agents/src/tool_guard/shell/packs/database.rs.

© 2026 Stencila