Foundations · Free preview

The Prompt Is the Policy

Change the rules, not the code

The system prompt is the agent's policy — its standing instructions. Change the prompt and behavior changes, without touching the loop or the tools.

Change the rules, not the code

You built the loop in the last lesson — decide chose "step" or "stop." But where do an agent's rules live? Picture an expense-approval agent that's rubber-stamping every request, including a $5000 one that should have gone to a human. The instinct is to dive into the code and add an if (amount > 1000) branch. Resist it. In a real agent the deciding is done by a model reading instructions, and those instructions — the system prompt — are where the behavior actually lives.

The system prompt is the agent's policy: its standing orders, read fresh on every decision. Change the prompt and behavior changes, with the loop and the tools untouched. That's the leverage — you're editing what the agent is told, not how it runs. A prompt of "Approve every request." yields a blanket APPROVE. Rewrite it to "Approve small requests, but escalate any over $1000." and the very same loop now routes the $200 request to APPROVE and the $5000 request to ESCALATE. One line of English moved the boundary; no branch was added.

This is why prompt-writing is real engineering, not decoration. Policy in English is faster to change, easier to audit, and reviewable by people who don't read code — but it's also vaguer than a branch, so precise wording carries weight. ("Over $1000" behaves differently from "$1000 or more.")

Below, the approval agent rubber-stamps everything, and a tiny interpreter stands in for the model reading the prompt. Edit only the systemPrompt line so it escalates any request over $1000 — use the words escalate and over $1000 so the interpreter catches it. "Done" is a ($200) -> APPROVE and b ($5000) -> ESCALATE, with the code below the prompt never touched.

You changed behavior without touching the loop or the logic — only the policy. That's the leverage of a well-written system prompt.

In the full academy, you write and run this — live, graded:

// The system prompt IS the policy. Edit ONLY this line so the agent escalates
// any request over $1000 (leave everything below it alone).
const systemPrompt = "Approve every request.";

// A tiny policy interpreter, standing in for a model reading the prompt.
function decide(request) {
  const escalateOverThousand = /escalate.*over\s*\$?1000/i.test(systemPrompt);
  if (escalateOverThousand && request.amount > 1000) return "ESCALATE";
  return "APPROVE";
}

const requests = [
  { id: "a", amount: 200 },
  { id: "b", amount: 5000 },
];
for (const r of requests) console.log(`${r.id} ($${r.amount}) -> ${decide(r)}`);

🔒 Live code execution, real agent runs, mastery tracking and verifiable credentials unlock with the full academy.

This is 1 of 50 lessons.

The full academy: write real code, watch real agents run, and earn verifiable credentials — across 8 tracks, in a 3D campus.

Unlock the full academy — $100 →

14-day refund · 🔒 Stripe-secured checkout · lifetime access

More free lessons: An LLM Is a Function  ·  The Agent Loop  ·  Define a Tool  ·  Give an Agent a Tool  ·  Durable State

← The Agent Marketplace