You start with a clean system prompt. A few lines. Role, mission, safety rules. It works. Then someone adds refund rules. Escalation procedures. SQL safety constraints. Formatting requirements for three different output channels. Compliance notes for two jurisdictions. Edge-case handling for that one weird customer segment.

Six months later, your system prompt is a thousand-line monstrosity. It costs a fortune on every step. The model half-follows it. You can't test individual rules in isolation. Updating the refund procedure means editing the same file that contains everything else.

Bechir Trabelsi ran into exactly this problem building LangGraph-style agents. His solution: lazy-loaded procedural policy. It's the most practical agent architecture pattern I've seen this year.

The Core Idea

Split your policy into two layers.

The system prompt holds the constitution. Core role. Mission. Non-negotiable safety rules. High-level operating principles. These never change based on scenario.

Scenario-specific rules live in tools. getrefundrules(), getescalationrules(), getsqlsafety_rules(). The agent calls these only when it recognizes the relevant scenario.

You stop treating the system prompt as the one place all policy must live. The system prompt owns invariants. Tools own conditionals.

Why Context Size Is a Real Cost

Long-lived agents re-ingest their entire context on every step. The costs compound fast.

A monolithic agent pays full context cost every step. Even when 90% of its instructions are irrelevant to the current action. A lazy-loaded agent runs on a fraction of the context. When a scenario fires, it loads one rule set. A brief spike. Then it returns to the lean baseline.

This is not just about token cost. When the model loads only instructions relevant to the current situation, it actually uses them. Attention is finite. Dilute it across dozens of policies, and compliance degrades.

Recent work on Instruction-Tool Retrieval makes this explicit. It proposes retrieving only the minimum instruction fragments and smallest necessary tool subset at each step. Anthropic frames the broader challenge as context engineering. Not just writing a clever prompt. Actively curating which instructions, state, and tools the model sees at each moment.

What Goes Where

Base policy (system prompt):

  • Role and mission
  • Security and safety constraints
  • Global tool-use boundaries
  • Non-negotiable behavior across all scenarios

Lazy-loaded rules (tool functions):

  • Exception handling
  • Domain-specific workflows
  • Escalation procedures
  • Evidence requirements
  • Formatting requirements for specialized cases
  • Task-specific guardrails

The separation forces you to be explicit. What is truly invariant? What is merely conditional? If you can't answer that question, you don't understand your own policy.

Four Things This Buys You

Less prompt bloat. The base prompt stays small and stable. Rare instructions don't cost tokens on every step.

Modularity. Each rule set becomes its own unit. Version it. Evaluate it. Test it. Change it independently. Updating a refund procedure no longer means editing a thousand-line prompt that also contains unrelated policies.

Better attention allocation. The model loads relevant instructions for the current situation. The chance it actually uses them goes up. Buried rules get buried for a reason.

Cleaner architecture. You start reasoning in layers. Base policy. Routing. Procedural rules. Validation. State. This is a policy-loading design, not a prompt trick.

This Pattern Already Exists in Production

OpenAI's Codex Skills use progressive disclosure. The system starts with lightweight metadata for each skill. It loads the full SKILL.md instructions only when it decides to use that skill. Instructions are not injected upfront. They load on demand.

Google's Maps MCP toolkit includes a retrieve-instructions tool. Its explicit purpose is to provide system instructions before certain other tools are used. That is a production example of instructions as retrievable runtime context, not static prompt text.

The Logic Agent paper describes encapsulating logic rules as callable functions for LLM agents. Same core move. Don't force all reasoning guidance to live as passive text in one giant prompt.

The Trade-Off: Recognition Risk

Moving scenario-specific rules out of the always-on prompt introduces a new failure mode. The agent may fail to realize it should load them.

A monolithic prompt suffers from overload. A lazy-loaded architecture suffers from recognition risk.

The key question: is scenario detection reliable enough for your domain? For low-stakes use cases, letting the agent self-detect works. For high-stakes systems, self-awareness alone is not enough.

Three Ways to Harden It

Return structured rules, not prose blobs. Have rule tools return structured fields with named keys. Applicability conditions. Prerequisites. Must-do and must-not-do lists. Required evidence. Escalation triggers. Structured payloads are easier for the model to apply consistently. It doesn't have to parse a paragraph. It has named fields to check against.

Persist loaded rules in graph state. Once a playbook loads, store it in the graph state. Later nodes don't need to rediscover or reload it. In LangGraph, add a loaded_policies key to your state schema. Write to it the first time a rule is fetched.

Add a router and a validator. A router classifies the input and suggests or force-loads likely rule sets before the main reasoning loop begins. It doesn't rely on the agent's in-flight self-awareness. A validator inspects the final answer and asks: given this request, were any required rule sets not consulted? Silent misses are the most dangerous failure mode. The validator catches them.

The full hardened architecture: router at the front, validator at the back, lazy-loaded procedural policy in the middle. This is a much more robust design than "just write a better prompt."

Where This Fits

Lazy-loaded procedural policy sits at the intersection of several existing ideas. Instruction-Tool Retrieval minimizes instruction fragments per step. Dynamic tool exposure serves only relevant tools. Progressive disclosure loads metadata-first. Rules-as-tools packages callable logic modules.

Lazy-loaded procedural policy is specifically about who owns policy in an agentic system. The system prompt owns invariants. Tools own conditionals.

The Shortest Version

Your system prompt is bloated because it tries to cover every scenario. Move the rules into tools the agent calls when needed. Smaller prompts. Lower cost. Same coverage. Better compliance.

A lot of agent engineering still treats prompting as fundamentally about wording. Once your system has tools, state, routing, retries, validators, and long-lived execution, the important question shifts. It's no longer "what is the best prompt?" It becomes "what is the best context assembly strategy?"

Lazy-loaded procedural policy is one answer.


Suggested title: Your System Prompt Is a Landfill. Here's How to Fix It.

Word count: 897

Citations:

  • Bechir Trabelsi, "Stop Bloated Agent Prompts: A Pattern I Call Lazy-Loaded Procedural Policy," Medium, April 15, 2026: https://medium.com/@bechirtr97/stop-bloated-agent-prompts-a-pattern-i-call-lazy-loaded-procedural-policy-b6ade44dd1aa
  • Instruction-Tool Retrieval / Dynamic System Instructions and Tool Exposure for Efficient Agentic LLMs (arXiv): referenced in Trabelsi's article
  • Anthropic on effective context engineering for AI agents: referenced in Trabelsi's article
  • OpenAI Codex Skills progressive disclosure: referenced in Trabelsi's article
  • Google Maps MCP retrieve-instructions pattern: referenced in Trabelsi's article
  • Logic Agent and callable logic-rule tools (arXiv): referenced in Trabelsi's article

Fact-check notes:

  • The Trabelsi article URL and publication date confirmed via web search. The article content was fetched and verified.
  • The Codex Skills, Google Maps MCP, and Logic Agent references come from Trabelsi's article. I did not independently verify each external reference. The Trabelsi article attributes them but does not provide direct URLs. Worth spot-checking before publication.
  • The ITR and Anthropic context engineering references are also from Trabelsi's article. Independent verification recommended.
  • The pattern name "lazy-loaded procedural policy" is Trabelsi's coinage. Confirmed from the source.