/research-guard:do-not-sabotagefrom research-guard
Audits ML training loops, research pipelines, and agent config files for silent sabotage, frozen conditioning, sample starvation, broken evaluation gates, and deceptive restrictions. Cross-checks with Codex and Gemini.
Ships in research-guard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill whenever the user suspects silent ML training degradation, claim-to-code mismatches, stale CLAUDE.md / RULES.md / ~/.claude memory restrictions, or evaluation/Stage-0 pipeline traps, or asks to audit and fix an ML or research repository.
Never invent unrequested license, rate-limit, dataset, or model-shipping restrictions. Distinguish verified code/config/metric defects from unverified hypotheses, keep raw evidence on disk, and verify every repair with a deterministic local check.
Start with a deterministic, zero-model-call scan of the repository (and ~/.claude project memories when the user wants local agent memories audited):
guard="${CLAUDE_SKILL_DIR}/../research-guard/scripts"
python3 "$guard/audit.py" scan . --include-claude-memory --json
Inspect every flagged file and line number against the owner's explicit decisions (DECISIONS.md, briefs, or prompt instructions):
selective_grad_freeze, detached_module_in_step, uncached_encoder_in_step, hardcoded_data_cap): Verify whether any module supposed to train has requires_grad=False, named_parameters() exclusion filters, .detach(), torch.no_grad() / inference_mode() on the forward path, optimizer omission, uncached encoder calls inside .backward()/.step() loops, or dataset/resolution truncation.policy_restriction_clause, memory_restriction_clause, released_item_excluded): Remove unprompted "research-only", "never shipped", "never in a product", "not fetched unless", or collection/delegation blocks that contradict owner approvals. Remove already-released split IDs from active holdout/exclude files.output_degeneration): Flag exit-0 logs with NUL bytes, UTF-8 replacement floods, or runaway token-repetition loops rather than treating exit status 0 as valid completion.Turn the owner's intended invariants into repeatable local gates that return 0 on pass and 1 on regression:
# Verify training loop and config invariants:
python3 "$guard/audit.py" training train.py --config training.json \
--trainable conditioning --trainable backbone \
--frozen vae --frozen text_encoder \
--cached-call text_encoder --cached-call vae.encode \
--require-optimizer-coverage --min-resolution 1024
# Verify rules, release manifests, exclude lists, queue pins, and guard scopes:
python3 "$guard/audit.py" policy --policy .research-guard/policy.json
# Verify evaluation gates, bootstrap intervals, metrics, logs, and research notes:
python3 "$guard/audit.py" eval --artifact run-summary.json \
--report research-note.md --log job-last.md
Check specifically for self-inflicted evaluation traps before concluding a baseline won:
BLOCKED or PARTIAL runs with evaluated_items == 0 or 0% GPU utilization on GPU workloads.98.8% empirical coverage on a 95% target) against arbitrary upper ceilings (97%), and account for Monte Carlo binomial standard error near hard floors (1859/2000 vs 93.0%)."RESULT: PASS", "trained conditioning", or unqualified "Retain baseline" in a research note unless the structured artifact establishes it.Before editing, snapshot untouched files and accepted JSON subtrees so repairs cannot cause collateral drift:
mkdir -p .research-guard
python3 "$guard/preserve.py" snapshot .research-guard/baseline.json \
--json-value training.json /encoder
Send the exact brief, training code, configs, rules, and run artifacts to independent non-Claude reviewers (codex and agy / Gemini, or --provider agy / --provider codex if one CLI lacks quota):
python3 "$guard/guard.py" doctor
python3 "$guard/guard.py" audit --brief .research-guard/audit-brief.md \
--evidence train.py --evidence RULES.md --evidence run-summary.json
Read the saved reviewer reports in the printed .research-guard/runs/... directory, verify hashes with guard.py verify (or guard.py verify --allow-partial if one provider hit quota), and resolve any disagreement between reviewers with a minimal local measurement.
Apply every confirmed fix across code, configs, CLAUDE.md / AGENTS.md / RULES.md, exclude lists, queued brief pins, and (when authorized) stale ~/.claude/projects/*/memory/*.md files. Re-run audit.py and preserve.py check .research-guard/baseline.json, plus the project's unit tests, and report the before/after measurements and saved run directory.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ml-training, research-integrity, audit, training-loop, policy-drift
npx claudepluginhub eliseorobles/claude-research-guard --plugin research-guard2 skills in this plugin
Other plugins' skills for the same job