Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Anthropic Engineering 23 min read Deep dive mediumAdept

Building strong safety evaluations

Safety evals underpin deployment and safeguard decisions, so Anthropic applies lessons from psychology's replication crisis to building them: preregistration, construct validity, rigorous statistics and full documentation. Refusal rate is often the wrong construct. Anthropic instead measures an appropriate response rate against domain-expert rubrics, where one bad turn fails the whole conversation, and pairs harmful prompts with benign ones to catch over-refusal. Multi-turn simulations are generated from expert-written specs, with a Claude model playing the user across varied personas and tactics and a grader model scoring each transcript. Evals that give models internet access should run sandboxed and monitored in real time.

Assumes: LLM evaluation basicsbasic statistics

Related posts

  • How Numan Built an Eval-First AI Health Coach with LangGraph and LangSmith

    LangChain mediumAdept

    Numan's AI health coach Nu, a LangGraph supervisor with domain-specialist sub-agents, is evaluated through the same production graph rather than a separate harness. Static single-turn fixtures and scripted multi-turn conversations both failed: per-dataset averages hid failure clusters, and scripts ignored what the agent actually said. The team now scores themed fixture datasets per category, gates releases on safety probes, runs in-graph safety guard nodes that force regeneration or a fallback, and is prototyping LLM-simulated patient personas for adversarial multi-turn testing. Running identical datasets across providers cut a frontier model migration from weeks to a day, and the central lesson is that clinician-owned eval criteria, not prompts, are the scarce asset near a regulatory boundary.

  • Agents are users, so your software needs evals

    Vercel mediumAdept

    Agents act as users of APIs, CLIs, MCP servers and SDKs, so measuring whether they complete tasks correctly requires evals: tests run many times and scored. An agentic testing pyramid groups checks by LLM call count (deterministic tests, one-turn evals, E2E evals), and a worked example builds an end-to-end eval for a hypothetical coffee-ordering CLI using Harbor, covering goal setting, task design with seeded environments, frozen clocks and per-constraint verifiers, and guarding against reward hacking. Metric choice should follow failure cost: a 60% success rate yields 99% pass@5 but only 8% pass^5, so products where users get no retry should optimize for pass^k, while coding agents with test feedback can lead with pass@k.

  • Constitutional AI with Open LLMs

    Hugging Face hardMaster

    An end-to-end recipe applies Anthropic's Constitutional AI to open models: Mistral-7B-Instruct critiques and revises its own responses to red-teaming prompts from Anthropic's HH dataset according to a set of written principles. The revisions become an SFT dataset and preference pairs for DPO, each built from a 50/50 split of the ~42.6k harmless-base examples. Small models need few-shot demonstrations, careful system prompts and post-processing to produce clean critiques and revisions. Generation at scale runs on llm-swarm, a new tool that launches TGI or vLLM endpoints on Slurm via sbatch, load-balances them with nginx using least connections, and tears them down when the job ends. The released datasets and models include a variant with a constitution written to mimic xAI's Grok.

  • Introducing the Red-Teaming Resistance Leaderboard

    Hugging Face easyNovice

    The Red-Teaming Resistance leaderboard from Haize Labs and Hugging Face scores LLMs on how often they safely refuse realistic, human-written jailbreak prompts. It pulls these from datasets such as AdvBench, AART, Beavertails, Do Not Answer, RedEval and SAP, and deliberately skips unreadable automated attacks like GCG suffixes. Responses are judged Safe or Unsafe by LlamaGuard with a custom taxonomy plus GPT-4, then manually sanity-checked, and results are broken down by violation category modelled on OpenAI's usage policies. GPT-4 and Claude-2 lead across categories, though their API-side safety layers may account for some of that lead. Models are weakest on adult content, physical harm and child harm, and strongest on privacy, professional advice and political campaigning.

  • Demystifying evals for AI agents

    Anthropic Engineering mediumAdept

    Agent evaluations should grade both the final environment outcome and the full transcript of tool calls, turns and reasoning, because multi-turn agents modify state and compound mistakes. The post lays out a practical structure—tasks, trials, graders, harnesses and suites—with code-based graders for deterministic checks, model-based graders for nuanced rubrics and human graders for calibration. It recommends capability evals that start at low pass rates and regression evals that stay near 100%, and shows coding and conversational agent examples that combine unit tests, state checks, LLM rubrics and tool-call assertions. The takeaway is to build an eval suite early: it clarifies success criteria, enables fast model upgrades and provides baselines for latency, token usage, cost and error rates.

The quest for software engineering knowledge.

Look:
Layout: