Skip to content
Console
Browse documentation
Guide

Product experiments

Two-arm, fixed 50/50, application-server experiments with one fixed-horizon result — how your agent defines, launches, stops and reads one, and how your server delivers it.

On this page

A product experiment assigns each identified person to one of two fixed 50/50 arms, your application server registers the first exposure, and a captured event you name up front becomes the trusted binary outcome. The result is computed once, at a fixed horizon: no peeking while the run is live, no automatic rollout, and a minimum sample the platform enforces before drawing any inference.

A refused launch preview returns status: error over MCP, leading with refused: <reason> and retaining every refusal code. The CLI prints the full verdict and exits 1, including JSON output. Previewing never launches the experiment.

Your agent defines, previews, launches and stops the experiment through MCP or the CLI, and reads its counts and result. Your own application server delivers it: it assigns people, registers exposures and records outcomes.

Assignment needs a customer identifier Anectico resolved to an identified person. Identify it first. Declaring another person's person ID without that mapping does not enroll them. Attribution is as reliable as your application's own identification of customers; an intake credential does not authenticate an end user.

This is not AI Evaluation. AI Evaluation experiments (under a separate surface) compare prompt and model trials against human or judge labels. Product experiments never reuse feature flags either: an experiment's arm payloads live only in the frozen launched revision, so flag decisions and local flag evaluation cannot allocate or reveal a treatment. If you need to kill a bad experiment immediately, stop it — there is no flag toggle for this.

Approve configuration changes

Every management write through MCP, REST or the CLI first returns a server preview and changes nothing. It includes complete before and proposed definitions, required permissions and a confirmation token. Customer-authored configuration is marked as untrusted data. Creation IDs and commit timestamps are assigned at apply; the preview states which values are generated then.

Approve that state, then repeat identical arguments with MCP confirm_token, CLI --confirm-token TOKEN, or REST header X-Anectico-Confirm-Token: TOKEN. Keep the same body, version arguments and retry key. A changed state, source or argument requires a fresh preview and approval. Local --yes is no longer accepted.

Creation needs a stable idempotency_key (1–128 bytes), supplied with CLI --idempotency-key KEY or REST Idempotency-Key: KEY. Identical retries return the first committed result, even after the object changes or is deleted; they create nothing new. Changed arguments cannot reuse the key. Current permissions and privacy restrictions still apply when reading a receipt.

Create uses a retry key. Draft replacement, launch and stop require the exact current expected_revision (--expected-revision REV). A draft result is refused as not launched; it is never evidence that a run was invalidated. Read the draft and its admission checks instead. The delivery sequence below uses its separate application credential and receipt keys.

Ask your agent

"Draft an experiment called checkout-copy that compares the long and the short checkout copy on all identified people. The outcome is order_completed within one hour. Enroll for two weeks from next Monday. Run the launch preview and tell me every refusal before you launch."

"How is checkout-copy doing? Give me the counts per arm. If it has finished, give me the result and the decision."

Job MCP tool or action CLI command
List a project's experiments, or read one list_experiments, get_experiment anectico experiments list, anectico experiments get
Create a draft create_experiment anectico experiments create
Replace a draft's definition update_experiment_draft anectico experiments update-draft
Check launch admission without launching preview_experiment_launch anectico experiments preview-launch
Launch (previewed first, then confirmed) launch_experiment anectico experiments launch
Stop a draft or a run stop_experiment anectico experiments stop
Read the per-arm ledger counts get_experiment_counts anectico experiments counts
Read the fixed-horizon result get_experiment_result anectico experiments result

get_experiment_result is a direct MCP viewing tool. The other reads are MCP read actions: your agent finds them with list_read_actions and runs them with execute_read_action. The writes are write actions: it finds them with list_write_actions and runs them with execute_internal_action. All management writes are previewed first and applied only with the returned confirmation token. Management needs experiments:read for every call, plus experiments:write (drafts) or experiments:launch (launch and stop); over MCP the key also needs mcp:read (reads) or mcp:write (writes). Delivery uses a different key (see Delivery).

What your agent gets back

  • From get_experiment: the definition (frozen once launched), the state, the stop reason and the invalidation evidence.
  • From get_experiment_counts: counts only, no inference — per arm, how many were assigned and exposed, and the outcome receipts by state.
  • From get_experiment_result: descriptive per-arm counts until the run is final; then the immutable snapshot, the rates and, for a final result, the difference, its interval and the decision (see Reading a result).
  • From preview_experiment_launch: every launch refusal found, without launching anything (see Launch admission).

Open the proof

An experiment has no proof page, and its tools return no link. Your agent can show a read-only result picture in a compatible host, or report the definition, counts and result as text with its tool citation. See Charts in chat.

Lifecycle

State Meaning
draft Editable. Assigns nobody.
running Launched; assignment is accepted inside the enrollment window.
observing Enrollment closed; outcomes are still arriving or settling.
final Analyzed once, from an immutable snapshot.
insufficient_evidence Analyzed once; the floor, minimum sample or missing evidence withheld inference.
canceled Stopped by a person. Terminal — never yields a result.
invalidated Required evidence became unusable (identity change of an exposed person, the declared audience became unreadable, or an exposed person was erased). Terminal — never yields a result, and withdraws one that was already final.

A launched definition is frozen: arms, eligibility, the outcome selector, the enrollment window and the horizon can never change after launch. To change any of them, stop the run and create a new draft.

Define, preview and launch

control_payload and treatment_payload are JSON values. Objects, arrays, strings, numbers, booleans and null are accepted. A draft is replaced as a whole, at the revision your agent read: pass it as --expected-revision in the CLI, or as expected_revision to update_experiment_draft. If someone else changed the draft first, the call is refused with a 409 conflict and saves nothing. Read the draft again, reapply your edits to the latest revision and retry.

anectico experiments create --key checkout-copy --idempotency-key checkout-copy-draft-1 --body '{
  "name": "Shorter checkout copy",
  "hypothesis": "Shorter copy converts more people",
  "control_payload": "long copy",
  "treatment_payload": "short copy",
  "eligibility": {"kind": "EXPERIMENT_ELIGIBILITY_KIND_ALL_RESOLVED_PEOPLE"},
  "primary_outcome": {"event": "order_completed", "source_id": "<server-capture source id>"},
  "conversion_horizon_seconds": 3600,
  "enrollment_start": "2026-11-01T00:00:00Z",
  "enrollment_end": "2026-11-15T00:00:00Z",
  "minimum_exposed_per_arm": 100,
  "direction": "EXPERIMENT_DIRECTION_INCREASE"
}'

anectico experiments preview-launch checkout-copy --project PROJECT_UUID
anectico experiments launch checkout-copy --expected-revision 1 --project PROJECT_UUID

eligibility.kind is either ALL_RESOLVED_PEOPLE or one exact AUDIENCE_GENERATION (a saved audience id plus its exact generation — a saved audience is described in Events, cohorts and audiences). primary_outcome.source_id must be an active server-capture ingestion source of the project — a browser, mobile or import source is refused. enrollment_start/enrollment_end are half-open and must span 7 to 30 days; conversion_horizon_seconds is 1 second to 30 days; minimum_exposed_per_arm is at least 100.

Launch admission

preview-launch evaluates every requirement on actual instants and returns every refusal it finds, without launching anything:

Code Meaning
EXPERIMENT_HORIZON_LIMIT The horizon or enrollment window is outside its bound.
UNSUPPORTED_EXPERIMENT_MODE Eligibility or direction is not a supported shape.
EXPERIMENT_ENROLLMENT_IN_PAST enrollment_start is more than 5 minutes in the past.
EXPERIMENT_RETENTION_INSUFFICIENT An evidence family's retention would expire before the finalization deadline (enrollment_end + horizon + 24h), or the organization has no configured retention policy.
EXPERIMENT_SOURCE_UNTRUSTED The primary outcome's (or guardrail's) source_id is not an active server-capture source.
EXPERIMENT_AUDIENCE_UNAVAILABLE The declared audience generation, or the launcher's own authority over it, is not readable.
EXPERIMENT_AUDIENCE_EXPIRES_BEFORE_FINALIZATION The audience generation expires before the finalization deadline; no replacement generation is ever substituted.

launch re-evaluates admission at --expected-revision and refuses with the same codes if the draft still fails; a refusal never launches anything. Launching a revision that has already moved (edited or already launched) is a 409 conflict — re-read the draft and retry.

Delivery: an APPLICATION key only

Assignment, exposure registration and outcome recording are a separate, server-to-server surface. They accept only an APPLICATION-purpose API key — never a management token, never a server_capture intake key — and the project and organization come from that key, never from the request body:

anectico apikey create --purpose application --scope experiments:deliver --project PROJECT_UUID --name checkout-experiments

The plaintext secret (an_...) is shown once. It is a server-side secret: it must never reach a browser, a mobile app, or any client-side code. Use it from your own backend, with the Node delivery client or the equivalent in your own server language.

assign → expose → capture → record-outcome

For each person, your application server does four things, in this order:

  1. Assign the person to the experiment. The assignment is stable per canonical person: aliases, retries and concurrent calls all return the same assignment. If the person is not enrolled, serve the default experience and stop.
  2. Expose the assignment before any treatment-dependent work. Pass a stable idempotency key, such as <experiment key>:<assignment id>, so a retry after a network failure is safe.
  3. Capture the qualifying event with your server_capture key, naming the same person, and keep the exact message_id the platform acknowledged as queued.
  4. Record the outcome, binding that message ID to the exposure and to the trusted source named in the definition (primary_outcome.source_id).

The same person, project and trusted server-capture source run through all four steps. Take the person and the browsing session from the authenticated application request, never from an arbitrary field of the request body.

Record an outcome only for an event whose capture was acknowledged as queued. A permanent refusal of the capture leaves no event to bind: report it as refused and record nothing. An uncertain acknowledgement is retried with the same message ID, which resends the original envelope; do not change the identity, session, timestamp or properties while you retry it.

Keep the credentials apart. The application key (experiments:deliver) and the server_capture key (analytics:write) both live only in your server's secret configuration, and the management credential that created them never reaches the application. The delivery calls go to your control address, the address that serves your REST API. The capture goes to your capture address. They are different hosts, so configure them as two named settings.

The Node capture example is not published yet. The Node SDK's AnalyticsClient holds one customer and one session, so a server with overlapping requests builds one AnalyticsClient per request, bound to that request's identity and session, as request-scoped clients shows; a complete runnable experiment capture example built on it is not published yet. Never share one client between simultaneous customers, switch one client's identity between requests, or reset it between them to fake isolation. You can also send the capture over the HTTP API, naming the person, session and message ID on each event, as the SDK-less example does for product events. The assign, expose and record-outcome calls have a Node client in the JavaScript reference.

Assignment, exposure and outcome timestamps are all stamped by the platform's own clock at the first durable write — never by a client timestamp or an ingestion-host clock. Retrying expose or recordOutcome with the same idempotency key (or the same exposure and event pair) is always safe and returns the original result (replayed: true).

Two refusals no retry can fix

EXPERIMENT_SUBJECT_UNRESOLVED (assignment) and EXPERIMENT_OUTCOME_CONFLICT (outcome recording) are never retryable, with the same idempotency key or a new one:

  • EXPERIMENT_SUBJECT_UNRESOLVED — the distinct_id you named does not resolve to an identified person in this project. Identify the person first (see Events, cohorts and audiences); an anonymous visitor is never assigned.
  • EXPERIMENT_OUTCOME_CONFLICT — the captured event you named is already bound to a different exposure of this launched revision. Every captured event can back at most one outcome receipt.

Receipt-timed outcomes and the 24-hour arrival grace

recordOutcome stores a provisional receipt immediately; a background reconciliation pass settles it against the captured event within (exposed_at, exposed_at + conversion_horizon) — strictly after exposure, strictly before the horizon ends. An outcome state is never a failure signal by itself:

State Meaning
provisional Recorded; not yet reconciled.
reconciled The captured event matched project, trusted source, the declared event name and the exposed person's identity, strictly inside the timing window. Counts as a success.
refused The captured event contradicts the receipt (wrong timing, wrong person, untrusted origin, or a second success once one is already counted).
missing No qualifying captured event arrived within 24 hours of the receipt. This withholds inference — it is never counted as a failure.

The 24-hour arrival grace is fixed and cannot be shortened or lengthened per run.

Read one tested subject's delivery evidence

Use an isolated qualification run for a smoke test. Preserve the assignment ID, exposure ID and launched revision returned to the application. Aggregate counts cannot identify this subject: other participants can change them at the same time.

The read requires a management credential with experiments:read. Add persons:read to resolve a declared identity or read canonical attribution. An assignment-ID read without it returns attribution as withheld. The application keeps its separate experiments:deliver credential.

Surface Exact selection
REST POST /api/v1/projects/{projectId}/experiments/{key}/delivery-evidence with the body below. It is a read; GET is unsupported.
MCP execute_read_action with action get_experiment_delivery_evidence, plus project_id, experiment_key and the body fields as arguments. No confirmation.
CLI anectico experiments delivery-evidence KEY --revision 1 --assignment-id ASSIGNMENT --exposure-id EXPOSURE --file outcomes.json --project PROJECT --json
{
  "revision": "1",
  "assignment_id": "de2d9007-01df-4135-a7a0-b4ac99e0916f",
  "exposure_id": "76822582-7c39-47db-a321-eaa7fb72d87d",
  "outcomes": [
    {"source_id": "7f1e2d3c-4b5a-4968-8776-5544332211aa", "event_id": "test-checkout-42"}
  ]
}

The CLI file contains only {"outcomes":[{"source_id":"SOURCE","event_id":"MESSAGE"}]}; revision and subject selectors are flags. Omit the file to select no outcomes. Use --person DECLARED_DISTINCT_ID instead of --assignment-id to select the application's exact alias; REST and MCP call that field distinct_id. A person UUID that is not itself a mapped alias does not resolve this way. Exactly one subject selector is required. Revision is an exact positive decimal string on JSON surfaces. Project, assignment, exposure and source IDs are canonical nonzero UUIDs. There are at most 20 ordered outcome coordinates; each event ID is printable, nonempty, at most 1,024 UTF-8 bytes and has no surrounding whitespace. The optional exposure must belong to that assignment and revision; another exposure never substitutes for it. Scope, key and all query parameters are excluded from the REST body.

The answer echoes the selection and reports the current run state, requested and launched revisions, identity, assignment, exposure, outcomes, population counts, limits and read clocks. This read uses full enum names for run state and arm on every surface. assigned_at, exposed_at, recorded_at and settled_at come from the server's first durable record, with original precision; absent timestamps are null, never invented. An identity-change marker is present only if recorded. The clocks bound this read; they do not promise an atomic snapshot across independent sources. Population counts describe selected coordinates, not all participants. undetermined counts one subject when its selection or attribution is unavailable, unresolved or withheld, plus each unavailable selected outcome. ambiguous is zero for the exact unique selections this read supports.

Each outcome has an observation_state separate from ledger_state:

Selection and settlement What it establishes
not_observed, empty ledger state No retained receipt matched this complete readable source and event selection. No receipt or settlement time is supplied.
observed, provisional The receipt exists; capture reconciliation has not settled it. This does not establish stored capture.
observed, reconciled The receipt's reconciliation matched the declared event and source and frozen identity evidence. This is an existing settlement, not a fresh independent capture read.
observed, refused The receipt exists but was refused; read its reason and settlement time.
observed, missing The receipt exists and settled without qualifying capture by its arrival deadline. This is different from no receipt and never a conversion failure.
unavailable A required parent or subject attribution could not be selected. It makes no absence claim.

Erasure removes the subject's records; a read cannot reconstruct them. An erased or unknown assignment receives the same absent-record description. The current run can be INVALIDATED even when another subject's permitted descriptive facts remain. A failed or changed authority and identity check can refuse the whole read; start a fresh read with the same selectors. Retained selection is all this report establishes: upstream completeness, queued identity changes and historical coverage remain limits. Reading never enrolls, exposes, records or forces reconciliation. links is empty.

Match independent capture evidence

capture_evidence.state is always ledger_only. Its primary_outcome and optional guardrail are the frozen launched event and source declarations. Preserve each actual application capture tuple: event name, declared distinct_id, source_id, message_id and any session and run selector. The receipt alone cannot recover that clear capture identity, and an assignment UUID is not one.

Use the exact event verification read separately with analytics:read and persons:read; property checks additionally need agents:content:read and any pinned plan needs tracking_plans:read. Match receipt (source_id,event_id) to sample (source_id,message_id), the observed event to the frozen outcome declaration, and the sample's resolved identity to the selected assignment's readable person. Outcome verification requires at least one selected receipt and its exact captured sample with readable attribution. Missing samples or withheld attribution prevent that claim. Assignment-only evidence verifies no outcome.

A short smoke test can check delivery stages. Enrollment remains at least seven days and the minimum remains at least 100 exposed people per arm: it cannot produce a statistical winner. Do not erase an exposed person from a live run to tidy up a sample; use isolated qualification.

Identity changes invalidate a run

An experiment's ledger freezes a person's aliases at assignment time as evidence, never as identifiers. If an identity event (a merge, split or correction) later changes an exposed person's identity, the run is invalidated immediately — a treatment effect measured against a person who has since become someone else in the platform's identity graph cannot be trusted. An assignment that was never exposed is only marked; exposing it afterward is refused and then invalidates the run. An identity change that touches nobody assigned to the run changes nothing.

Erasing a person invalidates the runs that exposed them

Erasing a person removes their assignment, their exposure and the outcomes recorded for them from every experiment. A run that had exposed them counted them, so it is invalidated with reason PERSON_ERASED, and the invalidation names the erasure operation, never the person. This is the one cause that reaches a run that is already final: its result counted someone who is no longer there, so the run becomes invalidated and its result stops being served. Reading it returns the descriptive per-arm counts, which no longer include the person.

A run that had only assigned the person, and never exposed them, is not affected: the assignment is removed and the run carries on. The person cannot be assigned again.

A run that takes its eligible people from a saved audience is also invalidated if that audience contained the erased person: the audience is a fixed list and is withdrawn with them.

Stop

anectico experiments stop checkout-copy --expected-revision REV --reason "bad copy" --project PROJECT_UUID

Stopping cancels a draft or a run immediately: assignment, exposure registration and outcome recording all stop at once. A canceled run is terminal and never yields a result. Stopping an already-canceled experiment returns it unchanged; stopping an invalidated or final run is refused — both are already terminal.

Reading a result

anectico experiments result checkout-copy --project PROJECT_UUID

While running or observing, and for a canceled or invalidated run, a result carries descriptive per-arm counts only — assigned, exposed, successes, missing evidence, refused — never a rate, a test statistic, an interval or a decision. The REST response may omit arms[].conversion_rate or return it as null; both mean unavailable, never zero. Peeking at an in-flight run cannot be trusted the way the one fixed-horizon analysis can.

After the finalization deadline (enrollment_end + conversion_horizon + 24h), the platform computes the result once, from an immutable ledger snapshot (its digest and per-arm counts are in the result, for exact reproducibility), and finalizes to one of two states:

  • final — a valid run that met the floor with no missing outcome evidence. The result carries, per arm, the conversion rate; the Miettinen–Nurminen score-test difference (p_treatment − p_control), its z-statistic, p-value and 95% confidence interval; a sample-ratio check; and a decision.
  • insufficient_evidence — analyzed, but inference is withheld. reasons names why:
Reason Meaning
FLOOR_NOT_MET Fewer than 100 exposed, or fewer than 5 successes, or fewer than 5 failures, in some arm — the inference floor.
MINIMUM_SAMPLE_NOT_MET The run's own declared minimum_exposed_per_arm (which may ask for more than the floor) was not met.
MISSING_OUTCOME_EVIDENCE At least one exposure's outcome evidence is still missing (see the outcome states above) — the result waits rather than analyzing an incomplete ledger.
DEGENERATE_TABLE Reserved for a 2×2 outcome table with no meaningful test (no successes or all successes in both arms, or complete separation). Any such table also has fewer than 5 successes or failures in some arm, so a run in that state reports FLOOR_NOT_MET first.
NUMERICAL_NONCONVERGENCE The score-test inversion did not converge.
SAMPLE_RATIO_MISMATCH The exposed 50/50 split is statistically unlikely (p < 0.001) — a randomization or delivery bug is suspected, so no decision is made even though inference was otherwise computable. sample_ratio is still reported.

The decision is a read of the interval, never an automatic rollout

decision is set only on a final result with no sample-ratio mismatch, and reads the 95% confidence interval of p_treatment − p_control against the experiment's declared direction:

  • treatment_better — the interval excludes 0 on the side the declared direction prefers.
  • treatment_worse — the interval excludes 0 on the other side.
  • no_detectable_difference — the interval contains 0. This is not evidence of no effect; the floor establishes a minimum sample, not statistical power.

Anectico never ships the treatment automatically, whatever the decision says — reading and acting on it is always a decision your team makes.

Guardrail: descriptive, never decides

An experiment may optionally declare a guardrail selector (a second event to watch, purely descriptive). Its result reports per-arm exposure and event rates when it can be computed (status: COMPUTED), or nothing at all when there were too many guardrail events to safely attribute (status: LOOKUP_LIMIT_EXCEEDED) — a result is still final either way. A guardrail never affects the decision.

Reads and writes at a glance

Surface Reads Writes
CLI anectico experiments list|get|counts|result create|update-draft|preview-launch|launch|stop
MCP list_experiments, get_experiment, get_experiment_counts, get_experiment_result, preview_experiment_launch create_experiment, update_experiment_draft, launch_experiment (confirm), stop_experiment (confirm)
REST GET .../experiments, GET .../experiments/{key}, GET .../experiments/{key}/counts, GET .../experiments/{key}/result POST .../experiments, PUT .../experiments/{key}/draft, POST .../experiments/{key}/launch-preview, POST .../experiments/{key}/launch, POST .../experiments/{key}/stop

Management requires experiments:read for every call, plus experiments:write (drafts) or experiments:launch (launch, stop). Delivery requires the application key's own experiments:deliver scope, which no other credential can ever hold.

See also: Authentication for the application key purpose, Permissions for the scope list, and the Node.js SDK for captureAndAck and the experiments() delivery client.

Read or export a result picture

get_experiment_result accepts project_id, key and optional include_image. True requests PNG, false suppresses it, and omission attempts an image unless the current request advertises the result viewer. Text and structured evidence remain available. Host rendering varies; an image reaching a model does not establish that a person saw it.

anectico --project PROJECT_UUID experiments result checkout-copy --render png --out result.png

The existing result read also accepts ?format=png. JSON is the default. A supported running or observing picture prominently shows descriptive counts only. It supplies no calculated rates, tests, intervals or winner. Assigned people who were not exposed are a registration gap, never failed conversions. Final rates and inference appear only when supplied by the result. Missing rates stay absent. Every insufficient-evidence reason remains visible. A sample-ratio mismatch qualifies trust and withholds the decision. An interval crossing zero or no_detectable_difference proves neither no effect nor adequate power. A guardrail remains descriptive and never changes the decision; a lookup-limit refusal means no guardrail counts, rather than zero or partial counts.

Canceled and invalidated results withdraw efficacy. Drafts have no result. Terminal or unavailable PNG requests return a JSON refusal. A PNG-only size, layout, capacity or deadline refusal can leave the browser picture valid. Images are limited to 960 by 540 pixels and 256 KiB; output is validated completely before the CLI atomically creates a new file. Existing destinations and symlinks are refused and preserved. No chart read finalizes a run, reconciles evidence or changes treatment.

Every picture names its observation time and any supplied final snapshot digest and timing. Interim reads receive no invented expiry or final-snapshot identity. Coverage and identity timing limitations remain; a digest is not a promise that all upstream evidence arrived. Fresh reads honor erasure, deletion and current permissions. Already delivered chat copies, screenshots and files cannot be recalled. Reading needs experiments:read, plus mcp:read over MCP, with the same project binding as the ordinary result read.

The result is a direct viewing tool discovered with tools/list; flag definition snapshots remain read actions discovered with list_read_actions and called through execute_read_action with action: "get_local_evaluation_snapshot". That snapshot keeps its flags:read and mcp:read permissions, versions, updated time, max_age_seconds, ETag and project-scoped freshness. It is not an exposure count. Rendering adds no permission. No vendor host is yet qualified to show this picture; retain descriptive text and supplied final facts when Apps or PNG is unavailable. There is no experiment proof link to substitute, and model image receipt is not owner visibility.