Boolean Responses

Boolean responses provide the simplest form of human decision-making: true or false, yes or no, approve or reject. With customizable labels and colors, they’re perfect for binary decisions that don’t require complex analysis or multiple options.

When to Use Boolean Responses

Boolean responses are ideal for:

Simple Approvals

Basic approve/reject workflows, go/no-go decisions, or binary authorization processes

Binary Classification

Categorizing content as compliant/non-compliant, safe/unsafe, or valid/invalid

Feature Flags

Enabling or disabling features, settings, or capabilities based on human judgment

Quick Verification

Fast verification tasks where detailed analysis isn’t needed, just confirmation or denial

Configuration Options

Boolean responses support custom labeling and visual styling for both true and false states:

Optional Parameters

true_label
string
default:"True"
Display text for the true/yes option (max 100 characters)
false_label
string
default:"False"
Display text for the false/no option (max 100 characters)
true_color
string
default:"#16a34a"
Hex color code for the true option visual styling
false_color
string
default:"#dc2626"
Hex color code for the false option visual styling
required
boolean
default:"false"
Whether a decision is mandatory for completion

Implementation Examples

Content Approval Workflow

Simple approve/reject decision for content moderation:
request_data = {
    "processing_type": "time-sensitive",
    "type": "markdown",
    "priority": "high",
    "request_text": "Does this user-generated post comply with our community guidelines?\n\n**Post Content:**\n'Just finished reading an amazing book on productivity! \"Getting Things Done\" by David Allen completely changed how I organize my work. The key insight for me was the two-minute rule - if something takes less than two minutes, just do it immediately instead of adding it to your todo list. Has anyone else read this? What productivity methods work best for you?'\n\n**Community Guidelines Check:**\n- No spam or promotional content ✓\n- Respectful tone ✓  \n- Relevant to community topic ✓\n- No personal attacks ✓\n- Encourages discussion ✓",
    "response_type": "boolean",
    "response_config": {
        "true_label": "✅ Approve Post",
        "false_label": "❌ Reject Post", 
        "true_color": "#16a34a",
        "false_color": "#dc2626",
        "required": True
    },
    "default_response": False,  # Conservative default - reject if timeout
    "timeout_seconds": 1800,  # 30 minutes
    "platform": "api"
}

Security Threat Assessment

Binary risk evaluation for security incidents:
# Security threat classification
request_data = {
    "processing_type": "time-sensitive",
    "type": "markdown",
    "priority": "critical",
    "request_text": "Is this network activity indicative of a security threat requiring immediate response?\n\n**Alert Details:**\n- Source IP: 203.0.113.45 (Known malicious IP from threat feed)\n- Target: Internal server 10.0.1.15 (Database server)\n- Activity: Multiple SSH brute force attempts\n- Timeline: 200+ failed attempts in last 10 minutes\n- User accounts targeted: admin, root, postgres, backup\n\n**Context:**\n- Database contains customer PII and financial data\n- Server has internet-facing SSH (port 22) enabled\n- No legitimate admin access expected at this time\n- Similar pattern matches APT campaign signatures",
    "response_type": "boolean",
    "response_config": {
        "true_label": "🚨 SECURITY THREAT - Immediate Response",
        "false_label": "ℹ️ False Positive - Monitor Only",
        "true_color": "#dc2626",
        "false_color": "#059669", 
        "required": True
    },
    "default_response": True,  # Conservative default - treat as threat
    "timeout_seconds": 600,  # 10 minutes - urgent response needed
    "platform": "api"
}

Feature Release Decision

Go/no-go decision for feature deployment:
# Feature release approval
request_data = {
    "processing_type": "deferred",
    "type": "markdown", 
    "priority": "medium",
    "request_text": "Should we proceed with the scheduled release of the new user dashboard feature?\n\n**Release Readiness Check:**\n\n**✅ Completed Items:**\n- All unit tests passing (247/247)\n- Integration tests successful\n- Security audit completed with no critical findings\n- Performance testing shows 15% improvement in load times\n- Documentation updated\n- Support team training completed\n\n**⚠️ Outstanding Items:**\n- 2 minor UI bugs in Safari (non-blocking)\n- Analytics tracking for new features (nice-to-have)\n- A/B testing framework integration (planned for next sprint)\n\n**Risk Assessment:**\n- Low risk deployment\n- Rollback plan tested and ready\n- Feature flags enabled for gradual rollout\n- Customer support prepared for potential issues",
    "response_type": "boolean",
    "response_config": {
        "true_label": "🚀 GO - Proceed with Release",
        "false_label": "⏸️ NO-GO - Delay Release",
        "true_color": "#16a34a",
        "false_color": "#f59e0b",
        "required": True
    },
    "default_response": False,  # Conservative - don't release without explicit approval
    "timeout_seconds": 86400,  # 24 hours
    "platform": "api"
}

Response Format

When a reviewer makes a boolean decision, you’ll receive both the boolean value and associated label:
{
  "response_data": {
    "boolean": true,
    "boolean_label": "✅ Approve Post"
  }
}

Use Case Examples

1. Content Moderation

content_moderation_config = {
    "response_type": "boolean",
    "response_config": {
        "true_label": "✅ Content Approved",
        "false_label": "❌ Content Rejected",
        "true_color": "#16a34a",
        "false_color": "#dc2626",
        "required": True
    }
}

2. Financial Transaction Verification

transaction_verification_config = {
    "response_type": "boolean",
    "response_config": {
        "true_label": "💳 Approve Transaction",
        "false_label": "🛡️ Block Transaction",
        "true_color": "#059669",
        "false_color": "#dc2626",
        "required": True
    }
}

3. System Health Monitoring

system_health_config = {
    "response_type": "boolean",
    "response_config": {
        "true_label": "🟢 System Healthy - Continue Operation",
        "false_label": "🔴 System Issue - Investigate Required",
        "true_color": "#16a34a", 
        "false_color": "#dc2626",
        "required": True
    }
}

Validation and Error Handling

Automatic Validation

The mobile app automatically validates boolean responses:
  • Type validation: Ensures response is exactly true or false
  • Required validation: Prevents submission when required=true and no selection made
  • Null prevention: Blocks null, undefined, or empty responses

Server-Side Validation

Your application should validate received boolean responses:
def validate_boolean_response(response_data, response_config):
    """Validate boolean response against configuration"""
    
    if not isinstance(response_data, dict):
        return False, "Response must be an object"
    
    if "boolean" not in response_data:
        return False, "Missing boolean field"
    
    boolean_value = response_data["boolean"]
    
    # Validate boolean type  
    if not isinstance(boolean_value, bool):
        return False, "Value must be true or false"
    
    # Check required
    if response_config.get("required", False) and boolean_value is None:
        return False, "Boolean decision is required"
    
    # Validate associated label exists
    if "boolean_label" not in response_data:
        return False, "Missing boolean_label field"
    
    return True, "Valid"

# Usage example
is_valid, error_message = validate_boolean_response(
    response_data={
        "boolean": True,
        "boolean_label": "✅ Approve Post"
    },
    response_config={
        "required": True
    }
)

Best Practices

Label Design

Processing Best Practices

Common Patterns

Progressive Decision Making

# Use boolean responses in sequence for complex workflows
def create_progressive_approval_workflow(content_id):
    """Create multi-stage boolean approval process"""
    
    # Stage 1: Initial safety check
    safety_check = create_boolean_request(
        loop_id="safety_team",
        request_text=f"Is content {content_id} safe for general audiences?",
        true_label="✅ Content is Safe",
        false_label="⚠️ Content Needs Review"
    )
    
    # Stage 2: Quality assessment (only if safety approved)
    if safety_check["response"]["boolean"]:
        quality_check = create_boolean_request(
            loop_id="quality_team", 
            request_text=f"Does content {content_id} meet quality standards?",
            true_label="⭐ High Quality",
            false_label="📝 Needs Improvement"
        )
        
        # Stage 3: Final publication decision
        if quality_check["response"]["boolean"]:
            final_approval = create_boolean_request(
                loop_id="editorial_team",
                request_text=f"Approve content {content_id} for publication?",
                true_label="🚀 Publish Now",
                false_label="📅 Schedule for Later"
            )

Consensus Building

# Multiple boolean responses for consensus decisions
def build_consensus_decision(request_text, reviewer_count=3):
    """Create multiple boolean requests for consensus building"""
    
    requests = []
    for i in range(reviewer_count):
        request = create_boolean_request(
            loop_id="consensus_loop",
            request_text=request_text,
            true_label="👍 Approve",
            false_label="👎 Reject"
        )
        requests.append(request)
    
    # Wait for all responses
    responses = wait_for_all_responses(requests)
    
    # Calculate consensus
    approvals = sum(1 for r in responses if r["response"]["boolean"])
    consensus_threshold = len(responses) // 2 + 1  # Majority
    
    return {
        "decision": approvals >= consensus_threshold,
        "approval_count": approvals,
        "total_reviewers": len(responses),
        "consensus_strength": approvals / len(responses)
    }

A/B Testing Integration

# Use boolean responses to evaluate A/B test results
def evaluate_ab_test_results(test_id, variant_a_metrics, variant_b_metrics):
    """Human evaluation of A/B test statistical significance"""
    
    request_text = f"""
    Based on these A/B test results, should we proceed with Variant B?
    
    **Test Duration:** 14 days
    **Sample Size:** {variant_a_metrics['users']} vs {variant_b_metrics['users']} users
    
    **Variant A (Control):**
    - Conversion Rate: {variant_a_metrics['conversion_rate']:.2%}
    - Revenue per User: ${variant_a_metrics['revenue_per_user']:.2f}
    - User Satisfaction: {variant_a_metrics['satisfaction']:.1f}/10
    
    **Variant B (Test):**
    - Conversion Rate: {variant_b_metrics['conversion_rate']:.2%}
    - Revenue per User: ${variant_b_metrics['revenue_per_user']:.2f}
    - User Satisfaction: {variant_b_metrics['satisfaction']:.1f}/10
    
    **Statistical Significance:** {calculate_statistical_significance(variant_a_metrics, variant_b_metrics)}
    """
    
    return create_boolean_request(
        loop_id="data_science_team",
        request_text=request_text,
        true_label="📊 Deploy Variant B",
        false_label="🔄 Keep Current Version"
    )

Next Steps