guardian_review
Sanity-check a causal claim ("cause drove effect") before acting on it.
Provide exactly one of csv (CSV text), data (list of row objects) or
dataset_id (a dataset uploaded via guardian_request_upload; use this for
more than ~200 rows; single-use, deleted when reviewed) containing columns named by
cause and effect. Returns a verdict --
pass (act), caution (act carefully), or hold (do not act; the effect
looks confounded or unsupported) -- with the naive correlational effect versus the
confounder-adjusted causal effect and its confidence interval, the confounders
adjusted for, a confidence score, a plain-English interpretation, and a
recommended action, plus the estimator used and the inferred causal DAG. All numbers
are deterministic statistics (never LLM-generated); the LLM may only choose an
estimator id from a fixed whitelist and write the interpretation prose.
Args:
cause: Treatment column the claim says drives the outcome (e.g. "ad_spend").
effect: Outcome column (e.g. "new_customers").
csv: Dataset as CSV text (header row required).
data: Dataset as a list of row records (alternative to csv).
dataset_id: ID returned by guardian_request_upload after uploading the CSV
(alternative to csv/data; for datasets above ~200 rows). Single-use:
the dataset is deleted when reviewed, so re-upload to retry.
known_confounders: Columns to adjust for; otherwise discovered automatically.
context: Free-text business context, e.g. "Q3 promo evaluation".
units: Display-only unit hints by column, e.g. {"ad_spend": "USD"}.
step: A concrete treatment step (e.g. 1000 for a $1,000 spend increase) to
restate the effect in business terms (cost per incremental outcome, ...).
time_col: Column to order rows by for time series (autocorrelation-robust
standard errors and adstock).
adstock: Opt-in geometric-adstock transform for a lagged/carryover treatment.
se: Standard-error flavor; "auto" diagnoses autocorrelation when time_col
is given.
test_design: true (or an options object) also returns how many periods a
spend-cut test needs to confirm the effect.
estimator: Primary-effect estimator. Omit (or "auto") to follow
config.estimator (default "rule": the deterministic choice); "llm" lets
the server's LLM pick from a fixed whitelist (falls back to the rule if no
LLM is configured); or force "ols_adjusted", "aipw", "ipw", "psm" or
"dml_forest" (always wins over config). The response reports the
estimator used (estimator.id, .source, .rationale, .fallback_reason)
and the inferred dag.
config: Per-step engine config, an object with optional keys cleaning,
discovery, estimator, summary, each "rule" (deterministic, no
LLM) or "llm". Defaults when omitted or partial: cleaning="llm",
discovery="llm", estimator="rule", summary="rule". The LLM never computes a
number: cleaning proposes derived columns / null-imputation strategies
(pandas computes the values), discovery prunes/orients the discovered DAG
(cause/effect are always yours), estimator picks a whitelisted id, summary
writes the prose ("rule", the default, is a fixed template that explains the
why with no AI). An "llm" step falls back to "rule" when the server has no
Gemini key or the call fails; the response's engine_steps reports
requested vs used per step with a fallback reason. Unknown keys or values
are rejected. Use all "rule" for a fully deterministic, reproducible run.
seed: Optional base random seed (default 42) for every seeded step; the seeds
used are returned in stamp.seeds.
cate: Opt-in list of dataset columns to stratify by for subgroup effects
(returned in cate); columns are validated against the dataset.
sensitivity: Opt-in; true also returns sensitivity checks (sensitivity).
Every response carries `stamp` (core/guardian versions, estimator, resolved
config, seeds, data_fingerprint) and `llm_decisions` (audit/replay records):
a changed answer with an unchanged `stamp.data_fingerprint` came from a Syl
release or config change, not from your data. Only cleaning/discovery/estimator
set to "llm" can change a number; summary never does.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cause": "<cause>",
"effect": "<effect>"
},
"name": "guardian_review"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| se | No | auto | |
| csv | No | ||
| cate | No | ||
| data | No | ||
| seed | No | ||
| step | No | ||
| cause | Yes | ||
| units | No | ||
| config | No | ||
| effect | Yes | ||
| adstock | No | ||
| context | No | ||
| time_col | No | ||
| estimator | No | ||
| dataset_id | No | ||
| sensitivity | No | ||
| test_design | No | ||
| known_confounders | No |