[Advanced] Dynamic Behaviors Guide
Feature: Override Flag Mechanism
Each dynamic behavior can have an optional override flag that determines how it integrates with existing context
When the override flag is ON:
All other context (guidelines, boundary constraints, etc.) are removed from the context
Only the agent identity, background, and global guidelines remain active
The agent's behavior scope is reduced strictly to that defined by the selected dynamic behavior
This is problem space displacement - completely replacing the existing problem topology rather than merging with it
Used primarily for safety-critical or compliance-mandated behaviors where merging could create conflicts
When the override flag is OFF (default):
The dynamic behavior gets merged into the existing problem topology
This creates a combined problem space that incorporates both the original context and the dynamic behavior
Behavior strength can vary from mandatory integration to optional recommendations
This approach preserves conversation continuity while enriching the agent's capabilities
Implementation Best Practices
Design Along the Instruction Flexibility Spectrum
Instructions can range widely in their prescriptiveness:
Open-Ended Guidance
Allows significant agent discretion
Provides general direction without strict requirements
Creates a knowledge-enriched environment for the agent
Best for creative, exploratory, or coaching conversations
Example: "You have access to these nutrition resources. Consider their relevance to the user's goals."
Structured Protocols
Provides clear, specific guidelines
Balances direction with some contextual adaptation
Ensures consistency while allowing natural conversation
Example: "When discussing exercise plans, ask about previous injury history before making recommendations."
Strict Instructions
Enforces precise behavior patterns
Minimizes agent discretion for safety-critical scenarios
Essential for regulatory compliance or high-risk situations
Example: "If the user mentions suicidal thoughts, immediately provide crisis resources and follow safety protocol X."
Separate Redlining from Product Experience
Split your dynamic behaviors into two categories:
Redlining (Safety/Compliance)
Purpose: Protect against medical emergencies, legal issues, or user harm
Trigger Design: Exact patterns that must be detected
Instructions: Can be more directive and specific
Testing: Subject to unit tests that must pass for every release
Example: Suicide prevention protocol, legal disclaimers
Product Experience
Purpose: Enhance user experience, provide relevant content
Trigger Design: Broader thematic matches (e.g., "exercise", "protein", "recipes")
Instructions: Provide options rather than mandates (e.g., "You have access to these resources, surface them if relevant")
Testing: Measured via metrics and user experience evaluation
Example: Suggesting relevant meal plans when user discusses nutrition
Using the Override Flag Strategically
The override flag creates a distinct separation between "hardline" and "softline" behaviors:
Hardline Behaviors (Override Flag ON)
Used for critical situations where safety, legal compliance, or harm prevention takes absolute priority
Completely replaces normal agent behavior with a highly restricted protocol
Prevents potential conflicts between existing context and critical response requirements
Ensures consistent, unambiguous handling of high-risk scenarios
Examples of implementation bins:
Harmful Content Prevention: For requests to build weapons, create harmful content, etc. - implement legal disclaimers and use predetermined, repetitive language to refuse engagement (robotic, clear warnings)
Crisis Intervention: For suicide tendencies or self-harm - focus exclusively on mental health support, refuse to engage on other topics, provide crisis resources with specific emergency numbers
Legal Compliance: For regulated topics requiring specific disclaimers - deliver mandatory language verbatim without modification or contextual adaptation
Security Violations: For attempts to bypass security measures - implement strict refusal protocols with minimal variation
Softline Behaviors (Override Flag OFF)
Used for context enrichment, recommendations, or enhancing user experience
Merges with existing problem topology for seamless conversation integration
Can vary in implementation strength based on conversational relevance
Preserves natural conversation flow while adding value
Examples of implementation bins:
Knowledge Enhancement: For specific topics (e.g., discussions about a particular drug) - must integrate relevant information naturally but intelligently within the existing conversation
Resource Recommendation: For general topics (e.g., workouts, nutrition) - optionally integrate curated high-quality resources when contextually appropriate
Experience Improvement: For general user experience - provide additional capabilities or insights that enhance the conversation without disrupting its flow
Contextual Guidance: For specialized domains - offer domain-specific frameworks that guide reasoning without restricting conversational scope
Dynamic Behavior Spectrum and Practical Binning
When building agents, determining which type of dynamic behavior to implement requires careful consideration. The following spectrum provides a practical framework for categorizing behaviors:
Binning Criteria for Practical Agent Building
When determining which bin a dynamic behavior belongs in, evaluate against these practical criteria:
1. Risk Assessment
High Risk (Hardline - Verbatim/Restricted): Potential for harm, legal liability, or serious negative outcomes
Example: Suicidal ideation, requests for dangerous content, regulatory violations
Medium Risk (Strong Integration): Sensitive topics requiring careful handling but not immediate danger
Example: Health advice, financial guidance, personal data discussions
Low Risk (Moderate/Optional): General informational or enhancement topics
Example: Workout recommendations, recipe suggestions, productivity tips
2. Content Determinism
High Determinism Required (Hardline): Legal text, disclaimers, specific crisis resources that must be delivered exactly as written
Medium Determinism (Strong Integration): Factual information that must be included but can be contextualized
Low Determinism (Optional): Suggestions, recommendations, or optional content
3. Context Compatibility
Incompatible (Hardline): Topics that fundamentally conflict with existing conversation context
Example: Crisis intervention during a product support conversation
Partially Compatible (Strong/Moderate): Topics that can be integrated but require significant adaptation
Example: Drug information during a fitness conversation
Highly Compatible (Optional): Topics that naturally complement existing context
Example: Recipe suggestions during a nutrition conversation
4. Response Urgency
Immediate Action Required (Hardline): Crisis situations requiring instant protocol activation
Example: Self-harm indications requiring immediate resource provision
Timely Response (Strong Integration): Important but not urgent information
Example: Medication side effects that should be mentioned promptly
Non-time-sensitive (Optional): Helpful but not urgent information
Example: General health tips that could be mentioned when contextually relevant
Decision Framework for Practical Implementation
When implementing dynamic behaviors in agent systems, use this decision tree:
Is this a safety or legal compliance issue?
Yes → Likely requires Hardline (Override ON) approach
No → Continue evaluation
Would mixing this behavior with existing context create confusion or dilute critical information?
Yes → Consider Hardline approach
No → Continue evaluation
How critical is the exact delivery of specific information or language?
Critical (verbatim required) → Hardline - Verbatim Refusal
Important but adaptable → Hardline - Restricted Scope or Strong Integration
Flexible → Moderate or Optional Integration
What is the primary goal of this behavior?
Protect users/prevent harm → Hardline
Deliver critical information → Strong Integration
Enhance conversation quality → Moderate or Optional Integration
By systematically evaluating each behavior against these criteria, agent builders can implement a balanced system that appropriately handles both critical safety requirements and general user experience enhancements.
Measurement Approaches
For Redlining
Implement unit tests
Every critical safety case must be tested and pass before release
100% compliance expected
For Product Experience
Develop metrics that focus on:
Is content being served appropriately?
Is content relevant to the conversation?
Is content repetitive?
Overall user experience quality
Monitor trends over time (e.g., 30-day metrics)
Audit samples where expected behaviors didn't trigger
Focus on anomaly detection rather than expecting 100% triggering
Example Implementation
Poor Implementation (Too Rigid)
Better Implementation (Natural)
Hardline Implementation (Override Flag ON)
Softline Implementation (Override Flag OFF)
Agent Autonomy Spectrum
The design of triggers and instructions directly impacts agent autonomy:
High Autonomy Configuration
Uses vaguer triggers combined with open context
Grants the agent greater freedom to determine behavior based on user model and interaction context
Functions like an associative knowledge cluster available to the agent
Agent can selectively draw from this knowledge as the conversation evolves
Best for creative coaching, exploratory discussions, and personalized experiences
Limited Autonomy Configuration
Uses stricter triggers paired with precise instructions
Effectively simulates protocol overrides in critical situations
Limits agent discretion and enforces specific response patterns
Necessary for regulated industries, safety-critical information, and compliance requirements
Strategic Implementation with Override Flag
The override flag provides a powerful tool for creating strategic transitions across the autonomy spectrum
Hardline behaviors (override ON) represent the most restricted autonomy state
Create complete context replacement for safety-critical scenarios
Force the agent into highly constrained response patterns
Ensure compliance with regulatory requirements or safety protocols
Softline behaviors (override OFF) allow for graduated autonomy restrictions
Maintain conversation continuity while introducing guidance or enrichment
Preserve agent identity and natural conversational abilities
Allow for contextual adaptation while adding value
Most effective systems implement a hierarchy of behaviors:
Critical safety issues use hardline behaviors with override ON
Domain-specific guidance uses softline behaviors with strong integration requirements
General experience enhancement uses softline behaviors with optional integration
Common Pitfalls
Over-engineering: Creating overly specific triggers that rarely match
Robotic responses: Making behaviors too directive, leading to unnatural interactions
Expecting 100% triggering: Product enhancements should be contextual, not forced
Mixed responsibilities: Having the same team design both safety and product behaviors
Inconsistent testing: Using the wrong evaluation approach for different behavior types
Misunderstanding behavior integration: Expecting behaviors to be rigidly enacted rather than merged with the context graph state
Ignoring the selection process: Not accounting for the three options (re-select previous behavior, select new behavior, select nothing) and the persistence mechanism in behavior design
Overusing the override flag: Applying hardline behaviors with the override flag ON for non-critical situations, disrupting conversation flow unnecessarily
Conflicting behavior priorities: Failing to establish clear precedence rules when multiple behaviors could trigger simultaneously
Context whiplash: Frequently switching between hardline (override ON) and softline behaviors, creating a disjointed user experience
Neglecting flag state persistence: Not considering how override state affects behavior re-sampling and persistence across conversation turns
Last updated
Was this helpful?