Governance & Review

Set up human-in-the-loop workflows and governance policies

Overview

Governance in TuringPulse provides a framework for human oversight of AI agent outputs. Create review queues, define approval workflows, and maintain audit trails for compliance.

Review Queue

The Review Queue collects agent outputs that require human review based on your policies. Reviewers can approve, reject, or correct outputs.

  • Approve - Output is acceptable, release to user
  • Reject - Output is not acceptable, block or retry
  • Correct - Modify output before releasing

Creating Review Policies

# In the TuringPulse UI:
# 1. Go to Governance > Policies
# 2. Click "Create Policy"
# 3. Define conditions:

# Example conditions:
- Cost > $1.00 per run
- Confidence Score < 80%
- Contains keyword "legal" or "medical"
- Random sample (10%)

# 4. Set action: "Queue for Review"
# 5. Assign to reviewer group

SDK Integration

from turingpulse_sdk import instrument, GovernanceDirective

@instrument(
    name="high-risk-workflow",
    governance=GovernanceDirective(
        hitl=True,
        reviewers=["compliance@company.com"],
        escalation_channels=["slack://compliance-alerts"],
        auto_escalate_after_seconds=3600,
        severity="high",
    )
)
def high_risk_agent(query: str):
    return process(query)

Audit Trail

All governance actions are logged with full audit trails:

  • Who reviewed the output
  • What decision was made
  • When the decision was made
  • Any corrections applied
  • Original vs. corrected output
💡
Compliance Ready
Export audit logs for compliance reporting. TuringPulse maintains complete records for SOC2, HIPAA, and other compliance frameworks.

Feedback Loop

Corrections made during review can be exported for model fine-tuning:

# Export corrections as JSONL for training
# Go to Governance > Insights > Export JSONL

# Format:
{"input": "...", "original_output": "...", "corrected_output": "..."}
{"input": "...", "original_output": "...", "corrected_output": "..."}

Best Practices

  • Start with sampling review (10%) to understand output quality
  • Define clear review criteria for your team
  • Set SLAs for review completion
  • Use corrections for continuous improvement
  • Regularly analyze rejection patterns