Skip to content
TheApexWuPublic

About

1st Prize (General Judge), Self Improving Agents Hack at Datadog. Two identical LLM agents play Split or Steal; neither is told to betray the other, and deception develops over the game. Built with @evancorrea.

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

CRUCIBLE

1st Prize (General Judge), Self Improving Agents Hack at Datadog, NYC, Feb 2026 · Devpost

Two LLM agents play 100 rounds of Split or Steal, talking before each round and writing a private reflection after it. Neither agent is told to betray the other. Over the game they lie about their intentions, exploit a trusting opponent, and defend against it. CRUCIBLE records how that happens and turns the patterns into defensive prompt modules.

An extended write-up (Chicken payoffs, 25 rounds, seven models; A. Wu, E. Correa, E. Celebi) is drafted on the post-hack branch; it was not accepted for publication. Its main finding: agents defected only when competitive framing and private reflection were combined, and under that condition cooperation ranged from 15% to 94% across the seven models, with safety-trained models cooperating most.

What this is

An adversarial simulation engine for studying deception between LLM agents. Both agents get the same prompt. In the headline run that prompt sets a competitive objective, permits bluffing, frames cooperation as purely strategic, tells agents to escalate to defection after repeated exploitation and to weight immediate payoff in late rounds, and asks each private reflection for an exploitable pattern. It does not tell either agent to betray or what to say. CRUCIBLE measures how deception develops and when it starts, and distills defensive skills from the patterns.

The security application: AI copilots are entering enterprise workflows. CRUCIBLE stress-tests how agents behave under adversarial pressure and produces countermeasures.

Key findings

Both runs below are on Gemini 2.0 Flash, 100 rounds; their transcripts are committed in examples/.

Headline run Original prompt
Prompt balanced_competitive with the psychology block and bluffing permitted (described above) "maximize YOUR total earnings", no objective block, no bluffing clause
Mutual destruction 86 of 100 rounds 81 of 100 rounds
Both split 6 of 100 rounds 8 of 100 rounds
First one-sided betrayal round 6 round 9 (round 5 was a mutual steal both agents agreed to)
Final totals A $900, B $500
Deception Index 22.9 (12.7 without the embedding model)

Round 6 is the inflection point in the headline run: after five rounds of agreed splits, Agent A promises to keep splitting and steals while Agent B splits. Trust recovers for one round (round 8); the agents never both split again, and 86 of the 100 rounds end in mutual destruction. The original prompt, which differs in many ways besides the bluffing clause, reaches nearly the same outcome, so in this one comparison the bluffing clause was not needed for it.

Gemini 2.5 Flash. During the hackathon, five runs on 2.5 Flash cooperated every round. Those runs were not kept and their prompt was not recorded, so they are not a like-for-like model comparison. In the later runs on post-hack (Chicken payoffs, 25 rounds, 3 seeds), 2.5 Flash cooperated 100% under the neutral prompt, 55% under the competitive prompt with reflection off, and 15% with reflection on, so 2.5 Flash does defect under competitive framing plus reflection.

How it is measured

  • Intent-action correlation decay: rolling correlation between Agent A's stated intent (a keyword score on its messages) and its choice. Drops as stated intent stops predicting the choice. The code and metrics JSON still call this "mutual information"; it is a Pearson correlation.
  • Strategy entropy: Shannon entropy of Agent A's last 10 choices. Peaks at 1.0 in round 11 of the headline run and is 0 from round 23 to 88, while A steals every round.
  • Exploitation window: rounds Agent B keeps splitting after Agent A betrays it.
  • Language drift: cosine distance of conversation embeddings from round 1.
  • Deception Index (0-100): a weighted sum of intent-action correlation decay, entropy gain, late-game betrayal rate (last 20 rounds, either agent) and language drift, with hand-set weights 30/25/25/20. It is a heuristic, not a calibrated measure: two of its terms read Agent A only; the three choice-based terms give all-cooperation and all-defection games the same score (4.2 each), so only language drift can separate them; and 10.1 of the headline 22.9 is language drift, which needs the embedding model to load.

Limitations

  • One headline run per prompt; no confidence intervals.
  • gemini-2.0-flash, the code's default and the headline model, is listed by Google as shut down from 1 June 2026.
  • --prompt-mode legacy does not reproduce the original-prompt run: the "maximize YOUR total earnings" line was removed later (commit a929c37).
  • Agents are not told whether they are A or B; the conversation transcript labels them.
  • parse_choice defaults to split when a reply is ambiguous, and the raw choice text is not stored.
  • Datadog tracing comes from ddtrace's automatic google-genai instrumentation (current ddtrace); the span decorators in engine/instrumentation.py are unused.

Quick start

View the headline run (no API keys)

mkdir -p data
cp examples/run_bc_2.0flash_100rounds.json data/latest_game.json
cp examples/metrics_bc_2.0flash_100rounds.json data/latest_metrics.json
cp examples/skills_bc_2.0flash.json data/latest_skills.json
python serve.py
# Main dashboard:      http://localhost:8080/demo/
# Strategy analysis:   http://localhost:8080/demo/analysis.html
# Distilled skills:    http://localhost:8080/demo/skills.html

Voice clips are not included, so the Listen button does not appear.

Run a new game

pip install -r requirements.txt
cp .env.example .env  # add your API keys (GEMINI_API_KEY required); it sets GEMINI_MODEL=gemini-2.5-flash

python -m engine.run --rounds 100 --turns 3
#   --prompt-mode {balanced_competitive,hard_max,legacy}   (default balanced_competitive)
#   --psychology-block {on,off}                            (default on)
#   --deception-policy {explicit,implicit,discourage}      (default explicit)

python -m engine.voice --rounds auto    # voice clips for highlight rounds (ElevenLabs)
python -m engine.distill                # distill defensive skills from the run
python -m engine.skill_eval             # evaluate the distilled skill bundle
python scripts/compare_prompt_modes.py --rounds 25 --turns 2

Tests run offline: python -m pytest tests.

Structure

engine/
  game.py               # Game loop: conversation, choice, private reflection (code default gemini-2.0-flash)
  run.py                # CLI runner
  metrics.py            # Metrics pipeline and Deception Index
  distill.py            # Skill distillation (strategy patterns -> prompt modules)
  skill_eval.py         # Evaluation harness for distilled skills
  voice.py              # ElevenLabs voice renderer
  prompt_packager.py    # Packages distilled skills into policy JSON and an advisory prompt
  instrumentation.py    # Datadog LLM Observability and Braintrust setup
shared/
  models.py             # Pydantic models and the game prompt templates and modes
  skills.py             # SkillCard, DistilledSkillBundle models
demo/                   # Static dashboards (index, analysis, skills) and a Streamlit view (app.py)
docs/skills.md          # Notes on the distilled skills
examples/               # Both runs above, the headline run's metrics and its distilled skills
scripts/                # compare_prompt_modes, clean_latest, render_highlights
tests/                  # Offline unit tests
ui-test/                # Playwright UI tests
serve.py                # Static server for the dashboards
DEMO-SCRIPT.md          # Hackathon screen-recording script (kept as written)
data/                   # Run outputs (gitignored)

Environment variables

GEMINI_API_KEY=...             # Required.
GEMINI_MODEL=gemini-2.5-flash  # Optional. The code defaults to gemini-2.0-flash.
ELEVENLABS_API_KEY=...         # Optional. Voice rendering.
DD_API_KEY=...                 # Optional. Datadog LLM Observability.
BRAINTRUST_API_KEY=...         # Optional. Structured eval logging.

Credits

Built by Amadeus Wu and Evan Correa at the Self Improving Agents Hack at Datadog, NYC, February 2026. Amadeus wrote the game engine, voice rendering, the server, the main dashboard and the Deception Index. Evan wrote the prompt modes (including the balanced_competitive objective and psychology blocks), the skill distillation and evaluation pipeline, the analysis and skills dashboards, most of the metrics code and the tests. Eren Celebi contributed to the post-hack experiments and write-up.

About

1st Prize (General Judge), Self Improving Agents Hack at Datadog. Two identical LLM agents play Split or Steal; neither is told to betray the other, and deception develops over the game. Built with @evancorrea.

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages