executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
plan-security-auditPlan-only OWASP Top 10 and Supabase-first hardening burndown. Use when "security audit plan", "OWASP audit", "hardening plan", or "security burndown". Auth flows → audit-auth-flows. RLS → plan-rls-audit. Keys → plan-secrets-audit.
Independent GitHub snapshot · Automated classification · Original documentation governs
Degree of freedom: MIXED — OWASP mapping and severity are judgment; RLS
enumeration, secret scan, and npm audit run exactly. Stay plan-only.
No patches or destructive testing.
Role: Senior application security engineer.
Task: Exhaustive vulnerability audit (frontend, backend, auth, Supabase, deps, secrets), mapped to OWASP Top 10, then remediation plan. Audit & plan only — no code changes, no destructive testing.
| Skill | Does |
|---|---|
| plan-security-audit (this) | Plan with OWASP + Supabase-first burndown |
audit-security | Static security review (may fix) |
test-red-team | Adversarial runtime testing |
audit-db-schema | Schema health including RLS review |
Loop: see docs/PLAN-LOOPS.md — after plan-test-coverage, parallel with plan-perf-audit, before plan-docs-sync
Propose: enable RLS on
public.orders; rotate theservice_rolefound in the client bundle; addgetUser()on/api/orders. Risk: anon key + RLS-off = full table dump;service_rolein the bundle bypasses every policy. Keep-working:/dashboardlayout already callsgetUser()on the server. Phase: Critical — RLS + secret rotation first. Report:lib/supabase.ts:12service_role (type only — never the value). Table RLS detail →plan-rls-audit.
Read references/preservation-contract.md. Acknowledge in output #1.
Safety guardrails:
| File | Contents |
|---|---|
references/owasp-supabase-scope.md | OWASP map, RLS-first methodology, scans |
references/output-templates.md | Burndown, phased hardening, secrets list |
1. Stack fingerprint
2. RLS-first pass (Supabase MCP if available)
3. Bundle/secret scan (no value echo)
4. Auth-path trace
5. Dependency CVE scan
6. OWASP remainder (injection, headers, misconfig)
7. Burndown + phased hardening plan
8. Guardrails + research citations
Sentry MCP: security-related production errors. Firecrawl: current OWASP + Supabase patterns.
Delegate a scan pass to a subagent only when it is sizeable, independent of the others, and its raw output (audit dumps, grep results) has no place in the plan; brief it with the exact commands and the columns to return, and it inherits this pass's rules — it edits nothing and never pastes a secret value. Long sweeps are expected — context compaction exists, so finish the inventory rather than wrapping up early.
Enumerate every public table:
WITH CHECK on writes?#1 critical class: table without RLS + anon key in client = full data exposure.
Detail: references/owasp-supabase-scope.md
Inspect client bundle + source for:
service_role key (Critical — full RLS bypass).env committed / not gitignoredReport: file:line + type only — never the value.
npm audit, lockfile versions vs CVE databases — every CVE ID cited comes from scan output or an advisory lookup, never from memoryMap each finding to OWASP category.
Template: references/output-templates.md
Phases: Critical → High → Med/Low. Each remediation + "what must keep working".
Re-scan proposed after fixes (second pass).
[NEEDS VERIFICATION]service_role are Criticalplan-rls-audit; key rotation → plan-secrets-audit; app-layer auth flows → audit-auth-flows; LLM attacks → audit-llm-security[NEEDS VERIFICATION] + secrets-to-rotate (locations only)End the turn with a standalone recap in chat: the two or three highest-impact confirmed findings (locations only for secrets) and the first phase to approve. The plan is the deliverable — write it before the recap.
[NEEDS VERIFICATION].