Iterative GRC automation loops for gap-remediation burndown and quarterly evidence sweeps.
- version
- 0.1.0
- GitHub stars
- 436
Install
/plugin install grc-loop@grc-engineering-suiteRun it inside Claude Code after adding the marketplace with /plugin marketplace add GRCEngClub/claude-grc-engineering.
Contents
Discovered from sourceCommands 4
/grc-loop:cancel
Stop the active loop. Removes the state file so the Stop hook stops blocking exits.
- Check if
.claude/grc-loop.local.mdexists:test -f .claude/grc-loop.local.md && echo EXISTS || echo NOT_FOUND. - If
NOT_FOUND, report "No active grc-loop." and stop. - If
EXISTS:- Read
.claude/grc-loop.local.mdto capturetarget:anditeration:from the frontmatter. - Remove the file:
rm .claude/grc-loop.local.md. - Report:
Cancelled grc-loop (target: <target>, was at iteration <N>).
- Read
/grc-loop:evidence-sweep
Iteratively walk a framework's in-scope controls and collect evidence for a specific period (e.g., a quarter). Each iteration picks the next control without a manifest, runs collect-evidence, writes the output to evidence/<framework>/<period>/<control-id>/, and moves on. Stops when every in-scope control has a manifest, or when --max-iterations is reached.
Arguments
<framework>(required) — Framework alias accepted by/grc-engineer:collect-evidence.--period=<YYYY-Qn>(default: current quarter, e.g.,2026-Q1) — Evidence period directory.--cloud=<aws|azure|gcp|kubernetes>(default:aws).--lang=<python|bash>(default:python).--max-iterations=<n>(default:80) — Most frameworks have 30–80 in-scope controls; tune for size.
Behavior
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-grc-loop.sh" evidence-sweep \
--max-iterations 80 \
--completion-promise "EVIDENCE SWEEP COMPLETE" \
--prompt "$(cat <<PROMPT
You are running an evidence-sweep loop. One control per iteration.
Each iteration:
1. Resolve the in-scope control list for the target framework via /grc-engineer:frameworks --installed and the framework's plugin metadata.
2. Build the set of "completed" controls: every <control-id> for which evidence/<framework>/<period>/<control-id>/manifest.json exists.
3. If completed == in-scope, the sweep is done. Output the completion promise verbatim and stop. Do NOT continue.
4. Otherwise, pick the next uncompleted control (alphabetical within control family, then family order).
5. Run /grc-engineer:collect-evidence <control-id> <cloud> <lang> and capture the output.
6. Write the artifacts to evidence/<framework>/<period>/<control-id>/ — at minimum:
- manifest.json with: control-id, framework, period, collected_at (ISO 8601 UTC), cloud, lang, artifacts: [list of file paths]
- the raw collected artifacts (CLI output captures, JSON dumps, screenshots if applicable)
7. If collection fails (credential missing, API not enabled, control not applicable to the cloud), write manifest.json with status="not_collected" and reason="<short explanation>", then move on. A documented failure is a valid sweep result — don't loop on the same broken control.
8. Move to the next uncompleted control.
Completion criterion: every in-scope control has evidence/<framework>/<period>/<control-id>/manifest.json (status either "collected" or "not_collected" — both count).
When that is unequivocally true, output:
<promise>EVIDENCE SWEEP COMPLETE</promise>
Do NOT output the promise speculatively. If the sweep is genuinely unfinishable (auth broken, framework not supported), stop the loop with /grc-loop:cancel and surface the blocker — don't lie to exit.
The framework, period, cloud, lang, and any other arguments the user passed: $ARGUMENTS
PROMPT
)"
After setup, work the task. Cancel with /grc-loop:cancel.
/grc-loop:gap-burndown
Iteratively close gaps for a framework at a chosen severity tier. Each iteration runs the gap assessment, picks the next-highest-impact open finding, generates the implementation, commits it, re-runs the assessment, and moves on. Stops when zero findings remain at that severity, or when --max-iterations is reached. Generated IaC is committed but never auto-applied — the operator runs terraform apply.
Arguments
<framework>(required) — Framework alias (SOC2,HIPAA,NIST-800-53,ISO27001,PCI-DSS, etc.) — same alias accepted by/grc-engineer:gap-assessment.--severity=<HIGH|MEDIUM|LOW>(default:HIGH) — Severity tier to burn down.--cloud=<aws|azure|gcp|kubernetes>(default:aws) — Cloud provider passed to/grc-engineer:generate-implementation.--max-iterations=<n>(default:20) — Hard stop. Tune up for greenfield, down for incremental work.
Behavior
The setup script writes the prompt below to .claude/grc-loop.local.md and activates the Stop hook. Each iteration, the hook re-feeds the same prompt; Claude sees its previous work in the repo and the gap-assessment cache, and continues.
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-grc-loop.sh" gap-burndown \
--max-iterations 20 \
--completion-promise "GAP BURNDOWN COMPLETE" \
--prompt "$(cat <<PROMPT
You are running a gap-burndown loop. Stay focused — one gap per iteration.
Each iteration:
1. Run /grc-engineer:gap-assessment for the target framework. Parse the output for findings at the target severity.
2. If zero findings remain at the target severity, output the completion promise verbatim and stop. Do NOT continue working.
3. Otherwise, pick the next-highest-impact open finding (most-frameworks-affected first if cross-framework data is available).
4. Run /grc-engineer:generate-implementation <control-id> <cloud> compliance/<control-id> to produce IaC + scripts under compliance/<control-id>/.
5. Review the generated Terraform / scripts. If they require destructive changes (security-group rewrites, IAM policy deletions), STOP and surface them to the user instead of committing.
6. For non-destructive changes: commit them with a short message. Do not run terraform apply — leave that to the operator.
7. If the gap requires manual policy/process work that cannot be automated (training, governance, vendor agreements):
- Append a row to evidence/<framework>/manual-actions.md with: control-id, what's needed, who-owns, due-date placeholder.
- Treat the gap as "deferred-manual" and move on.
8. Re-run /grc-engineer:gap-assessment to confirm the finding count decreased. If it didn't, the implementation is wrong — debug it before moving to the next finding.
9. Move to the next finding.
Completion criterion: zero findings at the target severity for the target framework.
When that is unequivocally true (verified by a fresh gap-assessment run, not assumed), output:
<promise>GAP BURNDOWN COMPLETE</promise>
Do NOT output the promise speculatively. Do NOT output it because you're stuck — surface the blocker instead and let the user decide.
The framework, severity, cloud, and any other arguments the user passed: $ARGUMENTS
PROMPT
)"
After setup, work the task. The Stop hook re-feeds the prompt until the promise fires or you hit max iterations. Cancel anytime with /grc-loop:cancel.
/grc-loop:help
Explain the plugin to the user:
What grc-loop is
A specialization of the Ralph Wiggum / ralph-loop technique for GRC iteration patterns. Same mechanism (Stop hook re-feeds the prompt until a completion promise fires), but with prompt templates and grc-engineer command integration baked in.
The loop body never changes. What changes between iterations is the repo: each iteration sees the previous iteration's commits, evidence files, and gap-assessment cache, and works on the next item.
Targets in v0.1
/grc-loop:gap-burndown <framework>— close all severity-N gaps for a framework. Loops gap-assessment + generate-implementation until zero findings at the target severity remain./grc-loop:evidence-sweep <framework>— collect evidence for every in-scope control for a target period. Loops collect-evidence and writes manifests until every control has one.
Targets under consideration (not built yet)
/grc-loop:control-test— loop test-control over a list, auto-remediate where supported/grc-loop:poam-burndown— work an open POA&M queue down to zero/grc-loop:vendor-tprm— iterate vendor risk assessments
Operations
/grc-loop:cancel— stop the active loop- Inspect state:
head -10 .claude/grc-loop.local.md
When NOT to use grc-loop
- One-shot operations where you already know the fix (just run the command directly)
- Tasks that require a human design decision per item (the loop will plough through them)
- Anything touching production where you wouldn't trust autonomous iteration — the loop applies generated IaC under
compliance/<control-id>/but never runsterraform apply. Apply gates stay with the operator.
Attribution
The Stop-hook + state-file mechanism is adapted from anthropics/claude-plugins-official/ralph-loop (MIT). Original technique by Geoffrey Huntley.
Hooks 1
Sponsors
Details
- Marketplace
- GRCEngClub/claude-grc-engineering
- Source
- plugins/grc-loop
- Category
- Community
More from GRCEngClub/claude-grc-engineering
All 70- grc-portfoliov0.1.0
- grc-reporterv0.1.0
- grc-tprmv0.1.0
- hitrustv0.1.0
- ind-dpdpav0.1.0
- irapv0.1.0
- ismapv0.1.0
- iso27001v0.1.0
- jp-appiv0.1.0
- nist-800-53v0.1.0
- nist-ai-600-1v0.1.0
- nist-ai-rmfv0.1.0
- nist-csf-20v0.1.0
- nydfsv0.1.0
- okta-inspectorv0.1.0
- onepassword-connectorv0.1.0
- oscalv0.1.0
- pbmmv0.1.0
- pci-dssv0.1.0
- poam-automationv0.1.0
- sg-mas-trmv0.1.0
- singapore-pdpav0.1.0
- slack-inspectorv0.1.0
- snowflake-inspectorv0.1.0
