ag-verificar-seguranca — Auditar Codigo
Spawn the ag-verificar-seguranca agent to perform a security and quality audit.
Invocation
Use the Agent tool with:
subagent_type: ag-verificar-seguranca
mode: auto
run_in_background: true
prompt: Compose from template below + $ARGUMENTS
Prompt Template
Projeto: [CWD or user-provided path]
Focus: [OWASP, secrets, deps, all]
Executar auditoria de seguranca conforme foco solicitado. Verificar OWASP Top 10, secrets expostos, dependencias vulneraveis, RLS, e conformidade.
Gerar relatorio com severidade e recomendacoes.
Important
- ALWAYS spawn as Agent subagent — do NOT execute inline
- After spawning, confirm to the user
- READ-ONLY audit — does NOT fix issues, only reports findings
- Supports focus modes: OWASP, secrets, deps, or all
Output
- audit-report.md com findings: descricao, severity, localizacao (file:line), remediacao
- OWASP Top 10 checklist (A01-A10)
- Secrets scan (grep: sk_, pk_, api_key, token, password)
- Dependency audit (
bun run audit --production)
- RLS verification (para projetos Postgres/Supabase)
Anti-Patterns
- NUNCA auditar sem rodar
bun run audit — ferramenta automatica detecta o que olho humano perde
- NUNCA ignorar severity CRITICAL — um CRITICAL bloqueia deploy
- NUNCA confiar no README para avaliacao de seguranca — codigo e a verdade
Escalacao: Issues para Findings P0/P1
Findings com severidade P0 (CRITICAL) ou P1 (HIGH) DEVEM ser registrados como GitHub Issues:
Agent({
subagent_type: "ag-registrar-issue",
name: "issue-registrar",
model: "haiku",
run_in_background: true,
prompt: "Repo: [detectar]\nOrigem: ag-verificar-seguranca\nSeveridade: [P0-critical ou P1-high]\nTitulo: [SECURITY] descricao do finding\nContexto: [finding completo: descricao, localizacao file:line, OWASP category, remediacao sugerida]\nArquivos: [arquivos afetados]\nLabels: security"
})
- P0/P1: SEMPRE criar issue (bloqueia deploy)
- P2/P3: apenas documentar em audit-report.md (nao poluir backlog)
Quality Gate
Auditoria de Resiliencia
Para cada dependencia externa (API, DB, servico), verificar:
Classificacao de Severidade — Resiliencia
| Achado |
Severidade |
| Chamada externa sem timeout |
P0 — CRITICO |
| Retry sem backoff (loop infinito possivel) |
P0 — CRITICO |
| Sem circuit breaker em dependencia critica |
P1 — ALTO |
| Sem fallback para servico opcional |
P2 — MEDIO |
| Health check incompleto (so liveness) |
P3 — BAIXO |
1---
2name: ag-verificar-seguranca
3description: "Auditoria de seguranca, qualidade e conformidade. OWASP Top 10, secrets scan, dependency audit. Use antes de deploy."
4model: sonnet
5argument-hint: "[projeto-path]"
6disable-model-invocation: true
7metadata:
8 source: https://skillmd.com/skills/aibot88/ag-verificar-seguranca
9---
10
11# ag-verificar-seguranca — Auditar Codigo
12
13Spawn the `ag-verificar-seguranca` agent to perform a security and quality audit.
14
15## Invocation
16
17Use the **Agent tool** with:
18- `subagent_type`: `ag-verificar-seguranca`
19- `mode`: `auto`
20- `run_in_background`: `true`
21- `prompt`: Compose from template below + $ARGUMENTS
22
23## Prompt Template
24
25```
26Projeto: [CWD or user-provided path]
27Focus: [OWASP, secrets, deps, all]
28
29
30Executar auditoria de seguranca conforme foco solicitado. Verificar OWASP Top 10, secrets expostos, dependencias vulneraveis, RLS, e conformidade.
31Gerar relatorio com severidade e recomendacoes.
32```
33
34## Important
35- ALWAYS spawn as Agent subagent — do NOT execute inline
36- After spawning, confirm to the user
37- READ-ONLY audit — does NOT fix issues, only reports findings
38- Supports focus modes: OWASP, secrets, deps, or all
39
40## Output
41
42- audit-report.md com findings: descricao, severity, localizacao (file:line), remediacao
43- OWASP Top 10 checklist (A01-A10)
44- Secrets scan (grep: sk_, pk_, api_key, token, password)
45- Dependency audit (`bun run audit --production`)
46- RLS verification (para projetos Postgres/Supabase)
47
48## Anti-Patterns
49
50- NUNCA auditar sem rodar `bun run audit` — ferramenta automatica detecta o que olho humano perde
51- NUNCA ignorar severity CRITICAL — um CRITICAL bloqueia deploy
52- NUNCA confiar no README para avaliacao de seguranca — codigo e a verdade
53
54## Escalacao: Issues para Findings P0/P1
55
56Findings com severidade P0 (CRITICAL) ou P1 (HIGH) DEVEM ser registrados como GitHub Issues:
57
58```
59Agent({
60 subagent_type: "ag-registrar-issue",
61 name: "issue-registrar",
62 model: "haiku",
63 run_in_background: true,
64 prompt: "Repo: [detectar]\nOrigem: ag-verificar-seguranca\nSeveridade: [P0-critical ou P1-high]\nTitulo: [SECURITY] descricao do finding\nContexto: [finding completo: descricao, localizacao file:line, OWASP category, remediacao sugerida]\nArquivos: [arquivos afetados]\nLabels: security"
65})
66```
67
68- P0/P1: SEMPRE criar issue (bloqueia deploy)
69- P2/P3: apenas documentar em audit-report.md (nao poluir backlog)
70
71## Quality Gate
72
73- [ ] Nenhum secret hardcoded encontrado?
74- [ ] Nenhuma vulnerabilidade CRITICAL sem remediacao?
75- [ ] OWASP Top 10 coberto (A01-A10)?
76- [ ] Todas as issues tem remediacao sugerida?
77- [ ] Findings P0/P1 registrados como GitHub Issues via ag-registrar-issue?
78
79### Auditoria de Resiliencia
80Para cada dependencia externa (API, DB, servico), verificar:
81- [ ] **Circuit Breaker** presente? (evita cascading failure)
82- [ ] **Retry com backoff exponencial**? (com jitter, sem retry em 4xx)
83- [ ] **Timeout configurado**? (connection + read + total)
84- [ ] **Fallback definido**? (cache stale, valor padrao, degradacao)
85- [ ] **Health Check** implementado? (liveness + readiness)
86- [ ] **Idempotencia** em operacoes de escrita? (retry seguro)
87
88### Classificacao de Severidade — Resiliencia
89
90| Achado | Severidade |
91|--------|-----------|
92| Chamada externa sem timeout | P0 — CRITICO |
93| Retry sem backoff (loop infinito possivel) | P0 — CRITICO |
94| Sem circuit breaker em dependencia critica | P1 — ALTO |
95| Sem fallback para servico opcional | P2 — MEDIO |
96| Health check incompleto (so liveness) | P3 — BAIXO |