Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Learning path

Evals and safety for LLM features

Learn LLM evals and safety: catch regressions and attacks before users do, with error analysis, code-based evals, calibrated judges and prompt-injection tests.

Intermediate9 h9 steps7-question quiz
Start with step 1
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark

What you will be able to do

  • Build a small eval set from real outputs and run it on every change
  • Write judge criteria and check the judge against human labels
  • Trace requests with tokens, latency and cost per user action
  • Explain direct and indirect prompt injection and the defences that help
  • Red-team a chatbot and record which attacks succeed
  • Add input and output guardrails and measure how often they block good requests

Steps

  1. Step 1: Start your evals by reading outputs, not by picking metrics

    The fastest way to useful LLM evals is to read real outputs and write down what is wrong. Why error analysis comes before metrics, and how to do it.

    Article

    Read first: evals start with reading outputs, not picking metrics.

  2. Step 2: Write your first LLM eval

    Turn real outputs into a small test set, add code-based checks in promptfoo and run them in CI to catch regressions on every change.

    Tutorial40 min

  3. Step 3: LLM-as-a-judge: grading outputs you can trust

    Write narrow grading criteria, check the judge's verdicts against your own labels and decide when its agreement is good enough.

    Tutorial45 min

  4. Step 4: Optimise a prompt automatically with DSPy

    Write a signature and a metric, run three optimisers on 30 labelled examples, score 20 held-out ones, and see when hand-tuning wins.

    Tutorial75 min

    Optional: once you have a metric you trust, let an optimiser tune the prompt and compare it with your hand-written one on held-out examples.

  5. Step 5: Add tracing and cost tracking to an LLM app

    One trace per user action, with tokens, latency and cost for each model call, so slow and costly features stand out.

    Workflow60 min

  6. Step 6: Prompt injection basics for builders

    How direct and indirect prompt injection work, why agents with tools raise the stakes, and the design choices that limit the damage when no complete fix exists.

    Tutorial30 min

  7. Step 7: Red-team your chatbot for prompt injection

    Generate attacks for its purpose, confirm each failure by hand, apply mitigations and re-run.

    Workflow120 min

  8. Step 8: Add input and output guardrails to an LLM app

    Length, topic and PII checks on input, schema and policy checks on output, then measure false positives and latency on a test set.

    Tutorial50 min

    Turn what the red-team run found into input and output checks, then measure how often they block good requests.

  9. Step 9: Evaluate RAG answers with a golden dataset

    Set up RAG evaluation with a golden dataset and promptfoo: score retrieval, correctness and grounding for every question, and fail CI when answer quality drops.

    Workflow120 min

    Optional if you do not run a retrieval system.

  10. Evals and safety quiz

    7 questions with explanations. Your score is saved when you are signed in.

    Final quiz

  • AI for test engineers

    An AI course for testers: apply generative AI to everyday test automation, from AI-assisted test design to generating, healing and reviewing Playwright tests.

    Beginner9 h10 steps
  • Building with the Claude API

    Learn to build with the Claude API from your own code: the Messages API, tool use, structured output and prompt caching, then evaluate and trace what you built.

    Intermediate5 h9 steps
  • LLMOps: observability, evals and cost

    Learn LLMOps in practice: trace every request, gate changes with evals in CI, calibrate judges and keep token spend visible and under control in production.

    Intermediate7 h10 steps