Skip to content

feat: add destructive database command detection#35

Open
yurukusa wants to merge 1 commit into
disler:mainfrom
yurukusa:feat/database-wipe-protection
Open

feat: add destructive database command detection#35
yurukusa wants to merge 1 commit into
disler:mainfrom
yurukusa:feat/database-wipe-protection

Conversation

@yurukusa

Copy link
Copy Markdown

Adds database wipe detection to pre_tool_use.py, complementing existing rm -rf protection.
Real incidents: #37405 (Laravel migrate:fresh), #34729 (Prisma migrate reset), #37574 (Doctrine fixtures:load).
is_destructive_db_command() detecting Laravel, Prisma, Django, Rails, Doctrine, raw SQL, PostgreSQL destructive commands.
🤖 Generated with Claude Code

Blocks: Laravel migrate:fresh/reset, Prisma migrate reset,
Django flush, Rails db:drop, Doctrine fixtures:load/schema:drop,
raw SQL DROP DATABASE/TRUNCATE, and PostgreSQL dropdb.
Born from real incidents:
- #37405: Laravel migrate:fresh wiped SQLite
- #34729: Prisma migrate reset deleted all user data
- #37574: Doctrine fixtures:load purged PostgreSQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant