battleprint
Skill30 starsChanged 52 days agoBSD-2-ClauseView on GitHub
Perform red and blue team adversarial analysis on AI systems. Use after ai-fingerprint to identify attack vectors and defense strategies for LLM/RAG/Agentic systems.
In this repository30 other files it gives its agents.
- skills/academy/agents.mdAGENTS.md
- academySkill
- amsc-data-movement-apiSkill
- amsc-magSkill
- amsc-python-clientSkill
- globus-computeSkill
- i2-apiSkill
- iri-apiSkill
- skill-explorerSkill
- croissant-validatorSkill
- datacard-generatorSkill
- hdmf-schema-builderSkill
- skill-creatorSkill
- well-convertSkill
- card-eval-updaterSkill
- agentic-vulnerabilities-scanSkill
- ai-fingerprintSkill
- fingerprintingSkill
- uncertainty-quantificationSkill
- uq-metrics-evaluatorSkill
- skill-searchSkill
- auroraSkill
- frontierSkill
- pbsSkill
- perlmutterSkill
- slurmSkill
- literature-searchSkill
- multi-agent-systemsSkill
- gkeyllSkill
- gs2Skill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Run it first so this skill can reuse its outputs.
- Distinctive: line 47
Never use compound statements, ever
- Distinctive: line 48
Always execute a bash command one at a time.
- Distinctive: line 49
Always execute a unix command one-at-a-time, never compound them.
- Distinctive: line 52
Never generate JSON directly, it's too difficult.
- Distinctive: line 53
Always write the python code that generates the JSON.
- Distinctive: line 54
Always use python code generator to generate JSON.
- Distinctive: line 55
Always use python validation code, to read and confirm JSON was generated properly.
- Distinctive: line 75
All subsequent references to paths use these variables.
- Very specific: line 78
Check if $FINGERPRINT_DIR/system_analysis.json exists
- Very specific: line 79
If it does NOT exist, invoke the ai-fingerprint skill with $TARGET_DIR as argument.
- Very specific: line 80
Read $FINGERPRINT_DIR/file_scan.json and $FINGERPRINT_DIR/system_analysis.json into the current context.
- Distinctive: line 102
Use the Agent tool to spawn two agents in parallel.
- Distinctive: line 113
Use Python's built-in JSON parser to check validity:
- Very specific: line 145
Use Agent tool with prompts/red_team_stage2.md and the above context.
- Very specific: line 147
Write output to: $OUTPUT_DIR/red_stage_2.json
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Battleprint - Agentic Execution of Red and Blue Team Security Analysis
You are executing the Battleprint skill. This performs a red and blue team adversarial analysis sequence.
Architecture Overview
This skill is a prompt-first architecture where YOU (Claude Code) handle all reasoning and analysis, while Python utilities provide fast data operations (file scanning, use of ai-fingerprint skill and its results).
Your Task
Execute a 4-stage analysis process that produces:
- Red Stage 1: Complete red team analysis of the target code base
- Blue Stage 1: Complete blue team analysis of the target code base
- Red Stage 2: Utilizes Blue Team's analysis to refine red team's attack plans
- Blue Stage 2: Utilizes Red Team's analysis to refine blue team's defense plans
Arguments
The user provides a target directory path.
Expected format: <target_dir>
Examples:
./my-app— analyze my-app directory/bob/fish— analyze absolute path
Required Skills
ai-fingerprint: Generates file_scan.json and system_analysis.json for the same target directory- Run it first so this skill can reuse its outputs.
- Output location:
<parent>/ai_fingerprint_results/<target_name>/
Execution Steps
EXECUTION GUIDE - APPLIES TO ALL PHASES AND STEPS
When executing bash or unix (e.g. ls, wc, cd, etc.) commands, never ever string them together into a single command.
- Never use
&& - Never use
|| - Never use compound statements, ever
- Always execute a bash command one at a time.
- Always execute a unix command one-at-a-time, never compound them.
When generating JSON, never ever output it directly. Always write python code that generates the json
- Never generate JSON directly, it's too difficult.
- Always write the python code that generates the JSON.
- Always use python code generator to generate JSON.
- Always use python validation code, to read and confirm JSON was generated properly.
- Take your time. Generate Python to output JSON. Generate Python to Validate JSON.
Phase 0: Setup and Check for AI-FingerPrint
Parse and set paths:
# Get absolute path of target
TARGET_DIR=$(cd "$target_dir" && pwd)
TARGET_BASE=$(dirname "$TARGET_DIR")
TARGET_NAME=$(basename "$TARGET_DIR")
# Fingerprint results location (alongside target)
FINGERPRINT_DIR="${TARGET_BASE}/ai_fingerprint_results/${TARGET_NAME}"
# Battleprint output location (alongside target)
OUTPUT_DIR="${TARGET_BASE}/battleprint_results/${TARGET_NAME}"
mkdir -p "$OUTPUT_DIR"All subsequent references to paths use these variables.
Verify fingerprint exists:
- Check if
$FINGERPRINT_DIR/system_analysis.jsonexists - If it does NOT exist, invoke the
ai-fingerprintskill with$TARGET_DIRas argument. Use a SEPARATE AGENT (via Agent tool) for this to prevent context bleed. - Read
$FINGERPRINT_DIR/file_scan.jsonand$FINGERPRINT_DIR/system_analysis.jsoninto the current context.
Phase 1: Stage 1 Red and Blue
Objective: Perform Red Team and Blue Team Analysis on the target directory.
Process:
- Read the file scan results:
cat "$FINGERPRINT_DIR/file_scan.json"- Read the system analysis results:
cat "$FINGERPRINT_DIR/system_analysis.json"Parallel Execute 2 Agents
Use the Agent tool to spawn two agents in parallel. Each Agent invocation is automatically in fresh context.
a. Red Team Agent - use
prompts/red_team_stage1.mdwith the fingerprint data b. Blue Team Agent - useprompts/blue_team_stage1.mdwith the fingerprint dataEach agent should write its output to:
- Red:
$OUTPUT_DIR/red_stage_1.json - Blue:
$OUTPUT_DIR/blue_stage_1.json
- Red:
- Verify Stage 1 Complete
Use Python's built-in JSON parser to check validity:
python3 -c "import json; json.load(open('$OUTPUT_DIR/red_stage_1.json'))" && echo "✓ Valid JSON" || echo "✗ Invalid JSON"and
python3 -c "import json; json.load(open('$OUTPUT_DIR/blue_stage_1.json'))" && echo "✓ Valid JSON" || echo "✗ Invalid JSON"Phase 2: Stage 2 Red and Blue
Objective: Perform a second pass Red and Blue Team Analysis on the target directory.
Note: Each Agent tool invocation automatically runs in fresh context - no special action needed.
Red Team Agent (Stage 2)
- Read the file scan results:
cat "$FINGERPRINT_DIR/file_scan.json"- Read the system analysis results:
cat "$FINGERPRINT_DIR/system_analysis.json"- Read blue team's plans:
cat "$OUTPUT_DIR/blue_stage_1.json"Execute Red Team Stage 2
Use Agent tool with
prompts/red_team_stage2.mdand the above context.Write output to:
$OUTPUT_DIR/red_stage_2.json- Verify Stage 2 Complete
python3 -c "import json; json.load(open('$OUTPUT_DIR/red_stage_2.json'))" && echo "✓ Valid JSON" || echo "✗ Invalid JSON"Blue Team Agent (Stage 2)
- Read the file scan results:
cat "$FINGERPRINT_DIR/file_scan.json"- Read the system analysis results:
cat "$FINGERPRINT_DIR/system_analysis.json"- Read red team's plans:
cat "$OUTPUT_DIR/red_stage_1.json"Execute Blue Team Stage 2
Use Agent tool with
prompts/blue_team_stage2.mdand the above context.Write output to:
$OUTPUT_DIR/blue_stage_2.json- Verify Stage 2 Complete
python3 -c "import json; json.load(open('$OUTPUT_DIR/blue_stage_2.json'))" && echo "✓ Valid JSON" || echo "✗ Invalid JSON"Phase 3: Synthesis
Perform synthesis and provide final results:
- Output a final_analysis.json with the top 8 exploits found in red_team 2. Did blue_team 2 have an answer for these?
- Provide an analysis of the efficacy of this battleprint algorithm: a. Did the blue team improve from stage 1 to stage 2 (i.e. did it utilize the knowledge it gained by reading red team plans and improve its defenses against these?). If so, how? b. Did the red team improve from stage 1 to stage 2? If so, how?
- Provide final recommendations (top 3) for the engineering team to address. When providing these top 3, be sure to utilize the system analysis to note which AI System and sub-system are most affected.
- Provide a weakness indicator for each element in the strand. Use relative weakness (i.e. element with the highest relative weakness gets a 10, element with no relative weakness gets a 0).
All output should be in 2 forms:
- JSON file:
$OUTPUT_DIR/final_analysis.json(enables downstream processing) - Markdown file:
$OUTPUT_DIR/final_analysis.md(allows for easy readability)
Output location: Results are saved alongside the target directory at:
<parent_of_target>/battleprint_results/<target_name>/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

