How guidelines work
Every user message or tool result triggers a two-phase process: Phase 1 — Selection (limited context) The agent runs a separate LLM call to evaluate which guidelines apply to the current conversation. At this stage, the LLM only has access to:- Conversation history (last 20 messages)
- The configured guideline conditions
Guidelines are re-evaluated before every user message and before every tool result. They are not re-evaluated after the agent’s own responses.
Performance cost
Because guidelines add a dedicated LLM call at every turn, they have a measurable impact on latency and cost:
Why latency can spike: When a guideline condition references something Phase 1 cannot see (a tool name, a context variable, an instruction), the LLM has no reliable grounding signal. It compensates by expanding its reasoning — generating hypotheses, exploring possibilities, and attempting to resolve ambiguity — resulting in longer, less efficient reasoning traces.
Example with 5 user messages and 3 tool calls:
- 8 LLM calls for guideline matching
- 8 LLM calls for agent reasoning
- 16 total LLM calls vs. 8 without guidelines
The decision fragmentation risk
Guidelines create a two-phase decision pipeline that can introduce mismatches between classification and reasoning:- User says: “I need this done ASAP”
- Phase 1 matches the “urgent” guideline
- Phase 2 sees the full context and determines this is a routine documentation request
- Result: mismatched priority handling and wasted resources
When to use guidelines
Guidelines are most reliable when the condition is directly observable in the conversation text — no system knowledge required, no inference needed. Good use cases:
Poor use cases:
Do’s and don’ts
✅ Do: Use for off-topic guardrails
✅ Do: Use for off-topic guardrails
✅ Do: Use for explicit urgency detection
✅ Do: Use for explicit urgency detection
❌ Don't: Use for routing logic
❌ Don't: Use for routing logic
❌ Don't: Use for tool-based conditions
❌ Don't: Use for tool-based conditions
❌ Don't: Use for context variable conditions
❌ Don't: Use for context variable conditions
❌ Don't: Use for complex multi-step sequences
❌ Don't: Use for complex multi-step sequences
Guidelines vs. instructions
Both instructions and guidelines influence agent behavior, but they operate differently:
Rule of thumb: If the behavior is constant and does not depend on what was just said in the conversation, put it in instructions. Guidelines are for behavior that genuinely needs to activate or deactivate based on observable conversation signals.
Checklist before adding a guideline
Before adding a new guideline, verify:- The condition is directly observable in conversation text — no tool, variable, or instruction knowledge required
- The benefit of the dynamic behavior clearly justifies the ~40% LLM call overhead
- The behavior truly needs to be conditional (not just always-on instructions)
- The risk of a Phase 1 classification error and its downstream impact is acceptable
- You have ruled out fixing the underlying issue in instructions or collaborator definitions instead

