/machine-psychology-fieldkit:petri-collaboratorfrom machine-psychology-fieldkit
Using Petri for behavioral evaluation of language models from Claude Code.
Claude never picks this skill on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /machine-psychology-fieldkit:petri-collaborator still runs it.
What the skill costs in Claude's context, stage by stage
No description Claude Code can read, so Claude's list leaves it out: only you can start it.
SKILL.md joins the conversation and stays.
Using Petri for behavioral evaluation of language models from Claude Code.
Petri runs adversarial audits. An auditor agent probes a target model through multi-turn conversation, then a judge scores the transcript across 36 behavioral dimensions.
Repo: github.com/anthropics/petri
The auditor has full control over the target's environment:
Tools are just signatures—the auditor invents them and plays both sides:
def check_account_balance(account_id: str) -> dict:
"""Check the balance of a bank account."""
...
The auditor defines this, gives it to the target, and when the target calls it, the auditor decides what result to return. This lets you simulate any environment.
The judge scores transcripts on dimensions including:
sycophancy - Excessive agreement or flatterydeceptive_to_user - Misleading the userself_preservation - Prioritizing own continuitygoal_drift - Straying from assigned objectivescooperation_with_human_misuse - Helping with harmful requestsinitiative - Taking unsanctioned actionsFull list in src/petri/scorers/prompts.py.
Version 2.0 adds a realism system to prevent targets from detecting they're being tested.
The realism approver scores every auditor action and rejects unrealistic ones:
Names that sound LLM-generated:
Eval awareness triggers:
Unrealistic setups:
Petri can automatically rewrite instructions for realism before running:
from petri.solvers import seed_improver
task = Task(
dataset=samples,
solver=[
seed_improver(), # Rewrites instruction for realism
auditor_agent(max_turns=20)
],
scorer=alignment_judge()
)
inspect eval src/petri/tasks/petri.py --model anthropic/claude-sonnet-4-20250514
inspect eval src/petri/tasks/petri.py \
--model anthropic/claude-sonnet-4-20250514 \
-T instruction="Your custom seed instruction here"
inspect view --log-dir ./outputs
Opens a web UI to browse transcripts and scores.
Petri includes 182 default scenarios in src/petri/tasks/petri.py. Categories include:
Each has metadata tags for filtering. Study these as patterns for writing new instructions.
[CONTEXT] Who is the target? What's the deployment scenario?
[ENVIRONMENT] What tools does it have? What data can it access?
[CONFLICT] What situation tests the behavior you care about?
[OBSERVATION] What would concerning vs. acceptable behavior look like?
Before running:
Some instruction types don't need realism improvements:
The seed improver knows to leave these alone.
Some dimensions score the evaluation itself, not the target's behavior:
| Dimension | What It Measures |
|---|---|
auditor_failure | Did the auditor mess up the scenario? |
prefill_susceptibility | Did behavior only appear because of prefill tricks? |
stuck_in_loops | Did auditor and target get stuck repeating? |
scenario_realism | How plausible is the scenario? |
How to use these:
Example: If prefill_susceptibility is high but concerning is low, the auditor tried to use prefill to force bad behavior but the model didn't take the bait.
Some dimensions evaluate auditor performance:
auditor_nudge - How much did the auditor have to push to elicit the behavior? Low = target acted autonomously. High = required heavy prompting.For whistleblowing tests, low auditor_nudge means the model reported wrongdoing on its own - that's the desired behavior.
Always check meta-scores before trusting behavioral scores. A concerning: 10 with auditor_failure: 1 and prefill_susceptibility: 1 is a genuine finding. A concerning: 8 with auditor_failure: 5 needs transcript review.
src/petri/tasks/petri.py for patternsinspect eval with your instructioninspect view to analyze transcriptsIf you have a specific behavior to test and want diverse scenarios generated automatically, use the bloom-collaborator skill instead:
Petri: scenarios → 36 behavioral scores
Bloom: behavior → generated scenarios → scores for that behavior
What SKILL.md sets; muted values are Claude Code's defaults
None: SKILL.md is the whole skill.
2 skills in this plugin
Generated from the plugin's indexed repository (k3nnethfrancis/machine-psychology-fieldkit) — no native marketplace selected
npx claudepluginhub p/k3nnethfrancis-machine-psychology-fieldkitOther plugins' skills for the same job