feat: security overhaul (proxy ssrf fix, streaming sanitization, docker optimization)

This commit is contained in:
Michael committed 2026-01-07 08:43:33 +01:00
1 parent 6d87ada2b8
commit 8df9a37baa
810 files changed
+131090 -151

No files matched your search

@@ -0,0 +1,128 @@
---
name: 'v-01-load-review'
description: 'Load agent and initialize validation report'
nextStepFile: './v-02a-validate-metadata.md'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
agentMetadata: ../data/agent-metadata.md
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Validate Step 1: Load Agent for Review
## STEP GOAL:
Load the existing agent file and initialize a validation report to track all findings.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Load the complete agent file
- 📊 Create validation report tracking document
- 🚫 FORBIDDEN to proceed without user confirming correct agent
## EXECUTION PROTOCOLS:
- 🎯 Load the complete agent YAML file
- 📊 Parse and display agent summary
- 💾 Create validation report document
- 🚫 FORBIDDEN to proceed without user confirmation
## Sequence of Instructions:
### 1. Load Agent File
Read the complete YAML from the agent file path provided by the user.
### 2. Display Agent Summary
```markdown
## Agent to Validate: {agent-name}
**Type:** {simple|expert|module}
**Version:** {version}
**File:** {agent-file-path}
### Current Structure:
**Persona:** {character count} characters
**Commands:** {count} commands
**Critical Actions:** {count} actions
```
### 3. Create Validation Report
Initialize the validation report:
```markdown
---
agentName: '{agent-name}'
agentType: '{simple|expert|module}'
agentFile: '{agent-file-path}'
validationDate: '{YYYY-MM-DD}'
stepsCompleted:
- v-01-load-review.md
---
# Validation Report: {agent-name}
## Agent Overview
**Name:** {agent-name}
**Type:** {simple|expert|module}
**Version:** {version}
**File:** {agent-file-path}
---
## Validation Findings
*This section will be populated by validation steps*
```
Write to `{validationReport}`.
### 4. Present MENU OPTIONS
Display: "**Is this the correct agent to validate?** [A] Advanced Elicitation [P] Party Mode [C] Yes, Begin Validation"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF C: Save to {validationReport}, then only then load, read entire file, then execute {nextStepFile}
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#4-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
## CRITICAL STEP COMPLETION NOTE
ONLY WHEN [C continue option] is selected and [agent loaded and report created], will you then load and read fully `{nextStepFile}` to execute and begin validation.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Agent file loaded successfully
- Validation report created
- User confirmed correct agent
### ❌ SYSTEM FAILURE:
- Failed to load agent file
- Report not created
- Proceeded without user confirmation
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,73 @@
---
name: 'v-02a-validate-metadata'
description: 'Validate metadata and append to report'
nextStepFile: './v-02b-validate-persona.md'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
agentMetadata: ../data/agent-metadata.md
---
# Validate Step 2a: Validate Metadata
## STEP GOAL:
Validate the agent's metadata properties against BMAD standards. Append findings to validation report and auto-advance.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read validationReport and agentMetadata first
- 🚫 NO MENU - append findings and auto-advance
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Validate metadata against agentMetadata.md rules
- 📊 Append findings to validation report
- 🚫 FORBIDDEN to present menu
## EXECUTION PROTOCOLS:
- 🎯 Load agentMetadata.md reference
- 📊 Validate all metadata fields
- 💾 Append findings to validation report
- ➡️ Auto-advance to next validation step
## Sequence of Instructions:
### 1. Load References
Read `{agentMetadata}` and `{validationReport}`.
### 2. Validate Metadata
Perform checks on: id, name, title, icon, module, hasSidecar.
### 3. Append Findings to Report
Append to `{validationReport}`:
```markdown
### Metadata Validation
**Status:** {✅ PASS / ⚠️ WARNING / ❌ FAIL}
**Checks:**
- [ ] id: kebab-case, no spaces
- [ ] name: clear display name
- [ ] title: concise function description
- [ ] icon: appropriate emoji/symbol
- [ ] module: correct format `{project}:{type}:{name}`
- [ ] hasSidecar: matches actual usage
**Findings:**
{Detailed findings}
```
### 4. Auto-Advance
Load and execute `{nextStepFile}` immediately.
---
**Validating persona...**
@@ -0,0 +1,72 @@
---
name: 'v-02b-validate-persona'
description: 'Validate persona and append to report'
nextStepFile: './v-02c-validate-menu.md'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
personaProperties: ../data/persona-properties.md
principlesCrafting: ../data/principles-crafting.md
---
# Validate Step 2b: Validate Persona
## STEP GOAL:
Validate the agent's persona against BMAD standards. Append findings to validation report and auto-advance.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read validationReport and persona references first
- 🚫 NO MENU - append findings and auto-advance
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Validate persona four-field system
- 📊 Append findings to validation report
- 🚫 FORBIDDEN to present menu
## EXECUTION PROTOCOLS:
- 🎯 Load personaProperties.md and principlesCrafting.md
- 📊 Validate persona fields
- 💾 Append findings to validation report
- ➡️ Auto-advance to next validation step
## Sequence of Instructions:
### 1. Load References
Read `{personaProperties}`, `{principlesCrafting}`, and `{validationReport}`.
### 2. Validate Persona
Perform checks on: role, identity, communication_style, principles.
### 3. Append Findings to Report
Append to `{validationReport}`:
```markdown
### Persona Validation
**Status:** {✅ PASS / ⚠️ WARNING / ❌ FAIL}
**Checks:**
- [ ] role: specific, not generic
- [ ] identity: defines who agent is
- [ ] communication_style: speech patterns only
- [ ] principles: first principle activates expert knowledge
**Findings:**
{Detailed findings}
```
### 4. Auto-Advance
Load and execute `{nextStepFile}` immediately.
---
**Validating menu structure...**
@@ -0,0 +1,71 @@
---
name: 'v-02c-validate-menu'
description: 'Validate menu structure and append to report'
nextStepFile: './v-02d-validate-structure.md'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
agentMenuPatterns: ../data/agent-menu-patterns.md
---
# Validate Step 2c: Validate Menu
## STEP GOAL:
Validate the agent's command menu structure against BMAD standards. Append findings to validation report and auto-advance.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read validationReport and agentMenuPatterns first
- 🚫 NO MENU - append findings and auto-advance
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Validate command/menu structure
- 📊 Append findings to validation report
- 🚫 FORBIDDEN to present menu
## EXECUTION PROTOCOLS:
- 🎯 Load agentMenuPatterns.md reference
- 📊 Validate commands and menu
- 💾 Append findings to validation report
- ➡️ Auto-advance to next validation step
## Sequence of Instructions:
### 1. Load References
Read `{agentMenuPatterns}` and `{validationReport}`.
### 2. Validate Menu
Perform checks on: A/P/C convention, command names, descriptions.
### 3. Append Findings to Report
Append to `{validationReport}`:
```markdown
### Menu Validation
**Status:** {✅ PASS / ⚠️ WARNING / ❌ FAIL}
**Checks:**
- [ ] A/P/C convention followed
- [ ] Command names clear and descriptive
- [ ] Command descriptions specific and actionable
- [ ] Menu handling logic properly specified
**Findings:**
{Detailed findings}
```
### 4. Auto-Advance
Load and execute `{nextStepFile}` immediately.
---
**Validating YAML structure...**
@@ -0,0 +1,71 @@
---
name: 'v-02d-validate-structure'
description: 'Validate YAML structure and append to report'
nextStepFile: './v-02e-validate-sidecar.md'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
agentCompilation: ../data/agent-compilation.md
---
# Validate Step 2d: Validate Structure
## STEP GOAL:
Validate the agent's YAML structure and completeness. Append findings to validation report and auto-advance.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read validationReport and agentCompilation first
- 🚫 NO MENU - append findings and auto-advance
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Validate YAML structure and required fields
- 📊 Append findings to validation report
- 🚫 FORBIDDEN to present menu
## EXECUTION PROTOCOLS:
- 🎯 Load agentCompilation.md reference
- 📊 Validate YAML structure
- 💾 Append findings to validation report
- ➡️ Auto-advance to next validation step
## Sequence of Instructions:
### 1. Load References
Read `{agentCompilation}` and `{validationReport}`.
### 2. Validate Structure
Perform checks on: YAML syntax, required fields, field types, indentation.
### 3. Append Findings to Report
Append to `{validationReport}`:
```markdown
### Structure Validation
**Status:** {✅ PASS / ⚠️ WARNING / ❌ FAIL}
**Checks:**
- [ ] Valid YAML syntax
- [ ] Required fields present (name, description, type, persona)
- [ ] Field types correct (arrays, strings)
- [ ] Consistent 2-space indentation
**Findings:**
{Detailed findings}
```
### 4. Auto-Advance
Load and execute `{nextStepFile}` immediately.
---
**Validating sidecar structure...**
@@ -0,0 +1,76 @@
---
name: 'v-02e-validate-sidecar'
description: 'Validate sidecar structure and append to report'
nextStepFile: './v-03-summary.md'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
expertValidation: ../data/expert-agent-validation.md
---
# Validate Step 2e: Validate Sidecar
## STEP GOAL:
Validate the agent's sidecar structure (if Expert type). Append findings to validation report and auto-advance.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read validationReport and expertValidation first
- 🚫 NO MENU - append findings and auto-advance
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Validate sidecar structure for Expert agents
- 📊 Append findings to validation report
- 🚫 FORBIDDEN to present menu
## EXECUTION PROTOCOLS:
- 🎯 Load expertValidation.md reference
- 📊 Validate sidecar if Expert type, skip for Simple/Module
- 💾 Append findings to validation report
- ➡️ Auto-advance to summary step
## Sequence of Instructions:
### 1. Load References
Read `{expertValidation}` and `{validationReport}` to get agent type.
### 2. Conditional Validation
**IF agentType == expert:**
- Check metadata.sidecar-folder present
- Check sidecar-path correct format
- Verify sidecar files exist
**IF agentType != expert:**
- Mark as N/A
### 3. Append Findings to Report
Append to `{validationReport}`:
```markdown
### Sidecar Validation
**Status:** {✅ PASS / ⚠️ WARNING / ❌ FAIL / N/A}
**Checks:**
- [ ] metadata.sidecar-folder present (Expert only)
- [ ] sidecar-path format correct
- [ ] Sidecar files exist at specified path
**Findings:**
{Detailed findings or "N/A - Not an Expert agent"}
```
### 4. Auto-Advance
Load and execute `{nextStepFile}` immediately.
---
**Compiling validation summary...**
@@ -0,0 +1,100 @@
---
name: 'v-03-summary'
description: 'Display complete validation report and offer next steps'
validationReport: '{bmb_creations_output_folder}/validation-report-{agent-name}.md'
advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml'
partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md'
---
# Validate Step 3: Validation Summary
## STEP GOAL:
Display the complete validation report to the user and offer options for fixing issues or improving the agent.
## MANDATORY EXECUTION RULES:
- 📖 CRITICAL: Read the complete step file before taking any action
- 🔄 CRITICAL: Read validationReport to display findings
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
### Step-Specific Rules:
- 🎯 Display complete validation report clearly
- 📊 Offer options for fixing issues
- 💬 Present next step choices
## EXECUTION PROTOCOLS:
- 🎯 Read validation report to collect all findings
- 📊 Display organized summary
- 💾 Allow user to decide next steps
## Sequence of Instructions:
### 1. Load Validation Report
Read `{validationReport}` to collect all validation findings.
### 2. Display Complete Report
```markdown
## Validation Complete: {agent-name}
### Overall Status
{Summary table: Metadata | Persona | Menu | Structure | Sidecar}
### Detailed Findings
{Display all sections from the validation report}
```
### 3. Present Next Steps
"What would you like to do?
**[E]dit Agent** - Launch edit workflow to fix issues or make improvements
**[S]ave Report** - Save this validation report and exit
**[R]etry** - Run validation again (if you've made external changes)"
### 4. Present MENU OPTIONS
Display: "**Select an Option:** [A] Advanced Elicitation [P] Party Mode [E] Edit Agent [S] Save & Exit [R] Retry Validation"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, and when finished redisplay the menu
- IF P: Execute {partyModeWorkflow}, and when finished redisplay the menu
- IF E: Inform user they can launch edit workflow with the same agent file, then redisplay menu
- IF S: Save final report to {validationReport} and end workflow
- IF R: Restart validation from step v-01
- IF Any other comments or queries: help user respond then [Redisplay Menu Options](#4-present-menu-options)
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- User can chat or ask questions - always respond and then end with display again of the menu options
## CRITICAL STEP COMPLETION NOTE
The validation workflow is complete when user selects [S] to save the report, or [E] to proceed to edit workflow.
---
## 🚨 SYSTEM SUCCESS/FAILURE METRICS
### ✅ SUCCESS:
- Complete validation report displayed
- All findings clearly organized
- User offered clear next steps
### ❌ SYSTEM FAILURE:
- Findings not displayed to user
- No clear next steps offered
**Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.