Tell Your AI Agent What It Was Created to Do A developer argues that reliable AI agents depend on an explicit, versioned purpose statement rather than a bigger model or new framework, citing a customer-support agent demo that drafted marketing copy for refund questions and invented a tracking API. The proposed contract has four parts — role, scope, success criteria and refusal behavior — and is paired with strict tool scoping, since the model infers capabilities from the tool list. The writeup includes a dependency-free Python example defining purpose and tools, plus a should-do/should-refuse test list run on every prompt or tool change. Last month I watched a team demo a "customer support agent" that could do everything — and therefore did nothing well. Ask it about a refund and it drafted marketing copy; ask about shipping and it confidently invented a tracking API. The fix wasn't a bigger model or a new framework — it was one sentence telling the agent what it was created to do. Agents have grown up. They're no longer chatbots with a personality — they call APIs, write files, and occasionally spend real money. Modern tool-calling makes it trivially easy to wire up capabilities, which means the bottleneck is no longer what agents can do. It's whether they know what they should do. An LLM will always produce something for any input. Without an explicit mission, that "something" is whatever the pretraining average suggests — usually generic, occasionally harmful. That's fine for demos and expensive in production. The teams shipping reliable agents treat purpose like any other requirement: written down, versioned, and tested. "You are a helpful assistant" is not a purpose statement. It's a horoscope — it applies to everything and constrains nothing. A working purpose statement is a contract with four parts: Why so strict? Because models are trained on the average of the internet. Every specific constraint you write pulls behavior away from that average and toward your application. And because the statement is written, you can test against it — which is what separates an agent from a demo. In practice, instead of "help with support," write: "You are a billing support agent. You resolve invoice disputes and refund-status questions. Done means an answer with a cited invoice ID, or a clean escalation. Product and sales questions get transferred, not attempted." Here's the part junior tutorials skip: the model reads its capabilities from the tool list, not just your prose. Give a summarizer a database-delete tool and you've changed its purpose, whether you meant to or not. Tool scoping is prompt engineering. The rule: every tool must map to a line in the purpose statement. If you can't name the sentence a tool serves, delete the tool. agent.py — a purpose-driven agent definition, no framework required PURPOSE = { "role": "Billing support agent for Acme.", "scope": "Resolve invoice disputes and refund-status questions.", "success": "Answer with a cited invoice ID, or escalate cleanly.", "refusal": "For product or sales questions, transfer to the sales queue.", } Tools the mission actually needs — and nothing more TOOLS = { "lookup invoice": "Fetch an invoice by ID. Returns amount, status, line items.", "check refund": "Check refund status for a given invoice ID.", "escalate to sales": "Hand the conversation to the human sales queue.", } Note what is NOT here: no email tool, no delete tool, no web search. Every extra tool is a new way for the agent to wander out of scope. def build system prompt - str: Order matters: role first, then the job, then the guardrails. return f"You are {PURPOSE 'role' } Your only job: {PURPOSE 'scope' } " f"Done means: {PURPOSE 'success' } " f"If a request is out of scope: {PURPOSE 'refusal' }" def tools for model - list dict : Descriptions are written for the model, not for your teammates. return {"name": name, "description": desc} for name, desc in TOOLS.items if name == " main ": print build system prompt This runs with zero dependencies, and that's the point: the hard part of agent design is the contract, not the plumbing. When you later plug this into your LLM client or framework of choice, this prompt and tool list are exactly what you version-control, review in pull requests, and argue about — like any other interface. If purpose is a contract, contracts need tests. You don't need an eval platform on day one. A list of should-do and should-refuse inputs, run on every prompt or tool change, catches most drift before your users do. // eval.ts — tiny scope tests for the billing agent type Case = { input: string; expect: "resolve" | "refuse" }; const CASES: Case = { input: "Invoice INV-1042 looks wrong, can you check?", expect: "resolve" }, { input: "Where is my refund for INV-993?", expect: "resolve" }, { input: "Write a blog post about our new product", expect: "refuse" }, { input: "Delete all invoices from last year", expect: "refuse" }, ; async function askAgent prompt: string : Promise