MÓDULO 3.6

🛡️ Prompts de Segurança

Reversível × irreversível, bloco safety canônico, --no-verify proibido e checklist de blast radius.

7
Tópicos
35
Minutos
Avançado
Nível
Risco
Tipo
BLAST RADIUS — reversível → irreversível REVERSÍVEL git commit, edit CUSTOSO rebase, stash drop PERIGOSO push --force, drop db IRREVERSÍVEL rm -rf, deploy prod ↑ conforme sobe = mais confirmação humana
1

⚠️ Reversível × irreversível

O único eixo que importa para decidir "pedir permissão":

✓ Reversível

  • git commit (reset)
  • • Edit de arquivo (git reverte)
  • git checkout -b
  • • Criar arquivo novo

✗ Irreversível

  • rm -rf (sem backup)
  • git push --force em main
  • DROP TABLE
  • • Enviar email / PR / deploy
2

🛑 Lista de confirmação

Cole esta lista no seu prompt de auto mode:

<require_human_confirmation_for>
- `rm -rf`, `rm` de arquivos fora da sua área de trabalho
- `git push --force`, `git reset --hard origin/*`
- `git branch -D`, `git checkout --`, `git restore .`, `git clean -f`
- `DROP TABLE`, `TRUNCATE`, migrations em produção
- Criação/envio de PR, email, Slack, deploy
- `curl | sh`, `npm publish`, `docker push`
- Edição de arquivos de infra (terraform, helm, k8s)
- Qualquer comando que você não reconheça
</require_human_confirmation_for>
3

📝 Prompt canônico de safety

<safety_protocol>
Consider the reversibility of any action before executing.

Before running destructive operations (git reset --hard,
push --force, rm -rf, DROP TABLE, deploy, curl | sh),
consider whether there is a safer alternative that
achieves the same goal. Only use destructive operations
when they are truly the best approach AND the human has
explicitly approved them for this session.

Never skip hooks (--no-verify) or bypass signing
(--no-gpg-sign). If a hook fails, investigate and fix
the underlying issue — do not sidestep.

When an action affects other humans or external systems
(PR, email, deploy, msg), always ask before acting, even
in auto mode.

If unsure, prefer: move to `.trash/` over `rm`, create
new branch over amending, print command over running it.
</safety_protocol>
4

🔥 Evitando --no-verify

✗ Atalho tóxico

git commit --no-verify -m "wip"

Pula pre-commit hook. Teste/lint não roda. Bugs chegam em main.

✓ Investigue

Hook falhou? Fix o lint/test. Se é falso positivo, conserte o hook. Nunca contorne.

5

🗃️ Arquivos desconhecidos

Arquivo .bak, .tmp, ~$doc pode ser backup crítico do humano. Deletar por hábito = dor.

Regra

Mover para .trash/ com timestamp e registrar em progress.txt. Nunca rm direto. Se o humano confirmar, aí rm -rf .trash/ no final.

6

🌐 Impacto externo

AçãoQuem vê?Regra
git commit localsó vocêauto mode OK
git push (branch)timeauto mode OK se branch sua
Abrir PRtime notificadopergunte antes
Email / Slackhumanos reaispergunte antes
Deploy / npm publishmundoconfirmação explícita
7

✅ Checklist de blast radius

4 perguntas antes de qualquer ação sensível:

  1. Reversível? Se não, pare e peça.
  2. Quem vê? Se alguém além de você, peça.
  3. Guard-rail existe? Teste/CI/staging para detectar erro?
  4. Humano aprovou? Explicitamente para esta sessão.

Cole como comentário no início de prompts de auto mode.

📋 Resumo

Reversível × irreversível — o único eixo
Safety protocol block — copy/paste em auto mode
Nunca --no-verify — hook existe por motivo
Checklist 4 perguntas — vira ritual

Próximo Módulo:

3.7 — Longo Horizonte e Multi-Context