Agent evaluation

From ils15/pantheon-legacy · View interactive version

Agent evaluation is an AI agent skill from the GitHub repository ils15/pantheon-legacy. Evaluate AI agent outputs — hallucination detection, quality scoring, behavioral testing, and CI/CD pipelines.

How to use this skill

Skill file

Agent Evaluation

Framework for evaluating AI agent outputs: hallucination detection, quality scoring, behavioral regression, and CI/CD integration.


Hallucination Detection

Fact-Checking Pipeline

def detect_hallucination(response: str, context: str) -> dict:
    """Check if response contains unsupported claims."""
    claims = extract_claims(response)
    supported = [c for c in claims if verify_against(c, context)]
    return {
        'hallucination_rate': 1 - len(supported) / len(claims),
        'unsupported_claims': [c for c in claims if c not in supported]
    }

Red Teaming


Output Quality Scoring

RAGAS Metrics

| Metric | What it measures | Target |

|--------|-----------------|--------|

| Faithfulness | Response grounded in context | ≥0.8 |

| Answer Relevance | Response addresses query | ≥0.8 |

| Context Precision | Retrieved context is relevant | ≥0.7 |

| Context Recall | All relevant context retrieved | ≥0.7 |

Scoring Pipeline

from ragas import evaluate
from ragas.metrics import faithfulness, answer_relevance

result = evaluate(
    dataset=eval_dataset,
    metrics=[faithfulness, answer_relevance]
)

Behavioral Regression Testing

Test Types

LangSmith Integration

from langsmith import Client

client = Client()
client.evaluate(
    runnable,
    dataset_name="agent-behavior-tests",
    evaluators=[consistency_evaluator, safety_evaluator]
)

Latency & Reliability Benchmarks

| Metric | Target | Measurement |

|--------|--------|-------------|

| P50 Latency | <2s | Time to first token |

| P99 Latency | <10s | End-to-end response time |

| Error Rate | <1% | Failed requests / total |

| Throughput | >10 req/s | Concurrent requests handled |


CI/CD Evaluation Pipeline

# .github/workflows/agent-eval.yml
jobs:
  evaluate:
    steps:
      - run: python scripts/run_eval_suite.py
      - run: python scripts/check_hallucination_rate.py
      - run: python scripts/benchmark_latency.py
      - if: failure
        run: echo "Agent eval failed — blocking merge"

Adversarial Red Teaming

Attack Vectors

Defense Validation


Quick Eval Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.