feat(verify): independent eval-evidence verify command (#10)#18
Merged
Conversation
`agenteval verify-evidence` independently confirms a federated run's eval evidence in AgentLens — it asks AgentLens to re-walk the session's hash chain (GET /api/audit/verify?sessionId=eval-<run-id>) and confirms it's intact AND non-empty. Because `eval_result` is excluded from AgentLens's client ingest enum, a verified eval session proves the evidence is server-authored: you can verify, you can't forge. - verify.py: verify_eval_evidence(server, api_key, session_id) + session_id_for_run. An absent session (verifies vacuously, sessionsVerified=0) is reported UNVERIFIED; transport/HTTP errors raise VerifyError. - commands/verify.py: `verify-evidence --run-id/--session-id --agentlens-server --agentlens-api-key [--format json|text]` (env-backed AGENTLENS_SERVER/API_KEY), exits non-zero on failure. Registered. Uses an existing AgentLens endpoint (audit:read/admin key) — no agentlens change. Tests: 7 (verified, vacuous-unverified, broken-chain, non-200, transport error, session-id helper, command registered). pytest 7/7, mypy + ruff clean (venv). Closes #10. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tXZpN29akdmG8AEjgSZwk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10.
What:
agenteval verify-evidenceindependently confirms a federated run's eval evidence in AgentLens — asks AgentLens to re-walk the session's hash chain (GET /api/audit/verify?sessionId=eval-<run-id>) and confirms it's intact AND non-empty. Becauseeval_resultis excluded from AgentLens's client ingest enum, a verified eval session proves the evidence is server-authored: you can verify, you can't forge.How:
verify.py—verify_eval_evidence(server, api_key, session_id)+session_id_for_run. An absent session (which verifies vacuously,sessionsVerified=0) is reported unverified; transport/HTTP errors raiseVerifyError.commands/verify.py—verify-evidence --run-id/--session-id --agentlens-server --agentlens-api-key [--format json|text](env-backedAGENTLENS_SERVER/AGENTLENS_API_KEY), exits non-zero on failure (CI-gate friendly).Tests: 7 (verified, vacuous→unverified, broken-chain, non-200→error, transport-error, session-id helper, command registered). pytest 7/7, mypy + ruff clean (venv).
Self-contained, additive; no behavior change to existing commands.