Your worker has been sitting there since lesson 5 answering /health and doing nothing else with its day. Two things turn it into an agent and you add both of them today. It needs a key so that it can think at all, and it needs a job so that it thinks about the right thing.
The key takes four minutes. The job is the part only you can write, and it is the whole difference between an agent that saves you a morning and one that hands you paragraphs you rewrite every time.
You need a developer account with either Anthropic, the company behind Claude, or OpenAI, the company behind ChatGPT, and one of the two is plenty, so pick whichever you already lean on. Your worker reads the key you give it and has no preference between them.
A chat subscription is a different thing from what you need here. Paying for Claude or ChatGPT to use in your own browser does not include the key your agent uses. That key comes from a separate developer account, it is billed separately, and it is billed by usage rather than by the month.
Which works in your favor. A daily agent doing a job this size comes to a few dollars a month rather than another subscription.
If you use Claude. Go to console.anthropic.com, sign up, and add a small amount of credit. Then find API keys and create one. Give it a name you will recognize in six months, like your agent's name. The console also asks how long the key should last, offering a few preset lifetimes or Never. Choose Never. The key lives in one Cloudflare Secret, and an expired key stops your agent the morning it runs out.
If you use ChatGPT. Go to platform.openai.com, sign up, and add a small amount of credit. Then find API keys and create one, with the same advice about the name.
The moment the key appears on screen, put it in your password manager, in a new entry of its own called something like follow-up-agent, AI key, before you click anything else at all. This is the one-time display lesson 4 warned you about, and it behaves exactly the way that lesson said it would.
ANTHROPIC_API_KEY if you went with Claude, or OPENAI_API_KEY if you went with ChatGPT, in capitals and underscores, spelled exactly like that.Visit /health again. aiKey now says true.
Your agent can think, and it has nothing to think about yet.
This is the lesson. Everything else in it is clicking.
You are briefing an assistant who is extremely capable, has never met you, starts every shift with no memory of the last one, and will do exactly what you wrote rather than what you meant. That last part is the one that trips people up. A human assistant fills in your gaps from context, and this one fills them in from nothing, so every gap you leave shows up in the output.
Open the job description template. It has seven sections with an example under each one. Fill it in, in your own words, and the finished thing becomes one setting on your worker.
The seven sections, and what each one is there to prevent.
| Section | What it stops happening |
|---|---|
| 1. Who it is, and what it owns | An agent with no edges wanders off and helpfully rewrites something you never asked it to touch |
| 2. What it does, every time it runs | "Handle my follow-ups" is a wish. "Find X, check Y, draft Z" is a job you can tell it got wrong |
| 3. What it hands you | The one you might be tempted to hurry, and the one that decides whether you save time or gain a reformatting job |
| 4. How it should sound | Only matters if it writes things you send, and then it matters more than the other six put together |
| 5. When it stops and asks you | The difference between an agent you trust and one you double-check forever. Lesson 8 is entirely about this |
| 6. What it needs to know about your practice | A slice of the file you wrote in lesson 3, the part this particular job touches |
| 7. When it runs | Lesson 7 turns this one into a schedule Cloudflare keeps for you |
Lesson 3's rule about client information holds for your agent too. Keep client names and client health information out of the job and out of anything you point it at later, because everything your agent is given goes to your AI provider, and from lesson 7 on it keeps its answers in Cloudflare as well.
Nothing in this course's setup can hold client health information, because none of it comes with a BAA, the business associate agreement a company signs before it handles health information on your behalf. That includes Cloudflare, your AI key, and everything your agent keeps. If a job genuinely needs client names or health details to work, it belongs in a tool that signs a BAA with you, and the first place to look is the AI features inside the EHR you already pay for. Before you use those features with client information, ask your EHR's support team, in writing, whether they are covered by its BAA. Anything beyond that is a conversation for a HIPAA consultant who can look at how your practice is set up.
Section 3 is worth slowing down on. "A summary" feels like an answer while you are typing it. Then the agent hands back four paragraphs when you wanted three lines, and you spend a month rewriting its output before it occurs to you that the brief was the problem rather than the agent. Say the format, the length, and the order. Say what you do not want in there.
And it is going to be wrong the first time, in small ways that only show up once you read something it produced. That loop is the actual skill this course teaches. Change one section, run it again, read what comes back. Nobody writes a good job description from a blank page, including me.
JOB./health now says job is true.
Visit your agent's /run address with your password on the end.
https://follow-up-agent.yourname.workers.dev/run?key=yourpasswordIt thinks for a few seconds and hands back a block of JSON with its answer inside. The answer sits on the line beginning "output", and it arrives with every line break written out as \n instead of an actual line break, which makes it a slightly ugly way to read something. Lesson 7 gives you a plain-text address for exactly that reason, so ugly is fine for today.
That answer was written by your agent, doing your job, in the context of your practice. Read it properly, because you are about to run the loop for the first time.
Whatever comes back wrong, the fix is almost always the job description rather than the agent. Edit JOB, deploy, run it again. Two minutes a round.
You may also see a line mentioning that there is no MEMORY binding. Correct, and expected today. Your agent has nowhere to put anything down yet, so the answer lives only in the page you are looking at, and lesson 7 gives it somewhere permanent.
If this step does not do what it says here, stop and post it in the VIP chat. Do not push through it and do not sit on it. I cannot fix what nobody tells me about, and you are almost certainly not the only one on this exact step today.
Your agent still only runs when you go and visit it, which means you are still the one who has to remember it exists. Lesson 7 fixes that, and it takes twenty minutes.
| What you see | What it means | Fix |
|---|---|---|
The AI call failed, ending in HTTP 401 | The key is wrong, or it went in with a stray space on the end | Create it again, paste it again, Deploy |
The AI call failed, ending in HTTP 400 | Usually a MODEL variable, which is optional and which this course never asks you to create | If you added one, delete it and let your agent use its default |
| Something about your credit balance being too low | Your AI account has no money in it | Add a small amount at the console you signed up with |
No JOB set | The panel closed before you clicked Deploy, or the name reads as something other than JOB | Open Variables and Secrets, check the spelling, and add it again if it's wrong or missing |
| The answer ignores half your brief | Almost always sections 2 and 3 being vaguer than they felt while you wrote them | Rewrite them as numbered steps and an exact output shape |
| It invented a detail about your practice | Section 6 is thin | Give it the specific facts this job needs, and tell it to say so when it does not know |
If your screen looks nothing like this, drop it in the chat and I will answer you there.
Post it in the VIP chat and ask your question there. If a step does not work, if your screen does not match what is written here, or if something just reads confusingly, that is worth saying out loud.
I am building this while you are walking through it. If you do not tell me a thing is broken, I do not know it is broken, and it stays broken for whoever comes next. Tell me and I will fix it as fast as I can.
Wins go in the same place. They tell me which parts are landing.