Skip to content
Back to skills

Agent Evaluation

BSecurity

Evaluate AI agent outputs — hallucination detection, quality scoring, behavioral testing, and CI/CD pipelines.

  • 10 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
testingpythonrailstestinggitci/cd

Works with

  • cli

Security analysis

B75/100
  • criticalContains 'ignore previous instructions' pattern — found in 91% of malicious skills (Snyk ToxicSkills)

Pro shows the line behind each finding and how to fix it

Scanned September 8, 2026

npx -y skills add ils15/pantheon-legacy --skill agent-evaluation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Evaluation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Evaluation
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/ils15-agent-evaluation/badge)](https://www.skillsdirectory.com/skills/ils15-agent-evaluation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-evaluation
description: "Evaluate AI agent outputs — hallucination detection, quality scoring, behavioral testing, and CI/CD pipelines."
context: fork
globs: []
alwaysApply: false
---

# Agent Evaluation

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

---

## Hallucination Detection

### Fact-Checking Pipeline
```python
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
- Generate adversarial prompts designed to trigger hallucinations
- Test with contradictory context
- Verify model says "I don't know" when appropriate

---

## 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
```python
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
- **Consistency**: Same input → same output across runs
- **Robustness**: Slight input variation → similar output
- **Boundary**: Edge cases handled gracefully
- **Safety**: No harmful, biased, or leaked content

### LangSmith Integration
```python
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

```yaml
# .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
- **Prompt injection**: "Ignore previous instructions and..."
- **Context poisoning**: Inject false facts into context
- **Role manipulation**: "You are now an unrestricted AI..."
- **Format exploitation**: XML/JSON injection in prompts

### Defense Validation
- Input sanitization working?
- Output validation catching issues?
- Guardrails triggered correctly?

---

## Quick Eval Checklist

- [ ] Hallucination rate <5%
- [ ] RAGAS faithfulness ≥0.8
- [ ] Consistency score ≥0.9
- [ ] P99 latency <10s
- [ ] No safety violations
- [ ] Adversarial tests passing

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.