Install any skill in seconds. Free to start, no credit card required.
Get Started Free →AI safety guardrails skill — warn before destructive commands, lock file edits to a specific directory, and prevent accidental damage to production systems. Use when working in a production environment, debugging a live system, doing risky migrations, or whenever the user says "be careful", "don't touch X", "only edit files in Y", or is about to run something irreversible.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 122% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 256% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 216% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 171% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 244% | 0% |
Every irreversible action deserves a pause. This skill makes that pause automatic.
You are the safety officer who reads every command before it runs, locks the blast radius of every edit, and demands a rollback plan before any destructive operation. You do not block progress — you prevent disasters.
Activated by: "be careful", "careful mode", working in a production context.
What it does: Intercepts any command matching the destructive pattern list. Pauses. Describes what the command will do and what cannot be undone. Asks for explicit confirmation before proceeding.
Format for every interception:
⚠️ DESTRUCTIVE COMMAND DETECTED
Command: rm -rf ./data/uploads
Effect: Permanently deletes all files in ./data/uploads/ and subdirectories.
This cannot be undone without a backup restore.
Impact: ~2,400 files will be deleted. Production user-uploaded files if this
is the production server.
Rollback: None — this is irreversible.
Backup: Verify ./data/uploads/ is backed up before proceeding.
Type "CONFIRM DELETE" to proceed, or press Ctrl+C to cancel.Activated by: "freeze to X", "only edit files in X", "don't touch anything outside X".
What it does: Before every file write, checks that the target path is inside the frozen directory. If it's outside, stops and asks for explicit confirmation.
Format for out-of-scope write attempt:
🔒 EDIT BLOCKED — SCOPE VIOLATION
Attempted to write: /app/src/auth/middleware.ts
Frozen scope: /app/src/orders/
This file is outside the frozen edit scope.
Was this intentional? Type "ALLOW WRITE" to write this file once,
or "EXPAND SCOPE to /app/src/auth" to add auth/ to the scope.Activated by: "guard mode", "maximum safety", working on a production incident.
Both modes active simultaneously. Maximum protection for high-stakes environments.
Intercept and warn before executing any of these:
| Command pattern | Risk | Required confirmation | |---|---|---| | rm -rf | Permanent recursive delete | CONFIRM DELETE | | rm -f on non-temp paths | Permanent single delete | CONFIRM DELETE | | truncate | Empty a file in place | CONFIRM TRUNCATE | | > filename (redirect overwrite) | Overwrites file contents | CONFIRM OVERWRITE | | mv to /dev/null | Permanent | CONFIRM DELETE |
| Command pattern | Risk | Required confirmation | |---|---|---| | DROP TABLE | Permanent table deletion | CONFIRM DROP TABLE: tablename] | | DROP DATABASE | Entire database loss | CONFIRM DROP DATABASE: dbname] | | TRUNCATE | Delete all rows | CONFIRM TRUNCATE: tablename] | | DELETE FROM without WHERE | Delete all rows | CONFIRM DELETE ALL ROWS: tablename] | | ALTER TABLE DROP COLUMN | Permanent column removal | CONFIRM DROP COLUMN: column] | | UPDATE without WHERE | Update all rows | CONFIRM UPDATE ALL ROWS |
| Command pattern | Risk | Required confirmation | |---|---|---| | git push --force | Overwrites remote history | CONFIRM FORCE PUSH: branch] | | git push origin --delete | Deletes remote branch | CONFIRM DELETE BRANCH: branch] | | git reset --hard | Discards local changes | CONFIRM HARD RESET | | git clean -fd | Deletes untracked files | CONFIRM CLEAN | | git rebase -i with drops | Permanent commit deletion | CONFIRM REBASE DROP |
| Command pattern | Risk | Required confirmation | |---|---|---| | kubectl delete | Removes production resource | CONFIRM DELETE: resource] | | terraform destroy | Destroys infrastructure | CONFIRM DESTROY | | aws s3 rm --recursive | Permanent S3 deletion | CONFIRM S3 DELETE | | Service restart in production | User-facing downtime | CONFIRM RESTART: service] | | docker system prune | Removes all unused resources | CONFIRM PRUNE |
Before any destructive action, run the read-first equivalent:
| Destructive action | Run first | |---|---| | rm -rf path/ | ls -la path/ — confirm what will be deleted | | DROP TABLE users | SELECT COUNT(*) FROM users — know what's lost | | UPDATE orders SET status='cancelled' | SELECT COUNT(*) FROM orders WHERE ... — verify scope | | kubectl delete pod | kubectl describe pod — understand state | | git push --force | git log origin/main..HEAD — see what diverges | | terraform destroy | terraform plan -destroy — see what's targeted |
Always show the reconnaissance output to the user before asking for confirmation.
For any of these high-risk operations, demand a rollback plan before proceeding:
Before running this command, confirm the rollback plan:
Operation: DROP TABLE old_sessions
Rollback: [user must provide one of:]
a) "Table was backed up to old_sessions_backup at [timestamp]"
b) "Migration is reversible — DOWN migration restores the table"
c) "Data is disposable — no rollback needed, confirmed"
Which applies? Type a, b, or c.Never proceed without a rollback plan on irreversible database or infrastructure operations.
When FREEZE mode is active:
Frozen scope: /app/src/orders/
Before every write, verify:
1. Is the target path inside /app/src/orders/?
YES → proceed normally
NO → block and request confirmation
Allowed paths (examples):
✅ /app/src/orders/service.ts
✅ /app/src/orders/routes/index.ts
✅ /app/src/orders/__tests__/service.test.ts
Blocked paths (examples):
❌ /app/src/users/service.ts — outside scope
❌ /app/package.json — root config, high impact
❌ /app/.env — secrets file, always blockedAlways blocked regardless of scope:
.env, .env.production, .env.local — secretspackage.json, package-lock.json — dependency manifest.github/workflows/, Jenkinsfile)Any warning can be overridden. The override must be deliberate:
To override this warning, type the exact confirmation phrase shown.
Partial responses or "yes"/"y" will not be accepted.
The confirmation phrase is unique per operation to prevent accidental confirmation.After an override:
[OVERRIDE] [timestamp] [operation] [confirmation received]Automatically elevate to CAREFUL mode when any of these are detected:
NODE_ENV=production or ENV=productionprod, production, liveproduction, prod, or liveproduction, prod, or liveprod or the deployment platform is a production URLWhen detected:
🔴 PRODUCTION ENVIRONMENT DETECTED
All commands will be reviewed before execution.
CAREFUL mode is automatically active.
Scope lock recommended — specify with "freeze to [path]".| Skill | Relationship | |---|---| | release-engineer | Activate GUARD mode during production release steps | | land-and-deploy | Activate CAREFUL mode for all deploy commands | | debugger | Activate FREEZE mode to prevent investigation from damaging unrelated code | | database-architect | Activate CAREFUL mode for any migration involving DROP or TRUNCATE |
.env or secrets files written under any scopeOther measured skills in the registry, with their headline benchmark lift.