# Openclaw 0166 Counterfactual Replay

> Governance Counterfactual Simulator. Use when work requires counterfactual replay for Safety and Governance with guardrails, traceable execution, and measurable outcomes.

- Skill: `zwright8/openclaw-0166-counterfactual-replay` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add zwright8/openclaw-0166-counterfactual-replay`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zwright8/openclaw-0166-counterfactual-replay/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zwright8 (https://skillmd.com/u/zwright8)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/zwright8/openclaw-0166-counterfactual-replay

---


# Governance Counterfactual Simulator

## Mission
We need this skill because high-speed autonomy needs enforceable guardrails to stay aligned. This specific skill tests alternatives before costly commitments.

## Activation Cues
- Task requires counterfactual replay in Safety and Governance.
- Task needs explicit risk controls, approval gates, and traceable outcomes.
- Task output must include artifact handoff for humans and agents.

## Execution Plan
1. Define the scope and success metrics for `Governance Counterfactual Simulator`, including at least three measurable KPIs tied to unsafe actions and policy drift.
2. Design and version the input/output contract for policies, violations, and mitigation actions, then add schema validation and failure-mode handling.
3. Implement the core capability using counterfactual replay, and produce scenario comparison reports with deterministic scoring.
4. Integrate the skill into swarm orchestration: task routing, approval gates, retry strategy, and rollback controls.
5. Add unit, integration, and simulation tests that explicitly cover unsafe actions and policy drift, then run regression baselines.
6. Deploy behind a feature flag, monitor telemetry/alerts for two release cycles, and iterate thresholds based on observed outcomes.

## Runbook
Preflight:
- None specified.

Execution:
- None specified.

Recovery:
- None specified.

Handoff:
- None specified.

## Guardrails
- [quality] Require validations before promoting outputs.

## Success Metrics
- Primary metric: unsafe actions
- Secondary metrics: policy drift, decision drift
- Review cadence: weekly

## Output Contract
- Return a concise execution summary with key decisions.
- Return risk and mitigation notes with unresolved blockers.
- Return artifact target: `scenario comparison reports`.
- Return recommended follow-up tasks for next wave execution.

