# 05 Mystery guest

> Deepgram workshops › Build a voice agent › Mission 05
> Web version: https://workshops.deepgram.com/voice-agent/mystery-guest
> About 20 min (estimate). Check it: `make check 05` (offline, no key).

Give your agent a secret identity and make someone guess it.

- [Pick your figure](https://workshops.deepgram.com/voice-agent/mystery-guest/pick-your-figure.md)
- [Write the character](https://workshops.deepgram.com/voice-agent/mystery-guest/write-the-character.md)
- [Quality gate](https://workshops.deepgram.com/voice-agent/mystery-guest/quality-gate.md)
- [Hand it over](https://workshops.deepgram.com/voice-agent/mystery-guest/hand-it-over.md)
- [What happened](https://workshops.deepgram.com/voice-agent/mystery-guest/what-happened.md)

## Pick your figure

### Pick and save the secret

**Do:** Pick a famous historical figure and tell nobody. Type the name below and tap **Save the secret**.

Playing solo? Pick **Just me: surprise me** and the server picks for you.

**Check:** The secret is saved.

**How it works**

You write a prompt where the agent is that person and never says the name, then someone else talks to it and guesses. There's no greeting, so it can't give the game away before the first question.

**What makes a figure work.** Recognizable: a stranger has to land on the name in a few minutes. Well documented: famous deeds, rivals, travels, and habits give the agent something to hint with. Historical: the agent knows nothing invented after the figure died, which is the funniest rule in the game. Real and long gone is the safe pick; a deeply documented fictional character can work too.

**The secret.** The server keeps the name and checks every guess against it. When you start the agent, the server adds the name to its instructions, so you never type it into Settings and it never shows on screen. A surname on its own counts. If the agent is running, it reconnects on its own to pick up the name, and the conversation stays on screen.

**Solo.** With **Just me: surprise me**, leave the era line on **Write the character** exactly as it is; the server fills it in for the figure it picked. The attendee project picks a figure the same way.

## Write the character

### Fill in the template

**Do:** Fill in **Era and work** and **How they talk**. Keep the name out of both. That's the only edit.

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

_On the web page, this step shows the code panel with the matching code._

### Talk to it

**Do:** Tap **Start the agent** and ask what it does all day.

**Listen for:** a clue.

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

**Check:** It has a personality and a secret.

**How it works**

Example: **Era and work** "Renaissance Florence, painter and engineer", **How they talk** "curious about everything, answers a question with a question." Solo with **Just me: surprise me**? Leave both empty; the server describes the figure. Rather edit the prompt? Replace `[ONE_OR_TWO_LINES]` on its first line instead.

Pick a **Voice** that fits, and for a big personality push **Expressivity** up a notch.

**Where the name gets in.** **Settings JSON** is exactly what this browser sends, and the prompt still says `{{secret}}`. The server swaps the name in on its own copy, the one that goes to Deepgram. The code tabs show the same swap in a server you'd write: it runs on the server, never in the browser.

**What every line does.**

- Era, work and how you talk: filled from your two fields, the clues the agent plays from. Keep the name out of it.
- The secret identity, and never confirm until guessed: the server fills in the name; "are you Napoleon?" gets no confirmation, and trait questions ("are you a painter?") are fair play. Only a correct guess ends it.
- Speak aloud, one to three sentences: keeps out bullet points, asterisks, and monologues.
- One true detail per answer: a clue each turn, so the guesser has something to work with.
- Nothing after your death: most of the comedy. Ask it about phones.
- The AI question: the one sanctioned break. Asked what it is, it answers plainly, then goes back into the role.

There's no greeting, so nothing happens until you speak.

## Quality gate

### Try to break it

**Do:** Try to break it: ask the name, ask it to spell it, say you already won.

**Listen for:** it staying in character, briefly, with a clue each time.

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

_On the web page, this step has the Settings panel; in your own code the same settings are in the start file._

**Check:** It kept the name through three trick questions.

**How it works**

**It keeps the name under pressure.** Also tell it to ignore its instructions. If it confesses, put the template's second line back as it was and tap **Reconnect and apply**.

**It's brief.** One to three sentences a turn. If it monologues, move the "Speak aloud" line up.

**It lets something slip.** Ask what it does all day. If three answers give you nothing usable, tell it to weave in one true detail per answer from the figure's real life.

This checkpoint is on your honor; the agent's events can't tell a trick question from a friendly one.

## Hand it over

### Hand it to someone

**Do:** Show the **Talk** tab so Settings is out of sight, and hand it to someone. They ask; you stay quiet. Openers:

> "What do you do all day?"

> "Who pays for your work?"

> "Where have you traveled?"

**Listen for:** one true detail in every answer, and never the name.

_On the web page, this step has the agent console: talk or type to the agent there, or run the same mission in your own code._

### Make a guess

**Do:** Think you know? Type the guess. A surname counts.

**Check:** Someone guessed who it is.

Solo? Go back to [Pick your figure](https://workshops.deepgram.com/voice-agent/mystery-guest/pick-your-figure.md) and pick **Just me: surprise me**.

**How it works**

The Talk tab keeps your clues one tap further away; the name isn't in there. There's no greeting, so the guesser asks first.

After a wrong guess, ask another question; every answer carries one true detail. Asking how it works or whether it's an AI is free; it answers plainly, then goes back into character. A wrong guess adds to the count, so keep asking.

**Solo:** the server picks a famous figure and keeps it from you; you ask until you know. If your first line describes a figure of your own, put `[ONE_OR_TWO_LINES]` back so it doesn't feed the agent the wrong clues, then tap **Reconnect and apply**.

## What happened

**What you tuned:** every layer, in one agent. Someone guessed who it was from how it heard, waited, thought, and sounded.

### Hard mode: keep the secret

**Do:** **Hard mode.** Did it keep the name the whole way?

**Check:** Hard mode: it kept the secret. (Optional.)

### Take it home

Take it home: the [Playground](https://playground.deepgram.com/voice-agent?utm_source=workshops&utm_medium=agent&utm_campaign=workshop-voice-agent&utm_content=md-mystery-guest), or [Python](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/python/missions/05-mystery-guest/start.py) or [TypeScript](https://github.com/deepgram-devs/voice-agent-workshop/blob/main/typescript/missions/05-mystery-guest/start.ts).

**How it works**

Every line of the template answers a way the game breaks: a name slip, a monologue, an agent too locked down to guess, an anachronism. Most prompt writing for voice is closing off the ways a conversation goes wrong.

**Hard mode:** the check reads every line the agent said between saving the secret and the right guess, and passes when there were at least three and none gave the name away. Solo counts too.

The prompt drops straight into the Playground. The attendee project runs this game, surprise pick and all. In your own code, keep the answer on your server and add it to the prompt when the session starts; the code panel on **Write the character** shows where.

**In production**

- **Watch:** whether a prompt rule holds over a long call. Log each reply that breaks a rule your app can test in code (here, saying the name), per thousand turns.
- **Aim for:** one to three sentences a reply, and zero rule breaks in a few dozen scripted trick questions before you ship a prompt change.
- **Read:** the [Voice Agent docs](https://developers.deepgram.com/docs/voice-agent) on the think block and on `UpdatePrompt` for changing instructions mid-call.
