Governance Overview

Implement human oversight for your AI agents with flexible governance patterns.

Why Governance?

As AI agents become more autonomous, human oversight becomes critical for:

  • Safety - Prevent harmful or unintended actions
  • Compliance - Meet regulatory requirements
  • Quality - Ensure outputs meet standards
  • Trust - Build confidence in AI systems
  • Learning - Improve agents from human feedback

Governance Patterns

TuringPulse supports three governance patterns, each suited for different use cases:

Comparison

PatternWhenLatency ImpactUse Case
HITLBefore executionHigh (blocks)High-risk actions, financial transactions
HATLAfter executionNoneQuality audits, compliance reviews
HOTLDuring executionNone (async)Real-time monitoring, anomaly response

Quick Start

Enable Governance via SDK

agent.py
from turingpulse import instrument, GovernanceDirective

@instrument(
    agent_id="financial-advisor",
    governance=GovernanceDirective(
        # Human-in-the-Loop for high-value transactions
        hitl=True,
        hitl_condition=lambda ctx: ctx.metadata.get("amount", 0) > 10000,
        
        # Human-after-the-Loop for all transactions
        hatl=True,
        hatl_sample_rate=1.0,  # Review 100%
        
        # Reviewers
        reviewers=["compliance@company.com"],
        escalation_timeout=3600,  # Escalate after 1 hour
    )
)
def process_transaction(user_id: str, amount: float, action: str):
    return execute_transaction(user_id, amount, action)

Enable Governance via UI

  1. Go to Governance → Policies
  2. Click Create Policy
  3. Select the workflow and governance type
  4. Configure conditions and reviewers
  5. Save and enable the policy

Review Queue

All items requiring human review appear in the Review Queue:

  • HITL Pending - Actions waiting for approval
  • HATL Review - Completed actions to audit
  • HOTL Alerts - Real-time issues requiring attention

Review Actions

  • Approve - Allow the action to proceed (HITL)
  • Reject - Block the action (HITL)
  • Modify - Edit and approve with changes (HITL)
  • Flag - Mark for follow-up (HATL)
  • Acknowledge - Confirm review (HATL)
â„šī¸
Review Queue Access
Navigate to Governance → Review Queue to see all pending reviews.

Review Policies

Policies define when and how governance is applied:

Policy Configuration

OptionDescription
workflow_idApply to specific workflow or "*" for all
typehitl, hatl, or hotl
conditionWhen to trigger (always, conditional)
sample_ratePercentage of runs to review (HATL)
reviewersList of reviewer emails or groups
escalation_timeoutSeconds before escalation
auto_approve_afterAuto-approve after N seconds (HITL)

Conditional Governance

Apply governance only when certain conditions are met:

conditional.py
from turingpulse import GovernanceDirective

# Only require HITL for high-risk actions
governance = GovernanceDirective(
    hitl=True,
    hitl_condition=lambda ctx: (
        ctx.metadata.get("risk_score", 0) > 0.8 or
        ctx.metadata.get("action_type") in ["delete", "transfer"] or
        ctx.metadata.get("amount", 0) > 10000
    ),
    reviewers=["security@company.com"],
)

# Sample-based HATL review
governance = GovernanceDirective(
    hatl=True,
    hatl_sample_rate=0.1,  # Review 10% of runs
    hatl_condition=lambda ctx: (
        ctx.result.get("confidence", 1.0) < 0.7  # Always review low confidence
    ),
    reviewers=["qa@company.com"],
)

Escalation

Configure escalation for unreviewed items:

governance = GovernanceDirective(
    hitl=True,
    reviewers=["level1@company.com"],
    escalation_timeout=1800,  # 30 minutes
    escalation_reviewers=["level2@company.com", "manager@company.com"],
    escalation_channels=["pagerduty://critical"],
)
âš ī¸
HITL Timeouts
For HITL, consider setting auto_approve_after orauto_reject_after to prevent indefinite blocking.

Review Insights

Track governance metrics and reviewer performance:

  • Review Volume - Items reviewed per day/week
  • Review Time - Average time to review
  • Approval Rate - Percentage approved vs rejected
  • Escalation Rate - Percentage escalated
  • Reviewer Load - Distribution across reviewers

Next Steps