blue-team

Patches failing guardrail or test cases one root-cause class at a time under a regression gate.

Updated Sep 9, 2026
One-click install
npx skills add https://github.com/xlinh2301/EditCTC --skill blue-team-xlinh2301
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: blue-team
Source: https://github.com/xlinh2301/EditCTC/tree/main/.agents/skills/blue-team
Command: npx skills add https://github.com/xlinh2301/EditCTC --skill blue-team-xlinh2301

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? You have a concrete list of failures — a red-team failure catalogue against a guardrail/classifier, or failing tests from a CI/CD run — and need the target fixed until every failure class is closed without breaking anything that already passed. Doing this by hand risks over-broad fixes, regressions, and untraceable changes. ## Core Features & Use Cases - Catalogue ingestion: tools/ingest.py normalizes red-team failures.jsonl, JUnit XML reports, or pytest node-id lists into one failure catalogue grouped by root-cause class. - Gated fix loop: each iteration patches one class, then tools/verify.py checks that the class closed and zero regressions appeared (oracle mode uses a frozen ground-truth oracle plus a benign holdout; tests mode re-runs the suite and reads the JUnit report); bad patches are reverted. - Pull-request handoff: kept fixes become one commit per class on a PR branch opened with gh pr create, degrading to git format-patch plus a PR_BODY.md when git or gh is unavailable. - Use Case: A red-team run found 5 bypass classes in your prompt guardrail. Point this loop at the failures file and the guardrail source; it normalizes inputs, broadens the policy, tightens over-broad rules, and opens a PR with each fix as a separate commit. ## Quick Start Ask the AI to run the blue-team loop on your failing tests or red-team failures file, naming the target source files it may edit, and let it iterate until every failure class is closed or the budget runs out.

Frequently Asked Questions about blue-team

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix failing pytest tests automatically with an AI loop?▼

Run your suite with pytest --junitxml to produce a JUnit report, convert it to a failure catalogue with tools/ingest.py --from junit, then run the loop in tests mode. Each iteration patches one failure class and re-runs the suite via tools/verify.py, keeping the fix only if no previously-passing test breaks.

How do I patch a guardrail or classifier against red-team failures?▼

Convert the red-team failures.jsonl into a catalogue with tools/ingest.py --from red-team, then run the loop in oracle mode with a frozen ground-truth oracle command and a benign holdout file. A case is closed when the target agrees with the oracle, and any newly broken holdout input counts as a regression that reverts the patch.

What is the difference between oracle mode and tests mode?▼

Oracle mode fixes a guardrail or filter by comparing its verdicts against a frozen ground-truth oracle on each catalogue input, using a holdout set as the regression guard. Tests mode fixes code by re-running a test command that writes JUnit XML, treating any newly failing previously-passing test as a regression.

Does the blue-team loop require git or GitHub?▼

Git and the gh CLI are needed only for the default branches strategy and pull-request handoff. In snapshots mode it works on non-git trees, and without gh it degrades to writing git format-patch output plus a PR_BODY.md into the sandbox for manual PR creation.

When should I not use this defensive fixing loop?▼

Do not use it to discover new failures — that is the red-team skill's job — or to edit the oracle, tests, or holdout that define ground truth, since those are frozen. It also stops rather than thrashes when a class resists the configured patience of attempts, marking it a residual.