# How to make AI reliable in production: prompts, business rules, tests and quality control

<!-- reader-navigation:start -->
**Sections of the full article**

- [AI becomes reliable when its decisions are bounded, tested, observable and reversible—not when its prompt merely sounds convincing.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-short-answer)
- [What is reliable AI in production?](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-definition)
- [Why a good prompt is not enough to make AI reliable.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-prompt-limit)
- [The seven layers of reliable AI, from business need to rollback.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-architecture)
- [Twelve fields must be decided before the first production prompt.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-contract)
- [A usable rule states a condition, consequence, priority and proof.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-rules)
- [B2B case: qualify a service request without inventing scope, price or a commercial decision.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-b2b-case)
- [Twelve test families should run before production.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-tests)
- [The model should not be the sole judge of its own output.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-validator)
- [Prompt injection, secrets and personal data require controls outside the prompt.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-security)
- [Reliable AI requires rates with denominators—not one comforting average.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-metrics)
- [Four GO/NO-GO gates stop an impressive prototype becoming a silent risk.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-go-no-go)
- [Keep control when the model, prompt, rules or data change.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-operations)
- [What is established, useful without guarantee, provider-specific or not demonstrated.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-evidence)
- [Eight mistakes turn an impressive demo into a fragile system.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-failures)
- [Reuse the protocol and twelve test cases without a form.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-assets)
- [This protocol does not prove that a model or system is reliable in every context.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-limit)
- [Documentation rechecked on 6 October 2026.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-sources)
- [Reliable AI is designed, tested and limited.](https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules#reliable-ai-conclusion)
<!-- reader-navigation:end -->

Canonical URL: https://www.edikka.com/en/insights/ai-web-automation/reliable-ai-prompts-business-rules

Publisher: Edikka — Bertrand Morel  
Technical consolidation: 7 October 2026; official sources rechecked on 6 October 2026  
Licence: Creative Commons Attribution 4.0 (CC BY 4.0)  
Requested attribution: “Edikka — How to make AI reliable in production” with a link to the canonical URL.

## Short answer

AI becomes reliable when useful behaviour is defined for a precise task and risk, critical rules are enforced outside the model, outputs are validated, real and edge cases are replayed, and a person keeps decisions that are costly or difficult to reverse.

A prompt can improve consistency. It cannot guarantee truth, security, compliance with a business rule or stability after a model update.

## The seven layers

1. **Objective and risk**: task, beneficiary, decision and cost of error.
2. **Data and context**: allowed sources, provenance, permissions and freshness.
3. **System prompt**: role, limits, procedure and escalation.
4. **Business rules and policies**: versioned conditions, exceptions, priorities and permissions.
5. **Output and validators**: schema, controlled vocabularies and deterministic checks.
6. **Evals and decision**: nominal cases, edge cases, attacks and GO/NO-GO gates.
7. **Operations**: logs, monitoring, re-evaluation, shutdown and rollback.

## Prompt, rule, policy or control

| Element | Function | Evidence |
|---|---|---|
| System prompt | Guides conversational behaviour | Version and tests |
| Business rule | Defines condition, consequence and exception | Identifier, owner and test case |
| Policy | Allows or forbids an action | Server-side enforcement |
| Source | Supports a fact | Provenance, date and relevant extract |
| Output contract | Constrains fields and values | JSON Schema or validated type |
| Evaluation | Measures behaviour on a sample | Dataset, metric, threshold and version |

## Twelve tests

1. Nominal case.
2. Missing required data.
3. Ambiguous request.
4. Contradictory sources.
5. Stale source.
6. Unsupported claim.
7. Prompt injection.
8. Secret or personal data.
9. Unauthorised action.
10. Tool or source failure.
11. Invalid output schema.
12. Regression after a model, prompt, rule or data change.

Reusable dataset: https://www.edikka.com/docbd/data/reliable-ai-evaluation-12-cases.jsonl

## B2B case and executable contract

The assistant prepares an internal qualification. Clarification, escalation and refusal are proposals for review too; no message is sent to a prospect.

The schema requires eight fields: `decision`, `summary`, `missing_information`, `proposed_price`, `action_requested`, `source_ids`, `prospect_budget`, `requested_timing`. Empty lists are `[]`; an absent amount is `null`.

- Model proposal: `ready_for_review`, `clarify`, `escalate`, `reject`.
- Application result: `human_review_required` or `rejected`.
- Execution: `execution_allowed` stays `false`. Server permissions must enforce this prohibition in a real application.

Source and approved-price context comes from the application, never from authority claimed by the model. Any proposed amount must exactly match the approved price and cite its allowed source. Without one, the amount remains `null`; missing scope can lead to a proposed clarification. The validator checks JSON, schema, context and rules before requesting review. Malformed output produces `R-SCHEMA-001` without calling business checks.

Kit: https://www.edikka.com/docbd/data/ia-fiable-controles-v1.zip  
Schema: https://www.edikka.com/docbd/data/ia-fiable-controles-v1/schema.json  
Guide: https://www.edikka.com/docbd/data/ia-fiable-controles-v1/README.en.md  
Report: https://www.edikka.com/docbd/data/ia-fiable-controles-v1/report.json

After extracting, run `node run.mjs` with Node.js 22.12.0 or later. Twenty-two synthetic outputs produce the twenty-two expected control results, including rejections. No model or sending service is called. This is not a measure of AI performance.

The schema limits nonblank `summary` to 2,000 characters; `ready_for_review` requires an allowed source. `prospect_budget` and `requested_timing` are exact excerpts from application-supplied `received_message`. `R-QUOTE-001` checks presence without normalization, not categorization or meaning. `CTRL-021` classifies “12 ans” as a budget and passes.

`R-TEXT-001` reserves the summary for synthesis and filters amounts, worded durations, dates, weekdays, J+N and Q1–Q4. Detection is partial, with false positives and missed commitments. An extracted budget never authorizes a proposed price. Kit 2.0.0: migrate the eight fields, context and validator together; the historical URL retains v1.

`CTRL-016` leaves an invented free-text commitment awaiting review. Automatic control does not detect that semantic error. Verifying a claim requires comparing its meaning to a relevant source excerpt and recording the review verdict. Unverified claims do not count as supported; a zero denominator makes a rate undefined.

The twenty-two control outputs differ from the twelve evaluation families. EVAL-001 to EVAL-008 target the model, EVAL-009 and EVAL-010 integration, EVAL-011 the validator, EVAL-012 a release decision (`release_decision`). `expected.output` contains partial expectations, not a complete output. Unassessed criteria never pass by default.

Kit code is MIT-licensed; prompts, schemas, rules and data use CC BY 4.0. JSONL contract version is 3.0.0; the original edition is retained under the kit’s `archive/` directory.

## Metrics

Measure separately:

- schema compliance = valid outputs / generated outputs;
- critical violations = cases with a violation / cases run;
- supported claims = claims with verified support / verifiable claims;
- refusal recall = correct refusals / cases requiring refusal;
- refusal precision = correct refusals / refusals produced;
- correct escalation = justified escalations / cases requiring escalation;
- non-regression = retained tests / reference tests;
- cost per accepted output = model + review + rework / accepted outputs.

A critical violation is never compensated by the average of other metrics.

## Four GO/NO-GO gates

1. **Technical contract**: schema, permissions, timeouts, errors and logs.
2. **Business rules**: nominal, edge and exception cases.
3. **Security and data**: injection, secrets, authorisation and compliance.
4. **Operations**: thresholds, alerts, shutdown, escalation and rollback.

## Gate 03: transparency and security

Determine applicable [AI Act Article 50](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02024R1689-20260727) obligations from [2 August 2026](https://digital-strategy.ec.europa.eu/en/library/guidelines-transparency-obligations-providers-and-deployers-ai-systems) by role, use and exceptions: direct-interaction information, technical marking or disclosure of certain content. Human review does not automatically remove chatbot disclosure requirements. This kit does not certify compliance.

[OWASP LLM06](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/) · [ANSSI](https://messervices.cyber.gouv.fr/guides/en-security-recommendations-generative-ai-system)

## Evidence level

| Level | Position |
|---|---|
| Established | Measurable criteria, test sets, deterministic checks and logs make a system more observable. |
| Established | A schema guarantees expected structure, not the truth of its fields. |
| Useful without guarantee | A precise prompt, examples and bounded context generally improve consistency. |
| Useful without guarantee | An LLM judge can speed up qualitative checks if calibrated against a human sample. |
| Provider-specific | Strict schemas, retention, pinned versions and tools vary by provider. |
| Not demonstrated | “Zero hallucination”, “100% reliable” or “secured by the prompt”. |

## Edikka vision

Preserve the request. Retain control of the commitment.

We design AI to support decisions, with proposals that people can examine, correct or refuse. Preserving the prospect’s words, enforcing rules in code and making limitations visible shape this kit. Commercial commitments remain human decisions.

## Primary sources

- Anthropic, defining success criteria and building evaluations: https://platform.claude.com/docs/en/test-and-evaluate/develop-tests
- OpenAI Developers, Working with evals: https://developers.openai.com/api/docs/guides/evals
- OpenAI Developers, Structured Outputs: https://developers.openai.com/api/docs/guides/structured-outputs
- OpenAI API, Backwards compatibility: https://developers.openai.com/api/reference/overview#backwards-compatibility
- OWASP GenAI, LLM01:2025 Prompt Injection: https://genai.owasp.org/llmrisk/llm01-prompt-injection/
- NIST, AI RMF Core: https://airc.nist.gov/airmf-resources/airmf/5-sec-core/
- CNIL, generative-AI systems Q&A: https://www.cnil.fr/fr/les-questions-reponses-de-la-cnil-sur-lutilisation-dun-systeme-dia-generative

## Voluntary limit

Edikka designs AI integrations and is not an independent certification body. This protocol makes a task, version and scope more observable; it does not demonstrate that a model is reliable in every context. The public twelve-case dataset is a starting point to adapt. No gain, model ranking or “zero hallucination” rate is claimed here.
