Explainable Controls Kit

Controls that show WHY they work and WHAT will happen before execution.

0/4 executed

Configuration

Control Explanations
Scale up workers: 4 → 892% transparent
Why: Queue depth exceeded threshold (250 > 100)
Effect: Latency -40%, Cost +$12/hr
Enable circuit breaker for API-B88% transparent
Why: Error rate 15% (threshold: 5%)
Effect: Failures redirected to fallback
Throttle write operations 50%95% transparent
Why: Database CPU at 92%
Effect: Write latency +200ms for 10min
Drain connection pool85% transparent
Why: Memory pressure detected
Effect: New connections: cold start delay

Integration Code

import { createExplainableControls } from 'agent-tools-kit/human-command'

const controls = createExplainableControls({
  detail: 'full',
  previewEffects: true,
  transparencyThreshold: 0.8,
})

// Get explanation for a control action
const explanation = await controls.explain({
  action: 'scale-up',
  target: 'worker-pool',
  delta: +4,
})

console.log(explanation.reason)      // Why this action?
console.log(explanation.effect)      // What will happen?
console.log(explanation.confidence)  // How sure are we?

// Preview before execution
const preview = await controls.preview(explanation)
console.log(preview.impact)          // Predicted system impact
console.log(preview.alternatives)    // Other options considered