Constitutional AI with Open LLMs
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.
Related posts
- Red-Teaming Large Language Models
Hugging Face easyNoviceRed-teaming evaluates LLMs by crafting natural-language prompts that elicit harmful outputs such as toxicity, bias, misinformation or leaked personal data, and it differs from adversarial attacks, which can use unintelligible inputs. Techniques include roleplay attacks, asking for responses in code, and using one LM to red-team another. Canned-response classifiers make a model safe but evasive, which shows the tension between helpfulness and harmlessness. Findings from Anthropic's work are summarized: RLHF models get harder to red-team as they scale, humans agree poorly on what counts as a successful attack, and crowdsourced prompts become templated. The post lists open datasets (Bot Adversarial Dialog, Anthropic red-team attempts, RealToxicityPrompts) and future directions such as code-generation jailbreaks and critical threat scenarios.
- Run, Test, and Evaluate Models and MCP Locally with Docker + Promptfoo
Docker mediumAdeptPromptfoo, Docker Model Runner and Docker MCP Toolkit can be combined to evaluate LLM apps entirely on a dev machine. Three worked configs are shown. The first compares local Gemma3 against Claude Opus 4.1 using llm-rubric and similarity assertions, graded by local smollm3 and mxbai embeddings instead of OpenAI. The second tests MCP tools directly (GitHub, Fetch, Playwright, YouTube transcript) through the MCP gateway. The third red-teams a GitHub-summarizer agent with MCP, PII, BOLA and BFLA plugins plus jailbreak and prompt-injection strategies, which exposed a tool-discovery vulnerability that was fixed with a prompt guideline.
- Building strong safety evaluations
Anthropic Engineering mediumAdeptSafety 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.
- Introducing the Red-Teaming Resistance Leaderboard
Hugging Face easyNoviceThe 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.
- CWE-bench v2: More coverage, quality, and transparency
Hugging Face mediumAdeptCWE-bench v2 releases a public set of 100 agentic security tasks covering 91 CWEs, where an agent must find and fix a vulnerability in a real open-source repository without breaking existing functionality, scored by deterministic programmatic verifiers that reject memorized upstream patches. Of 11 models, Gemini 4 Argon leads at 67.8% pass@1 and 81.0% pass@4, narrowly ahead of Claude Opus 5.5, while DeepSeek V4.1 Flash reaches 57.0% at $0.04 per rollout on the cost Pareto frontier. 95 tasks are solved by at least one model, but the leader still fails 19% on every attempt. Tasks are packaged as Dockerized Harbor environments runnable directly from the Hugging Face Hub and usable as RL rewards for training defensive agents.