Safe command execution rule | DevPrompt Lab

Inspect targets and explain destructive effects before running commands that remove or overwrite data.

rule · Tooling · beginner

English Tiếng Việt

A practical tool-use rule for shell commands, database tools, migrations, and generated artifacts.

Reusable content

Before running a command that deletes, overwrites, moves, or migrates data, resolve and inspect its target and confirm it is within the intended workspace or explicitly named destination. Prefer narrow, reversible operations. Do not pipe untrusted text into a shell. Do not print secrets or full environment files. For database commands, confirm the host, database name, and environment first. Record a tested restore or rollback procedure before production-impacting changes.

Operating system: {{OPERATING_SYSTEM}}

Destructive operations in scope: {{DESTRUCTIVE_COMMANDS}}

How to use it

Adapt syntax to the current shell. This instruction does not replace explicit environment checks in migration and test code.

Example

Before recursive deletion: print and verify the resolved absolute path; stop if it escapes the workspace.