AgentSkillsCN

Context Post Verify

上下文后置校验

SKILL.md

Context Post-Verify Skill

Verifies model response by:

  • Checking if retrieved context was actually used
  • Validating against known invariants
  • Flagging potential hallucinations
  • Emitting machine verdict (pass/fail/warn)

Phase

post_verify - Runs after model response

Priority

10 (runs first in post-verify phase)

Mutations

None (read-only verification)

Verification Checks

  1. Context Usage: Checks if response mentions concepts from retrieved items
  2. Invariant Validation: Validates response doesn't violate known invariants
  3. Hallucination Detection: Flags responses that make unsupported claims

Verdict Values

  • pass - Response is valid and used context appropriately
  • warn - Response may have issues but is acceptable
  • fail - Response violates invariants or shows clear issues

Implementation

Located at: app/services/chat-gateway/context_engineering/skills/post_verify.py

The skill:

  1. Extracts key concepts from retrieved items
  2. Checks if response mentions these concepts
  3. Validates response against invariants
  4. Flags potential hallucinations (claims not supported by context)