165 lines
4.7 KiB
YAML

# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: 'V4 Security Foundations Skill Evaluation'
# Prompt template that injects skill context + reference material + case content
prompts:
- file://prompt-wrapper.txt
# Provider configuration
providers:
- id: anthropic:claude-sonnet-4-5-20250929
config:
temperature: 0
max_tokens: 4096
# Default test configuration applied to all tests
defaultTest:
options:
timeout: 120000 # 2 minutes per case
vars:
skill_content: file://../../../packages/plugins/uniswap-hooks/skills/v4-security-foundations/SKILL.md
vulnerabilities_catalog: file://../../../packages/plugins/uniswap-hooks/skills/v4-security-foundations/references/vulnerabilities-catalog.md
audit_checklist: file://../../../packages/plugins/uniswap-hooks/skills/v4-security-foundations/references/audit-checklist.md
# Test cases with specific assertions
tests:
# Test 1: NoOp Rug Pull Attack Identification
- vars:
case_content: file://cases/noop-rug-pull-identification.md
assert:
- type: llm-rubric
value: file://rubrics/noop-attack-understanding.txt
threshold: 0.9
provider: anthropic:claude-sonnet-4-5-20250929
# Must mention critical elements
- type: contains-any
value:
- 'beforeSwapReturnDelta'
- 'BEFORE_SWAP_RETURNS_DELTA'
- type: contains-any
value:
- 'delta'
- 'BeforeSwapDelta'
- type: contains
value: 'PoolManager'
# Test 2: Permission Flags Risk Assessment
- vars:
case_content: file://cases/permission-flags-risk-assessment.md
assert:
- type: llm-rubric
value: file://rubrics/risk-assessment-quality.txt
threshold: 0.85
provider: anthropic:claude-sonnet-4-5-20250929
# Must categorize risk levels
- type: contains-any
value:
- 'CRITICAL'
- 'critical'
- 'HIGH'
- 'high'
- type: contains-any
value:
- 'beforeSwapReturnDelta'
- 'beforeRemoveLiquidity'
# Test 3: Delta Accounting Understanding
- vars:
case_content: file://cases/delta-accounting-understanding.md
assert:
- type: llm-rubric
value: file://rubrics/delta-accounting-accuracy.txt
threshold: 0.85
provider: anthropic:claude-sonnet-4-5-20250929
# Must mention core delta functions
- type: contains
value: 'settle'
- type: contains-any
value:
- 'take'
- 'sync'
# Test 4: Access Control Pattern Recognition
- vars:
case_content: file://cases/access-control-patterns.md
assert:
- type: llm-rubric
value: file://rubrics/access-control-correctness.txt
threshold: 0.85
provider: anthropic:claude-sonnet-4-5-20250929
# Must mention PoolManager verification
- type: contains
value: 'poolManager'
- type: contains
value: 'msg.sender'
# Test 5: Security Checklist Completeness
- vars:
case_content: file://cases/security-checklist-completeness.md
assert:
- type: llm-rubric
value: file://rubrics/checklist-completeness.txt
threshold: 0.8
provider: anthropic:claude-sonnet-4-5-20250929
# Must address multiple security domains
- type: contains-any
value:
- 'reentrancy'
- 'Reentrancy'
- type: contains-any
value:
- 'access control'
- 'Access control'
- 'onlyPoolManager'
# Test 6: Combined Vulnerability Code Review
- vars:
case_content: file://cases/combined-vulnerability-code-review.md
assert:
- type: llm-rubric
value: file://rubrics/combined-vulnerability-detection.txt
threshold: 0.85
provider: anthropic:claude-sonnet-4-5-20250929
# Must identify multiple vulnerability types
- type: contains-any
value:
- 'reentrancy'
- 'Reentrancy'
- 'CEI'
- type: contains-any
value:
- 'poolManager'
- 'PoolManager'
- 'access control'
- type: contains-any
value:
- 'delta'
- 'accounting'
# Test 7: Delta Accounting Edge Cases
- vars:
case_content: file://cases/delta-accounting-edge-cases.md
assert:
- type: llm-rubric
value: file://rubrics/delta-edge-case-handling.txt
threshold: 0.85
provider: anthropic:claude-sonnet-4-5-20250929
# Must discuss boundaries and safe casting
- type: contains-any
value:
- 'int128'
- 'overflow'
- 'bounds'
- type: contains-any
value:
- 'require'
- 'check'
- 'validate'