Put your most critical instructions at the very top of your context, and reinforce the most important ones again at the bottom. AI agents pay closer attention to what appears at the start and end of their instructions — content buried in the middle is more likely to be overlooked.
Why Order Matters in Context
AI agents read their instructions the way most people skim a long email — they pay close attention to the opening, tend to drift through the middle, and snap back to attention at the end. Researchers call this the “lost in the middle” problem. If you bury your most important rule — “never discuss competitor products” or “always recommend the student contact [email protected]” — in paragraph four of an eight-paragraph system prompt, there’s a real chance the agent will treat it as background noise.
Think of it like a lesson plan. If your most important learning outcome is listed halfway down the page, your students might miss it. You’d put it front and center. Same principle applies to how you write instructions for an AI agent.
A Structure That Works
A well-structured context document follows a clear order. Lead with your identity statement — who this agent is and what it does. Follow immediately with the single most important constraint — what the agent must never do or always do. Then add supporting context: your audience, your tone, your topic boundaries. Close with a brief restatement of the top priority and any formatting rules.
For a campus community agent built on Claude or ChatGPT, that structure might look like: “You are a learning assistant for [Your School Name]. You only answer questions about [your course topic]. Always respond in a warm, encouraging tone. Never provide legal, medical, or financial advice. Your audience is adult learners building online education businesses. When in doubt, recommend the student post in the community for peer support.” Short. Ordered. Front-loaded with what matters most.
If you need to include reference documents — like a course syllabus or FAQ — put them after your core instructions, not before. The agent needs to see the rules before it sees the content it will be working with.
What This Means for Educators
When you’re setting up an AI agent for your course community or coaching program, treat the context structure like a briefing document for a new team member. The most important rules go at the top. Everything else supports those rules. If something has gone wrong with your agent’s behavior — it’s going off-topic, using the wrong tone, missing key guardrails — the fix is usually to move that instruction higher in the document, not to add more text.
The Bottom Line
Good context structure is about placement, not just content. Lead with your non-negotiables, follow with supporting detail, and reinforce key rules at the end. A focused 200-word system prompt in the right order will outperform a sprawling 1,000-word one every time.
