Agent Script Pattern: Avoid Conflicting Instructions with Instruction Overrides

Override system-level instructions (or "agent-level" instructions in the UI) within specific topics to change the agent's behavior and persona dynamically.

By default, all topics inherit the agent-level system.instructions. When you add a system block to a specific topic, those instructions override the system ones for that topic only.

If your agent-level system instructions contradict topic-level reasoning instructions, your agent can hang or behave unexpectedly. System overrides solve this by explicitly replacing system instructions when needed.

Also, system overrides let a single agent adopt different personalities, tones, or behaviors in different contexts—useful when you need the agent to act differently in specific topics while maintaining consistent behavior elsewhere.

Pattern Example: An event planner agent normally avoids suggesting alcohol, but for an adult-only party topic, override the system instructions to allow cocktail recommendations.

Agent Script follows this hierarchy when determining which system instructions to use:

  1. Topic-level system instructions (highest priority) - If a topic has a system block, the agent uses those instructions
  2. Agent-level system instructions (fallback) - If a topic has no system block, the agent uses the global instructions

When agent-level system instructions contradict topic-level reasoning instructions, the agent must resolve the conflict, which can cause unexpected behavior.

Problem: An event planning agent has global instructions "Never suggest alcoholic beverages at a children's party" but a topic for a children's party with adults wants to suggest champagne in its reasoning instructions.

Solution: Use a system override to explicitly replace the system instructions for that specific topic.

Create different personas for different contexts.

Use overrides when:

  • Resolving instruction conflicts. When agent-level system instructions contradict what a specific topic needs to do. Conflicting instructions can cause unexpected behavior in agents.
  • Different topics need different tones. A casual FAQ topic vs. a formal compliance topic. Technical experts vs. non-technical users. Casual tone vs. professional and apologetic tone. A billing specialist vs. a technical support specialist.