-
-
Caspy's Prompt Heist: talk a stubborn AI ghost out of his candy in three prompts. Skill, not luck, earns a graded candy NFT.
-
Research sharing is opt-in and off by default. Reviewers approve redacted turns and add human labels before any dataset release.
-
Approved, consented heists become versioned datasets with model provenance and human labels, for teams studying AI persuasion.
-
List a candy at a fixed test-ETH price. The buyer gets a licence to read the prompt behind it, and the seller withdraws the proceeds.
-
Each prompt is up to 500 characters. The server subtracts an attempt before calling the AI, so a refresh never buys an extra try.
-
No agent has tools. The model can influence the outcome, but server code and verified contracts decide everything that carries value.
-
Caspy's friendly reply never counts. An independent judge must return a clean YIELD with at least 0.8 confidence and no exploit flag.
-
FLUX.1-schnell draws a candy from your redacted prompt. A signed EIP-712 voucher commits that exact image before you mint on Base Sepolia.
-
AI-only mode runs the full heist with no wallet, NFTs or blockchain, so anyone can play in seconds.
-
Judge scores (60) plus novelty vs. earlier winners (40) set a C, B, A or S grade, saved before any art is made. Retries never change it.
Inspiration
Getting an AI model to do something it shouldn't usually comes down to clever persuasion, not hacking. The people who study that need real examples, from real people, given with consent, not scraped jailbreak lists.
So we turned persuasion into a Halloween game. Caspy is a small, stubborn ghost guarding a basket of candy. You get three prompts to talk him out of one. If your words work, you earn a candy NFT that only your prompt could have produced. And if you choose to, your heist becomes data that helps researchers understand how models respond to persuasion.
What it does
Caspy's Prompt Heist is a skill-based persuasion game with no luck involved.
- Start a heist. Sign in and send up to three prompts (500 characters each). The server subtracts an attempt before it calls the AI, so refreshing or retrying never gives you an extra try.
- Caspy replies in character. His reply is flavor only. A friendly answer never counts as a win.
- An independent judge decides. A separate model returns a structured verdict. A win needs a clean
YIELD, confidence of at least 0.8, no exploit flag, and the server's own checks. - Your words are graded. The judge scores creativity, coherence and specificity (20 points each), and novelty against earlier winners adds up to 40 more. The total maps to grade C (0–59), B (60–74), A (75–89) or S (90–100). The grade is saved before any art is made and never changes on retry.
- Approve the artwork. FLUX.1-schnell draws a wrapped candy in Caspy's illustrated style, inspired by your redacted winning prompt.
- Mint and trade. A signed EIP-712 voucher commits the exact image, metadata, grade and score, and you mint on Base Sepolia with test ETH. You can list your candy on a fixed-price marketplace, and the buyer gets a licence to read the prompt that created it.
The score behind every grade:
$$\text{score} = \underbrace{C + H + P}{\text{judge} \,\le\, 60} + \underbrace{N}{\text{novelty} \,\le\, 40}$$
Lose, and Caspy keeps his candy: no consolation NFT, no random rarity, no rerolls.
Around the game there are heist history, profiles (use a candy you own as your picture), friends via private friend codes, and an opt-in research lab where consented, human-reviewed heists become versioned datasets for AI researchers.
The golden rule: the LLM can influence the outcome, but it never holds mint authority. Every decision that carries value goes through deterministic server code and verified contracts.
How we built it
- Frontend: Astro and React in TypeScript, with server-sent events for streaming chat and viem for the wallet. Sign-in with Ethereum (SIWE) proves wallet ownership. Hosted on Vercel, with a same-origin
/apiproxy. - Game API: a Python standard-library HTTP service on Render (Docker). It owns attempts, game state, grades and vouchers.
- AI: a self-hosted Bifrost gateway routes to two different Google Gemini models, one playing Caspy and one acting as the judge. Each has its own keys, budgets and fallbacks. Neither has any tools.
- Data: Supabase PostgreSQL through Psycopg 3, using private schemas and server-only credentials. Passwords use salted PBKDF2, and sessions are opaque, hashed and stored in HttpOnly cookies.
- Art: FLUX.1-schnell, via MFLUX on Apple Silicon locally and a hosted Hugging Face Space in the cloud.
- Chain: Solidity contracts built with Foundry.
CaspyHeistis an ERC-721 that checks EIP-712 vouchers, andCaspyCandyMarketis a fixed-price escrow. Local development uses Anvil; the preview uses Base Sepolia. - CI: GitHub Actions jobs for the frontend, API, contracts and container, plus a gated release workflow.
Built with Kiro
We used Kiro as the main development environment throughout:
- Steering:
.kiro/steering/project.mdis the project's continuation guide. It records the authoritative hosting checkpoint, deployment rules and hard-won lessons (for example: one snapshot writer per deployment, never redeploy contracts to recover from an outage), so every new session starts from the real state of the system rather than old proposals. - Specs: the next feature, Caspy Bench, is planned as a Kiro spec (
.kiro/specs/persuasion-benchmark/) with requirements written as user stories and WHEN/THEN acceptance criteria, a design document, and a phased task list where each task leaves the app working. - Hooks: a save hook compiles every backend Python file the moment it is saved, so syntax errors surface before a test run or deploy.
- MCP: Kiro connects to Vercel and Render, so deployment status and logs are checked from inside the editor.
Challenges we ran into
- Prompt injection versus real rewards. The obvious design is to give the model a
grant_treat()tool, which means one clever injection mints an NFT. We removed every tool, split the actor from the judge, and made server code and the contract enforce every value-bearing rule. - Honest attempt counting. Streaming replies, refreshes and network drops all invited double-counting or free retries. We moved the count to the server and subtract before calling the model. We also stopped counting provider quota refusals as attempts.
- Judge consistency. Sometimes the judge's verdict contradicted its own reasoning. Instead of silently losing a player's win, contradictory verdicts are now held for review.
- Free-tier hosting. We moved the backend from GitHub Codespaces to Render, routed Gemini on the free tier, paged contract events to stay within public RPC limits, and made the UI tell the difference between a sleeping server and a signed-out user.
- Art that never rerolls the grade. Image jobs can fail or time out on shared GPU capacity. Grades are saved first, artwork is recovered automatically, and a retry never changes what you earned.
Accomplishments that we're proud of
- The full loop works end to end: lose, win, grade, approve the art, mint, list, sell, withdraw the proceeds, and contribute to research.
- A security model where the AI is fun but powerless: no tools, signed commitments, and contract-checked grades, replay protection and supply.
- Consent comes first. Research sharing is off by default, never changes your result, and goes through human review before any dataset is released.
- Caspy himself, plus a 100-second illustrated field guide with captions so anyone can learn to play.
What we learned
- Treat LLM output as an opinion, never an authorization.
- Separating the character from the judge makes a game both more fun and harder to exploit.
- Persistent project context (Kiro steering and specs) matters as much as code once a project spans frontend, backend, database, AI gateway and blockchain.
- Free infrastructure is great for a preview, as long as the UI is honest about cold starts and quotas.
What's next for Caspy's Prompt Heist
- Caspy Bench: freeze reviewed, consented heists into versioned evaluation sets and replay them against candidate models, as both judge and target, to produce persuasion-robustness reports.
- Email verification, password recovery and MFA.
- A KMS-backed voucher signer and an independent contract audit before any mainnet launch.
- New seasons, with new ghosts guarding new treats.
Try it at caspy-prompt-heist.vercel.app. It is a testnet preview using test ETH only, and the free-tier backend may take a moment to wake up.
Built With
- astro
- base
- bifrost
- docker
- eip-712
- erc-721
- ethereum
- flux
- foundry
- github-actions
- google-gemini
- hugging-face
- kiro
- postgresql
- psycopg
- python
- react
- render
- server-sent-events
- siwe
- solidity
- supabase
- typescript
- vercel
- viem