# Reliable AI — Edikka control kit 2.0.0

Version: 7 October 2026. Article: https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules

This kit checks **22 prepared synthetic outputs**. It makes no model or network call and performs no business action. It does not measure AI performance. The twelve families in `evaluation.en.jsonl` form a separate protocol requiring actual model outputs, human review and integration tests.

## Reproduce

Requires Node.js 22.12.0 or later. Extract the ZIP and open a terminal in its folder.

```sh
node run.mjs
node --test validator.test.mjs
```

The first command prints a JSON report and exits non-zero if any expectation differs. It writes no files. Save a run with `node run.mjs > my-report.json`. The published `report.json` is the reference output, without a variable timestamp; `SHA256SUMS.txt` identifies the files.

Schema validation is included with no runtime dependencies. Ajv 8.20.0 compiles `schema.json` and `context.schema.json`. In the Edikka repository, `node scripts/build-ai-reliability-schema.mjs --check` checks the generated file; omit `--check` to regenerate it. Schema edits require regeneration and tests. Do not hand-edit `schema-validator.mjs`.

## One contract, three responsibilities

- **Model proposal**: `decision` is `ready_for_review`, `clarify`, `escalate` or `reject`. All examples use the schema's snake_case field names.
- **Application control**: result `status` is `rejected` or `human_review_required`. A proposed refusal (`decision: reject`) can be valid for review; rejection of malformed output (`status: rejected`) is a separate event.
- **Execution**: no output permits sending. `execution_allowed` stays `false`. The kit has no sending service; a real application must enforce the prohibition server-side and through technical-account permissions. A report boolean does not secure a separate service.

Validation runs in this order: JSON, output schema, context schema, business rules, human review. Null, arrays, missing fields, unknown enum values and unreadable JSON produce structured rejection. Extra fields are rejected; empty lists are `[]`, not `null`.

`rules.json` describes the checks run by `validator.mjs`. Missing, duplicate or unknown checks prevent loading. The context (`allowed_source_ids`, `approved_price`, `received_message`) belongs to the application: never derive it from authority claimed by a model or prospect. Approved amounts are in euros and must be copied exactly, never calculated. Source freshness, access and approval must be verified upstream.

## Interpret results carefully

The twenty-two controls cover decisions, prices, sources, actions, schemas and free-text limitations. A case passes when **the control produces the expected result**, including rejection. “22/22” does not mean twenty-two correct business answers.

`summary` must be nonblank and contain at most 2,000 Unicode characters. `ready_for_review` requires at least one allowed source identifier. Other decisions may report no sources.

`prospect_budget` and `requested_timing` hold a nonblank excerpt of 1–500 characters, or `null`. The application supplies `received_message` (at most 20,000 characters, empty allowed), without model rewriting. Its content remains untrusted data: instructions inside it have no authority. `R-QUOTE-001` requires exact substring presence, including whitespace, case and Unicode. This check performs no normalization.

The prospect’s “EUR 15,000” budget and “in 3 months” timing can be retained without becoming our price or a commitment. Exact presence proves neither correct categorization, complete context nor truth: `CTRL-021` puts “12 ans” in the budget field and passes. A truncated excerpt can also lose negation. Human review must compare it with the original message and correct attribution.

`R-TEXT-001` only checks `summary`, reserved for synthesis: currencies, 15K, numeric or worded durations, fortnight, J+N/D+N, Q1–Q4, dates with month names, weekdays after “by”, “before” or “for”, end of month and French equivalents. `text-policy.mjs` is the exact executable list. “Founded 12 years ago” is accepted. NFKC and removal of format characters reduce some summary bypasses; quotations are left untouched.

This detection is **partial**, in both directions: “no delivery tomorrow” is rejected; a general promise (`CTRL-016`) or different wording may pass. It does not identify the speaker or inspect other free-text fields. The contract and human review enforce that distinction. `proposed_price` remains an approved price, never the extracted budget. No field authorizes a delivery deadline.

The contract becomes **2.0.0** (eight fields and original message required), the JSONL protocol **3.0.0**. Migrate producer, context and validator together. The historical URL retains `v1`; `manifest.json` carries the effective version.

## Use the twelve evaluation families

`evaluation.fr.jsonl` and `evaluation.en.jsonl` share IDs EVAL-001 to EVAL-012, layers and technical expectations; messages are adapted to their language. All scenarios are synthetic, not observed client requests.

`expected.output` is an expected **subset**, not a complete candidate for the validator. Qualitative assertions require documented grading. EVAL-011 directly tests invalid output; EVAL-012 specifies a version comparison using `release_decision`, never the model's `decision` field. Missing outputs and unverified criteria remain unassessed, never pass by default.

To evaluate a model, freeze sources and reference date, record versions and parameters, run inputs, save complete outputs, apply automatic checks and human rubrics. Test failures and permissions against the actual application. Repeated runs and a task-appropriate corpus are necessary before performance conclusions; no universal statistical threshold is supplied here.

## Files and licences

Prompts, schemas, rules, cases and protocol: CC BY 4.0, Edikka — Bertrand Morel, with attribution and article link. `.mjs` code and tests: MIT, see `LICENSE-CODE.txt`. Ajv notice: `LICENSE-AJV.txt`. Report: synthetic outputs and deterministic controls only. No real secrets or personal data are needed.
