一键导入
agent-definition-verifier
Tri-level verification of AGENTS.md against SPEC.md. Blocks model downgrade attacks and unauthorized agent definitions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Tri-level verification of AGENTS.md against SPEC.md. Blocks model downgrade attacks and unauthorized agent definitions.
用 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 | agent-definition-verifier |
| description | Tri-level verification of AGENTS.md against SPEC.md. Blocks model downgrade attacks and unauthorized agent definitions. |
| role | security-engineer |
| model | claude-opus-4.7 |
| effort | high |
| priority | normal |
| version | 1 |
Skill: Tri-level verification of AGENTS.md against SPEC.md
Purpose: Block model downgrade attacks (e.g., Security Engineer Opus-4.7 → Sonnet-4.6)
Protocol: DELEGATE/HANDBACK with model_verification_sha field
Implements FIX #3: Agent Definition Verification (Tri-Level)
Problem: No mechanism verifies AGENTS.md matches SPEC.md definitions. Security work silently underfunded if a role's model is downgraded.
Attack Scenario:
claude-opus-4.7claude-sonnet-4.6Solution: Tri-level verification
model_verification_sha in all DELEGATE/HANDBACK files before pushmodel_verification_sha to delegate-schema.yamlsrc/skills/_meta/agent-definition-verifier/
├── SKILL.md # This file
├── scripts/
│ └── agent_definition_verifier.py # SHA generation & validation
└── tests/
└── test_agent_definition_verifier.py # 17 test cases (TDD)
src/orchestration/
├── agent-verification.py # SHA generation wrapper
└── delegate-schema.yaml # Updated with model_verification_sha field
.githooks/
└── pre-push # Updated with agent verification checks
.agents_verification_sha # Current SHA256 of AGENTS.md
Generate SHA256 hash of AGENTS.md file.
from agent_definition_verifier import generate_agents_sha256
sha = generate_agents_sha256("src/AGENTS.md")
# Returns: "a1b2c3d4e5f6..." (64-char hex string)
Returns: 64-character hex string (SHA256 hash)
Raises: FileNotFoundError if file does not exist
Verify DELEGATE has matching model_verification_sha.
from agent_definition_verifier import verify_sha_matches
delegate = {
"task_id": "TASK-2026-05-30-fix-3",
"role": "security-engineer",
"model": "claude-opus-4.7",
"model_verification_sha": "a1b2c3d4..." # Must match current AGENTS.md
}
if verify_sha_matches(delegate, current_sha):
print("✅ DELEGATE accepted")
else:
print("❌ DELEGATE rejected — SHA mismatch")
Validate role→model pair exists in current AGENTS.md.
from agent_definition_verifier import validate_agent_in_roster
# Valid: Security Engineer with Opus-4.7
assert validate_agent_in_roster("security-engineer", "claude-opus-4.7", "src/AGENTS.md")
# Invalid: Security Engineer with Sonnet-4.6 (downgrade attempt)
assert not validate_agent_in_roster("security-engineer", "claude-sonnet-4.6", "src/AGENTS.md")
Parse AGENTS.md roster and extract role→model mapping.
from agent_definition_verifier import load_agents_manifest
roster = load_agents_manifest("src/AGENTS.md")
# Returns:
# {
# "orchestrator": "claude-haiku-4.5",
# "engineer": "claude-haiku-4.5",
# "security_engineer": "claude-opus-4.7",
# "principal_engineer": "claude-opus-4-6",
# ...
# }
All tests (17 total) pass. Coverage includes:
Run tests:
cd src/skills/_meta/agent-definition-verifier
python3 -m pytest tests/test_agent_definition_verifier.py -v
Expected output: 17 passed in ~0.06s
Added checks:
# Verify all DELEGATE/HANDBACK files have model_verification_sha
python3 src/orchestration/agent-verification.py \
validate-queue \
src/AGENTS.md \
~/.copilot/queue/incoming \
~/.copilot/queue/done
Added field:
model_verification_sha:
type: string
required: true
pattern: "^[0-9a-f]{64}$"
description: "SHA256 of AGENTS.md at time of task creation (prevents model downgrades)"
Before invoking agent:
# Verify model exists in current AGENTS.md
if not validate_agent_in_roster(role, model, "src/AGENTS.md"):
raise SecurityException(f"Model {model} not valid for role {role}")
Q: Why SHA256 specifically?
A: Standard cryptographic hash; 64-char hex representation; collision-resistant; widely supported.
Q: What if AGENTS.md changes legitimately?
A: Update .agents_verification_sha and regenerate all in-flight DELEGATEs with new SHA.
Q: Can an attacker forge the SHA?
A: No — SHA256 is cryptographically secure. Attacker would need to modify AGENTS.md and forge the hash, which is infeasible.
Q: What if .agents_verification_sha is missing?
A: Pre-push hook rejects all DELEGATEs. Developer must regenerate via agent-verification.py.