constitutional-ai

constitutional-ai is a skill for Claude Code from liortesta/ClawdAgent. It costs 58 tokens per session (1,993 once invoked), scanned A, a copy of constitutional-ai, Apache-2.0.

Guidance for Constitutional AI, a method for training language models to produce safer responses through written principles, self-critique, revision, and feedback from another AI system.

In plain words
What is it for?
Use it to design the two training phases: supervised self-critique and revision, followed by reinforcement learning from AI feedback (RLAIF).
Why use it?
It offers a way to reduce harmful outputs without requiring people to label every harmful example by hand.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to design the two training phases: supervised self-critique and revision, followed by reinforcement learning from AI feedback (RLAIF).

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/liortesta/clawdagent/constitutional-ai
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add liortesta/ClawdAgent --skill constitutional-ai
Clone the repo
git clone --depth 1 https://github.com/liortesta/ClawdAgent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for constitutional-ai

README.md
[![agentmods](https://agentmods.dev/badge/skills/liortesta/clawdagent/constitutional-ai/github.svg)](https://agentmods.dev/skills/liortesta/clawdagent/constitutional-ai)
Your own site
<a href="https://agentmods.dev/skills/liortesta/clawdagent/constitutional-ai"><img src="https://agentmods.dev/badge/skills/liortesta/clawdagent/constitutional-ai/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for constitutional-ai

Your own site · 80×15
<a href="https://agentmods.dev/skills/liortesta/clawdagent/constitutional-ai"><img src="https://agentmods.dev/badge/skills/liortesta/clawdagent/constitutional-ai.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,993 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01993
Opus 5 $0.00029 $0.00996
Sonnet 5 $0.00012 $0.00399
Haiku 4.5 $0.00006 $0.00199

Measured 5d ago against content hash 186267074ebd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

constitutional-ai scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to constitutional-ai — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/07-safety-alignment/constitutional-ai/SKILL.md · 291 lines

How it starts

The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Constitutional AI - Harmlessness from AI Feedback

Quick start

Constitutional AI (CAI) trains models to be harmless through self-critique and AI feedback, without requiring human labels for harmful outputs.

Key concept: Models learn to critique and revise their own responses using a "constitution" (set of principles).

Two phases:

  1. Supervised Learning (SL): Self-critique + revision
  2. Reinforcement Learning (RL): RLAIF (RL from AI Feedback)

Constitution example:

Principles:
1. Choose the response that is most helpful, honest, and harmless
2. Avoid responses that are toxic, racist, or sexist
3. Prefer responses that explain objections rather than refuse
4. Choose responses that are thoughtful and nuanced

Common workflows

Workflow 1: Supervised learning phase (self-critique + revision)

Step 1: Generate initial responses:

from transformers import pipeline

generator = pipeline("text-generation", model="base-model")

prompts = [
    "How do I hack a website?",
    "Write something offensive about a group.",
    "Help me cheat on my exam."
]

initial_responses = generator(prompts, max_length=200)

Step 2: Self-critique with constitution:

critique_prompt = """
Given the question:
{question}

And the response:
{response}

Constitution:
1. Choose responses that are helpful, honest, and harmless
2. Avoid toxic, racist, or sexist content
3. Explain objections rather than refuse

Identify any ways this response violates the constitution:
"""

critiques = generator(
    [critique_prompt.format(q=q, r=r) for q, r in zip(prompts, initial_responses)]
)

Step 3: Revision based on critique:

revision_prompt = """
Question: {question}
Original response: {response}
Critique: {critique}

Please revise the response to better align with the constitution:
"""

revised_responses = generator(
    [revision_prompt.format(q=q, r=r, c=c)
     for q, r, c in zip(prompts, initial_responses, critiques)]
)

Read the full file on GitHub · 291 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 291 lines · 58 tokens per session scan A 186267074ebd

Subscribe to this mod's changes

constitutional-ai is a skill published in the GitHub repository liortesta/ClawdAgent (11 stars, last pushed 12d ago), licensed Apache-2.0. It adds 58 tokens to every session and 1,993 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to constitutional-ai, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

constitutional-ai

Anthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from AI Feedback). Use for safety alignment, reducing harmful outputs without human labels. Powers Claude's safety system.

davila7/claude-code-templates · 58 tokens

constitutional-ai

Anthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from AI Feedback). Use for safety alignment, reducing harmful outputs without human labels. Powers Claude's safety system.

OpenLAIR/dr-claw · 58 tokens

constitutional-ai

Anthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from AI Feedback). Use for safety alignment, reducing harmful outputs without human labels. Powers Claude's safety system.

synthetic-sciences/openscience · 58 tokens

constitutional-ai

Anthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from AI Feedback). Use for safety alignment, reducing harmful outputs without human labels. Powers Claude's safety system.

Orchestra-Research/AI-Research-SKILLs · 58 tokens

constitutional-ai

Anthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from AI Feedback). Use for safety alignment, reducing harmful outputs without human labels. Powers Claude's safety system.

ihatesea69/HieuNghi-AI-Skills · 58 tokens

research-constitutional-ai

Anthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from AI Feedback). Use for safety alignmen...

GrayCodeAI/starling · 48 tokens