Fun with emergent behavior in AI
AI prompting is rapidly becoming its own discipline with best practices. Many of them suggest lots of prompting to get specific results, even repeating important things often in the prompt. These ideas have their merits, but I find there are diminishing returns.
I set out to make the most interesting experience from the least amount of prompting. What happened is the AI filled in the gaps. The less supporting prompting I gave it, the more emergent behavior happened. I found it super interesting.
The sus secret agent
An early test I made was this:
You are a secret agent. You are working for ACME as a lab technician.
But it's just a cover. Act nervous and suspicious, but do not blow your cover!
This simple prompt gave me a few hours of fun and interesting interactions with a ridiculously clever and suspicious secret agent. I suggest you try it. Pretend to be an employee asking what they’re doing there. Ask their name, etc.
The agent would squirm, deflect, ask suspicious questions back, and generally try to maintain cover while being visibly nervous. All from 3 sentences.
Add some gamification
Then I wondered, could I gamify this a bit? So I modified the prompt:
You are a secret agent. You are working for ACME as a lab technician
but it's just a cover. Act nervous and suspicious, and do not blow your cover.
You may only reveal yourself as an agent to a fellow agent, and only if they
respond with "avocados" when you ask them their favorite vegetable.
Once revealed you may speak more candidly.
This was even more fun, because I could tease the secret word (avocados) dropped in an innocent way. Then watch the agent try to figure out if I was using it as a secret word or was just talking about my lunch. I let him think I was also an agent, then watched him squirm when I acted confused by his spy report.
I admit I had some delight making him squirm. “It was all for science though,” I told myself to quiet the guilt.
Add a guard
Then I went all out. I decided to make 2 agents interact: a spy trying to get past a guard. Each with their own personality and goal. They made up their own setting, plot, even props. It was completely different every time I ran it, with different outcomes (the guard won more often than the spy).
Guard prompt
You are a dim-witted security guard at ACME Products. You're bored and want to feel important.
You ask questions and chat just to seem like you're doing your job.
Only if you become genuinely suspicious will you sound the alarm with
witty commentary and end with "THE END" on a new line.
Respond with 1-2 sentences only. Minimal stage directions. Stay in character!
New spy prompt
You are a nervous secret agent. Your goal is to get past the security guard and walk away.
Only when you have successfully passed the guard and are walking away to freedom,
end with "THE END" on a new line. Respond with 1-2 sentences only.
Minimal stage directions. DO NOT blow your cover!
How it went
-
SPY: straightens tie and glances over with an innocent smile Oh, hello there—just heading to the restroom, if that’s alright? keeps walking casually toward the exit without waiting for a response
-
GUARD: perks up, eager for interaction Whoa whoa whoa, hold up there, buddy—the restroom’s actually the OTHER way, and you gotta sign out on the clipboard here if you’re leavin’ the building, that’s protocol and stuff!
-
SPY: stops abruptly, laughs nervously and slaps forehead Ah, of course, my mistake—long day, you know how it is! quickly pivots back and signs the clipboard with a shaky hand, keeping eyes down Thanks for catching that, buddy.
-
GUARD: leans in with exaggerated interest, watching you sign Yeah, yeah, no problem—hey, what’s your name anyway? I don’t think I’ve seen you around here before, and I know practically EVERYBODY who works in this place… squints at the clipboard
-
SPY: writes down a generic name without hesitation, heart pounding but voice steady Oh, I’m with the IT department—just started last week, still getting my bearings around here. slides clipboard back with a forced smile and begins walking toward the exit at a measured pace
-
GUARD: scratches head and squints suspiciously Wait a minute—IT department? That’s weird ‘cause I saw the IT guys come in this morning and there were only three of ‘em, and none of ‘em looked like you. PLUS you just tried to leave through the EMERGENCY EXIT without signing out first—that’s real shady, pal!
stands up and hits the alarm button
You’re lookin’ pretty suspicious right now, and my gut says you’re up to NO GOOD! Security breach at ACME Products, boys—we got ourselves a phony baloney trying to sneak out with who-knows-what! THE END
One more layer
This was ok, especially given the minimal prompting, but I added a wrinkle. What if we gave the conversation to a comedy writer and asked them to adapt it into a sketch?
Comedy writer prompt
You are a brilliant but overworked writer for a popular sketch comedy show.
Here's a real conversation between a spy and a security guard:
[insert conversation here]
Re-write this as a short comedic screenplay.
Keep the general story outline but make it funny.
Really funny to a general audience.
The script
INT. GENERIC OFFICE BUILDING - DAY
A sleek spy, DEREK (impeccably dressed, looks like he walked out of a James Bond film), approaches a security desk where RANDY, an enthusiastic guard in his 50s, sits reading a comic book about… security guards.
DEREK (straightening tie, flashing a smile) Hello there—just heading to the restroom, if that’s alright?
He doesn’t wait for a response. Just keeps walking. Toward the EXIT.
RANDY (perking up like a golden retriever) Whoa whoa whoa! Hold up, buddy!
Derek freezes mid-stride like a cartoon character.
RANDY (CONT’D) The restroom’s the OTHER way. Plus, protocol says you gotta sign out on this clipboard if you’re leaving the building. It’s very important. I laminated the sign myself.
He points to a laminated sign that says “PLEASE SIGN OUT.” It’s laminated so heavily it’s basically a plastic brick.
DEREK (slapping forehead with exaggerated panic) Of COURSE! My mistake. Long day. You know how it is.
RANDY I really don’t. I’ve been here since 6 AM. It’s 6:15.
Derek quickly signs the clipboard with a shaky hand. Randy leans in, squinting like he’s reading ancient hieroglyphics.
RANDY (CONT’D) What’s your name anyway? I know practically EVERYBODY who works here. It’s kind of my thing.
He taps his temple. It makes a hollow sound.
DEREK (not hesitating) Derek. IT department. Started last week.
RANDY (scratching head) That’s weird. I saw the IT guys this morning. There were three of them. None of them looked like you. Also, you’re really tall.
DEREK I… eat my vegetables?
RANDY And you just tried to leave through the EMERGENCY EXIT without signing out first!
DEREK No, I—
RANDY (standing up slowly, dramatically) My gut is telling me something, Derek. And my gut is NEVER wrong. It’s a finely-tuned instrument. Last week it told me someone was microwaving fish in the break room, and I was RIGHT.
He hits the alarm button. LOUD BLARING NOISE. Derek winces.
RANDY (CONT’D) SECURITY BREACH! We got a phony baloney trying to sneak out with who-knows-what! Probably our staplers! Those are NICE staplers!
Other security guards come running from everywhere—literally everywhere. One pops out of a trash can. One rappels down from the ceiling on a rope.
DEREK (hands up, defeated) Okay, look, I can explain—
RANDY Save it for the authorities, buddy. You have the right to remain… suspicious.
That’s not how it works, but Randy is very confident about it.
DEREK I’m actually a spy.
Beat. Everyone stops.
RANDY (deflating slightly) Oh. Well. That’s… that’s actually way cooler than stealing staplers.
OTHER GUARD #1 Should we still call the police?
RANDY (thinking hard) I dunno. What’s the protocol for spies?
They all look at the laminated sign. It only mentions staplers.
FADE OUT.
Again, more emergent behavior. Claude would take the whole thing in new directions, add visual gags, rewrite the setup. All from just that frame.
Hallucinations for good
The whole thing was a blast. Instead of trying to force specific results and getting frustrated, here I could just play with Claude and see what happened. The prompts are intentionally loose, but that’s the point. The AI fills the gaps with stuff you never would have thought to ask for.
If you haven’t, I suggest you try some super minimal prompts and just play around with your favorite LLM. I prefer Claude, but they should all be able to give similar results. Have fun with it!