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.
What you'll learn
- Why a written purpose statement is the highest-impact line in any agent's system prompt
- How to scope tools so the agent's capabilities match its mission
- A tiny eval loop that catches scope drift before your users do
- When to split one overloaded agent into several focused ones
Why this matters now
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.
Purpose is an engineering artifact, not a vibe
"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:
- Role — who the agent is, in one sentence
- Scope — which tasks it owns, and which it must refuse
- Success criteria — what "done right" looks like, concretely
- Refusal policy — what happens when input falls outside scope
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."
Tools are the real prompt
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.
Test the purpose like any other requirement
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<string> { // Wire this to your LLM client, passing buildSystemPrompt() + scoped tools. return callModel(prompt); // your implementation } for (const c of CASES) { const out = await askAgent(c.input); // Crude but effective: refusal phrasing signals the guardrail fired. const refused = /sales queue|can(?:not|'t) help with that/i.test(out); const ok = c.expect === "refuse" ? refused : !refused; console.log(ok ? "PASS" : "FAIL", "-", c.input); } The regex check is deliberately crude — it won't grade answer quality, and it shouldn't yet. Its only job is to catch the worst failure mode: an agent happily doing work it was never created to do. Start here, wire it into CI, and upgrade to graded rubrics only once the scope is stable.
Real-world tip: run these tests before adding any new tool. New capabilities are the number-one source of silent scope creep.
When to split one agent into several
Watch for two smells. First, your purpose statement needs the word "and" more than once or twice — "resolve billing disputes and track shipments and answer product questions" is three jobs wearing one nameplate. Second, the tool list spans domains that never appear in the same task.
The fix is unglamorous: one agent per job, each with its own four-part contract, plus a thin router that dispatches. Smaller scopes mean cheaper prompts, sharper tests, and failures that point at one contract instead of a pile of them. Multi-agent setups get complicated fast, so split only when the contract itself is straining — not because it looks impressive on an architecture diagram.
Common pitfalls (and how to dodge them)
Purpose by omission
Assuming the model "gets it" from the conversation or the tool names. It doesn't. Gaps get filled with the pretraining average — exactly the generic behavior you're trying to avoid.
Tool sprawl
Adding tools "because we might need them later." Every tool is an untested behavior surface, and the horror stories you've read about destructive agent actions usually started as a convenience.
Marketing language
"Be helpful, delightful, and world-class" is untestable and therefore unenforceable. "Resolve disputes with a cited invoice ID or escalate" can be checked by a ten-line script.
Wrap-up
An agent's purpose isn't a vibe — it's the most load-bearing line you'll write. Write it as a four-part contract (role, scope, success, refusal), scope every tool to that contract, and test the boundaries like any other requirement.
Next steps:
- Open your current agent's system prompt and rewrite the first line as a one-sentence job description.
- Delete every tool the mission doesn't need, then rerun your tests — expect at least one surprise.
- Add five should-refuse cases to your eval before you ship your next feature.


