一键导入
security-field-validator
Validate security-critical DELEGATE fields and enforce routing rules. Prevents security work from being mis-routed to general engineers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate security-critical DELEGATE fields and enforce routing rules. Prevents security work from being mis-routed to general engineers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Experiment orchestration framework with traffic allocation, statistical analysis, and early stopping detection. Use to test routing changes, model upgrades, and role assignments with Welch's t-test significance testing.
DEPRECATED — This skill is no longer maintained. Prometheus and Grafana infrastructure was never implemented. Use local JSON metrics analysis instead.
Scaffolds new SPEC-compliant agentic-engineers agents with a single call. Generates SKILL.md frontmatter, test scaffolds (TDD RED-phase), __init__.py, scripts/ layout, and DELEGATE/HANDBACK protocol templates. Use when creating any new automation agent, task handler, or operational tool. Validates role, model, effort, naming, and dependency graphs (circular dep detection) before writing files. Supports dry-run mode for planning without side effects.
Routine maintenance for Codex sessions: monitor queue state, close completed sub-agents, resume or escalate active work, and keep agent capacity available.
Automated cross-validation of protocol queue integrity. Scans all DELEGATEs/HANDBACKs, validates schema compliance, detects cycles, checks rate limits, generates compliance report. Enables self-referential protocol improvements.
Consolidates provider-specific AI costs into unified metrics across Anthropic, OpenAI, Google Gemini, GitHub Copilot, and Ollama. Enables apples-to-apples cost comparison and savings analysis.
| name | security-field-validator |
| title | Security-Critical DELEGATE Field Validator |
| version | 1.0.0 |
| author | Principal Engineer |
| created | "2026-05-30T00:00:00.000Z" |
| updated | "2026-05-30T00:00:00.000Z" |
| description | Validate security-critical DELEGATE fields and enforce routing rules. Prevents security work from being mis-routed to general engineers. |
| role | principal-engineer |
| effort | high |
| priority | normal |
| purpose | Validate security-critical DELEGATE fields and enforce routing rules. Prevents security work from being mis-routed to general engineers. |
| scope | Validates three new fields added to the DELEGATE schema: - security_scope: enum [none|auth|crypto|pii|secrets|injection|supply_chain] - approval_gate: enum [none|lead_engineer|principal_engineer|security_engineer|cto] - audit_required: boolean Enforces validation rules: 1. If security_scope != none, approval_gate MUST be set (not "none") 2. If approval_gate is set, audit_required MUST be true 3. Security scopes route to Security Engineer minimum Provides routing logic to determine required role based on security_scope. |
| dependencies | [] |
Security-critical work often gets routed to the wrong agent because DELEGATE blocks lack security-specific metadata. This validator enforces a three-field scheme to ensure:
SecurityFieldValidator
├── validate() # Main entry point
├── _determine_required_role()
└── apply_defaults() # Fill in missing fields with defaults
| Rule | Condition | Consequence |
|---|---|---|
| R1 | security_scope != "none" ⟹ approval_gate != "none" | REJECT if violated |
| R2 | approval_gate != "none" ⟹ audit_required == true | REJECT if violated |
| R3 | security_scope ∈ {auth, crypto, pii, secrets, injection, supply_chain} | Route to Security Engineer |
from security_field_validator import SecurityFieldValidator
validator = SecurityFieldValidator()
# Validate a DELEGATE block
delegate = {
"security_scope": "auth",
"approval_gate": "principal_engineer",
"audit_required": True,
}
result = validator.validate(delegate)
if result["valid"]:
print(f"✅ VALID — route to {result['required_role']}")
else:
for error in result["errors"]:
print(f"❌ {error}")
delegate = {}
validator.apply_defaults(delegate)
# Now: security_scope="none", approval_gate="none", audit_required=false
from security_field_validator import validate_security_fields
result = validate_security_fields(delegate)
{
"valid": bool, # True if all checks pass
"errors": list, # Error messages (empty if valid)
"warnings": list, # Warning messages (can coexist with valid=true)
"security_scope": str, # Resolved value (with default if not set)
"approval_gate": str, # Resolved value (with default if not set)
"audit_required": bool, # Resolved value (with default if not set)
"required_role": str or None, # "security_engineer" if security-scoped, else None
}
Add these fields to optional_fields:
security_fields:
security_scope:
type: string
enum:
- none
- auth
- crypto
- pii
- secrets
- injection
- supply_chain
default: none
description: "Security classification for task (triggers routing to Security Engineer)"
example: "auth"
approval_gate:
type: string
enum:
- none
- lead_engineer
- principal_engineer
- security_engineer
- cto
default: none
description: "Required approval authority before task execution"
example: "principal_engineer"
audit_required:
type: boolean
default: false
description: "Whether task execution must be audited (required if approval_gate set)"
example: true
After validation, the orchestrator should:
result = validator.validate(delegate)
if not result["valid"]:
# Reject DELEGATE with validation errors
return reject_delegate(delegate, result["errors"])
if result["required_role"] == "security_engineer":
# Force role to security_engineer if not already set
delegate["role"] = "security_engineer"
if result["approval_gate"] != "none":
# Apply approval gate checks before execution
apply_approval_gate(delegate, result["approval_gate"])
All test cases verify acceptance criteria from FIX #4:
Run tests:
cd src/skills/_meta/security-field-validator
python3 -m pytest tests/test_security_field_validator.py -v
Expected: 16 passed
src/skills/roles/security-engineer.md — Security Engineer role definitionsrc/skills/roles/principal-engineer.md — Principal Engineer role definitionsrc/orchestration/delegate-schema.yaml — Master DELEGATE schema