# AI back office: from approval to a saved change

Edikka · v1.0.0 · 11 October 2026 · Reproducible synthetic case.

This kit checks how an approved description is applied in a shared system. Read, propose, approve and apply permissions are separate. No model is called: the proposal is an editable fixture. No productivity gain has been measured.

## Reproduce

**Requires Python ≥ 3.9**, its standard library and bundled SQLite. This release was verified on Python 3.9.6; rerun the tests to establish compatibility with other versions. No API key, account or dependency installation. Extract the ZIP and open its directory.

```sh
python3 test_controls.py --output results.json
python3 server.py --port 8876 --lang en
```

Open http://127.0.0.1:8876/?lang=en. Ctrl+C stops the server and discards its temporary database. Tests start their own servers on free ports and never use a website database. The server binds only to loopback. Synthetic identities are intentionally exposed in its local console: do not publish it, tunnel it, put it behind a reverse proxy or mistake it for an authentication system.

## The case

A fictional desk lamp: description, €89 price, `draft` status, tenant A and version 1. Only `description` is delegated to the assistant. An editor can read, propose, edit and save manually. A reviewer can also accept, reject, apply and request rollback. A reader can only read. A tenant B user cannot access tenant A's record.

`permissions.json` is the policy actually read by the server; `matrix.json` is its bilingual representation. Checks run on every server command. Disabled buttons are not a security boundary.

## Try the workflow

1. Prepare a proposal. Review the word diff (deletions crossed out, additions underlined), with the saved version identified and edits reflected as you type; fluent wording does not make missing facts true.
2. Edit if needed and save the correction. An unsaved visible edit disables approval in the interface.
3. Accept the version. The saved record is unchanged: `accepted` is not `applied`.
4. Open laboratory scenarios, simulate a colleague editing, then close scenarios.
5. Apply. The server refuses the outdated context and preserves the colleague's version.

A fresh session provides the successful path. After applying, try rollback immediately and then after a manual intervention. The simulated outage affects preparing a proposal; manual entry remains available. This does not test a real provider outage.

To reproduce the seeded factual error shown in the screenshot, start a fresh session, copy the source description and replace only “2 years” with “three years”. Prepare the proposal: the diff should isolate “2” and “three”. It identifies a change, not the truth. Reject that proposal; this test supplies no measurement of human vigilance.

## Execution contract

Approval binds the suggestion ID, record, exact text, source version, proposal revision, policy version and `update_description` action. It expires after 900 seconds: a demonstration parameter, not a universal recommendation.

SHA-256 is a binding fingerprint, **not a signature or authorization secret**. Authorization depends on the server-resolved synthetic identity and database. Every apply command starts `BEGIN IMMEDIATE`, rereads executor and approver permissions, checks approval and target version, and writes conditionally on that version. SQLite serializes bench writes. An operation key binds the actor and exact request payload: identical replay returns the original result; different reuse fails.

Rollback is a new write, allowed only while the record remains at the version produced by the original application. The journal retains `applied` as a historical fact; an `undo` mutation records restoration. Recovering from a conflict requires a new suggestion based on current state.

## Journal and data

`journal.schema.json` defines each event. Review: `proposed`, `edited`, `accepted`, `rejected`, `expired`. Execution: `pending`, `applied`, `blocked`, `conflict`. Unexpected infrastructure errors roll back the transaction and return an error; this bench does not claim to journal failures while its own database is unavailable.

Events contain IDs, actor, timestamp, versions, fingerprint and decision reason, not full text. Proposals and previous values needed for rollback live separately in the disposable database. This is an ordinary table, **not a tamper-proof journal**. Set access, retention, deletion and any tamper-resistance requirements in the real project.

## Evidence and acceptance

`results.json` contains requests without credentials, responses, record states, mutations, events, Python/SQLite versions and source hashes. The 18 cases include two truly concurrent tests: rival proposals and duplicate delivery. Counts refer to control scenarios, not people or model responses. Each run overwrites its selected output report; choose a new filename to retain history.

`browser-results.json` records thirteen interface checks and fifteen exact diff reconstruction cases per language, including punctuation and the deliberately seeded warranty error. It also records source hashes and the actual browser version. These automated checks do not replace a human study.

`checklist.json` distinguishes covered controls from remaining production work. `measurement-protocol.json` is an unexecuted human protocol with empty data and unknown gain. It defines human effort, denominators and residual errors. No “97% / 3 seconds” threshold is proposed.

## Deliberate limits

No general prompt-injection resilience, semantic accuracy, user study, production authentication, complete security audit, distributed load or external side-effect guarantee (email, payment, third-party service). External calls need their own transaction, recovery and idempotency strategy. The hostile-HTML display test concerns text rendering, not model robustness.

Do not copy this laboratory server into production. Implement its invariants in the actual system with real transactions and authenticated identity. Model behavior, data collection and human use require separate evaluations.

## Sources and license

- OWASP: [Excessive Agency 2025](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/) and [Transaction Authorization](https://cheatsheetseries.owasp.org/cheatsheets/Transaction_Authorization_Cheat_Sheet.html).
- [Microsoft, Guidelines for Human-AI Interaction](https://www.microsoft.com/en-us/research/publication/guidelines-for-human-ai-interaction/); [Google PAIR, Feedback + Control](https://pair.withgoogle.com/guidebook-v2/chapter/feedback-controls/).
- [CNIL, use of generative AI](https://www.cnil.fr/fr/les-questions-reponses-de-la-cnil-sur-lutilisation-dun-systeme-dia-generative).

Python/JavaScript/CSS/HTML code: MIT, see LICENSE-CODE.txt. Documentation, policy, schemas, synthetic data and results: CC BY 4.0, https://creativecommons.org/licenses/by/4.0/. Attribution: Edikka, “AI back office: from approval to a saved change”, v1.0.0, 2026, article URL and access date. Third-party sources retain their licenses. Internal source archives are not distributed in this kit.

## Reproduction across Python versions

`.github/workflows/controls.yml` is prepared for a repository with this kit at its root. It runs the same 18 scenarios on Python 3.9, 3.10, 3.11, 3.12 and 3.13 and retains a report for each version. This matrix **has not yet run on GitHub**; no green badge or multi-version result is claimed. Browser checks are separate from these server scenarios.

`CITATION.cff` prepares the citation for this version. No DOI has been assigned and no Zenodo release has been deposited. Publish the repository, execute CI and archive the release before making those claims.
