scalable/ai/agentic patterns/lesson 04 cph / /
lesson 04 / 07 · 12 min · updated ·

personas — identity for agents

a bundle of prompt, voice, allowed skills, and guardrails. swap it and the same loop behaves differently.

what a persona is

a persona is the identity an agent takes on — a bundle of prompt, voice, allowed skills, and guardrails. it's the pattern that turns one agent loop into many different agents without rewriting the loop. support, sales, scheduler, legal-researcher, onboarder — same infrastructure underneath, different persona on top.

the separation is deliberate. the loop handles the mechanics (read message, run model, maybe call a skill, repeat). the persona handles the character (who you are, what you can do, what you won't do). swap the persona and everything else stays put.

a persona in motion

define a support persona, run a turn — click run
ready

four fields, in roughly the order they matter:

swap, don't branch

same loop, two personas, observably different outputs
ready

once personas are first-class, new agents become config changes. a weekend prototype of "legal researcher that only cites public case law" is a new persona object and, if needed, a couple of new skills. no new loop. no new deploy target. notice the third call — the same persona that cites refund policy refuses the "should I sue" question because of a guardrail pattern. the loop didn't even start.

why not just prompt engineering. you can fake a persona with a clever system prompt and nothing else, and for a weekend demo that's fine. but as soon as you need "this agent cannot touch refunds" or "this one must cite its sources", you want that as code, not as hope. i've watched a prompt-only guardrail slip in production on turn seven of a perfectly reasonable conversation — the one-line code check that would have caught it was cheap; the apology email that followed was not. personas are the pattern that turns "don't do that" into "can't do that".

when it breaks

next: handoffs — how one persona passes control to another with just enough context.

scalable labs·cvr 30091604·github·linkedin·hello@scalable.dk