cortex_run_counterfactual
Run a counterfactual evaluation to estimate what might have happened under a hypothetical change, returning a hypothesis with assumptions, evidence references, and confidence.
Instructions
Convenience wrapper around cortex_run_job for job_kind="counterfactual_eval": estimates what MIGHT have happened under a hypothetical change. Result is a HYPOTHESIS, not fact — it carries assumptions, evidence_refs, confidence, and uncertainty. question is required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | JSON object of execution options. Keys: use_llm (boolean), create_surface_item (boolean), timeout_ms (number), dedupe_key (string). Example: {"use_llm":true,"create_surface_item":false} | |
| criteria | No | JSON object describing what the eval is optimizing for. Free-form per job_kind, but typical keys: optimize_for (string[]), constraints (string[]), pass_threshold (number 0..1). Example: {"optimize_for":["resolution_time"],"constraints":["do_not_expose_private_evidence"]} | |
| question | Yes | The what-if question. Required. Example: "What if Alice owned this escalation from the start?" | |
| input_refs | No | JSON object of evidence references the runner may use. Optional keys: run_ids (string[]), case_ids (string[]), node_ids (string[]), chunk_ids (string[]), surface_item_ids (string[]). The platform ACL-filters these before prompt construction; refs the caller cannot access are dropped or the job is denied. Example: {"run_ids":["run_1"],"case_ids":["case_123"]} | |
| project_id | Yes | ||
| target_ref | Yes | ||
| target_type | Yes | ||
| input_payload | No | JSON object for inline target data. Required when target_type="external" (the target isn't a row in our DB). Example: {"workflow_name":"refund approval","steps":[]} |