Skip to content
Agentdex

Blog · · Agentdex Editorial

Prompt Games: How to Learn AI Prompting by Playing

Prompt games turn prompting into a challenge: get the AI to reveal a secret, defend your own system prompt, or make a model produce exactly what you had in mind. They are one of the fastest ways to build an intuition for how language models follow, misread and break instructions, and that intuition carries straight into real work. This guide covers the main types of prompt games, a few well-known ones to start with, and how to turn play into better prompts.

Key Takeaways

  • Prompt games give instant feedback, which makes them a quick way to learn how models respond to wording, context and constraints.
  • Adversarial games such as Lakera's Gandalf, Tensor Trust and HackAPrompt teach prompt injection, the main security risk in AI apps and agents.
  • Creative games (story, image and role-play prompts) build the clarity and specificity that make everyday prompts work.
  • The lesson to take into real work: be specific, give context and constraints, test, and assume users will try to break your instructions.
A person typing prompts on a laptop surrounded by AI-generated images

What are prompt games?

A prompt game is any activity where the goal is reached by writing prompts for an AI model. Some are formal games with levels and leaderboards; others are exercises you can run with any chatbot. They fall into a few broad types:

  • Adversarial games: trick a model into breaking its rules, or write instructions that resist being tricked.
  • Target-matching games: write a prompt that reproduces a given output, such as an image, a piece of text or a function.
  • Storytelling and role-play games: co-write a story, run a text adventure, or play a character with an AI game master.
  • Constraint games: get a useful answer within a word limit, without certain words, or in a strict format.

Why playing works

Most people learn prompting by trial and error at work, where mistakes are slow and costly to spot. Games compress that loop. You see immediately whether a prompt worked, you try again, and you start noticing patterns: models follow specific instructions better than vague ones, later instructions can override earlier ones, and a model will often follow instructions hidden inside content it was asked to process. That last point is the root of prompt injection, and games are the safest place to learn it.

Adversarial prompt games to start with

Gandalf by Lakera. Lakera's Gandalf asks you to trick an AI into revealing a password. Each level adds stronger defenses, so you have to get more creative as you go. It is free in the browser and is the best-known introduction to prompt injection. Lakera also runs Agent Breaker, where you attack simulated AI applications and agents and get a score for each attempt.

Tensor Trust. Tensor Trust is a prompt-injection game built around bank accounts. You write a defense prompt that only lets the AI say "access granted" when the right password is entered, then try to break into other players' accounts. Playing both sides teaches you how attacks work and why defending against them is hard.

HackAPrompt. HackAPrompt is an AI red-teaming competition with themed tracks of challenges. It is more structured than casual games and suits people who want to go deeper into AI security. Check the site for current tracks and rules.

These games teach a lesson every builder should know: no system prompt is unbreakable. If you are building an app or agent that processes user input, emails or web pages, plan for injection with limited permissions, input and output checks, and human approval for risky actions, rather than relying on instructions alone.

Creative and target-matching games

Image recreation. Pick a photo or illustration and try to recreate it with an image model using only a prompt. Compare the result, adjust subject, composition, lighting and style, and repeat. You will quickly learn which details models need spelled out.

A reference landscape photo beside an AI-generated recreation

Text adventures. Ask a chatbot to act as a game master: set a genre, rules, an inventory system and a win condition, then play. Writing those rules is good practice for system prompts, because you see immediately when the model forgets or bends them.

Build a game by prompting. Tools such as Rosebud let you create browser games by describing them. It is a practical way to practice iterative prompting, since every change request has a visible result. See our roundup of AI game makers for more options.

Prompt habits that win games and help at work

  • Be specific: name the format, length, audience and tone you want.
  • Give context: explain the goal and background, not just the task.
  • Use examples: one good example of the output is often worth a paragraph of description.
  • Change one thing at a time: so you know which edit made the difference.
  • Ask the model to check itself: request a review of its answer against your constraints.
  • Assume someone will try to break it: test prompts with awkward, hostile and off-topic inputs.

Running prompt games with a team

Prompt games work well as a short workshop. Give everyone the same task, such as summarizing a messy document into five bullet points for a manager, set a time limit, then compare prompts and outputs together. Rotate formats: one round of constraint challenges, one round of red-teaming a sample system prompt, one round of recreating a target output. Keep the best prompts in a shared library so the practice turns into reusable work. Do not paste confidential data into public games or chatbots.

From play to production

The same skills apply when you write instructions for coding agents. A clear project rules file for Cursor (Agentdex profile) or Claude Code (Agentdex profile) is prompt engineering, with the same need for specificity and testing. Our guide to writing agent rules shows how.

Model Pulse

Daily AI model drops, tools, and what they mean for AI coders.

FAQ

Are prompt games only for beginners?

No. Beginners learn the basics quickly, and experienced builders use adversarial games to understand prompt injection, which matters for anyone shipping AI features or agents.

Do I need a paid AI account to play prompt games?

Usually not. Gandalf and Tensor Trust run in the browser, and many exercises work on the free tiers of mainstream chatbots. Usage limits on free plans may slow you down.

What is the best prompt game for learning about AI security?

Start with Lakera's Gandalf for a gentle introduction, then try Tensor Trust to practice attack and defense, and HackAPrompt if you want structured red-teaming challenges.

Can prompt games help with non-technical work?

Yes. Constraint and target-matching games train the clarity that improves emails, summaries, lesson plans and marketing drafts.

How do I know if prompt games are improving my prompts?

Keep a few real tasks as benchmarks. Rewrite your prompts for them every few weeks and compare how often the output is usable without edits.

Written by Agentdex Editorial. Agentdex is an independent directory reviewing AI coding tools; we are not affiliated with the companies mentioned. Prices and features are as of October 24, 2026, from official sources linked above. Always confirm on the vendor's site.