Governance
CHAIN-R's central claim is governed AI. Every invocation runs under rules you can prove were enforced, and every model and agent is tested against standards you can show it meets. Governance is the part of the platform that makes that claim checkable. It sets the standards, enforces and measures against them, keeps the evidence, and routes to a person whatever needs a decision.
This guide is the map. The mechanics of each part are in their own guides: Governance Rules, Evaluation, Human in the loop and Cost monitoring.
Four capabilities, one loop
Governance in fe-core is one page with two tabs, Rules and Evaluation: the standards you define. Activity and Reviews open from the top of the Rules tab, as what came of the rules. The four are one loop, not four features:
| Capability | The question it answers | How | The evidence it leaves |
|---|---|---|---|
| Evaluation | Is this model or agent, at this version, fit for purpose? | Datasets of representative cases (criteria, checked facts, expected behaviour, scripted tools), including built-in gold datasets for standard properties, each with a pass mark. Experiments that score variants on them, automatic regression verdicts, and a promotion gate. | Every run records the dataset, evaluation and agent versions it ran against, its figures and its verdict. |
| Activity | What did the rules actually do? | Every rule outcome (blocked, applied, no change or not matched), grouped by the message it ran on. | Links from each outcome to the exact chat turn. |
| Reviews | What needs a person? | Output rules' flag_for_review, and every evaluation run that regressed. | A terminal decision with who, when and why. |
define enforce / measure record decide
┌───────────┐ every invocation ┌────────────┐ ┌──────────────────┐ ┌──────────┐
│ Rules │ ─────────────────▶ │ Activity │──▶│ │ │ │
└───────────┘ └────────────┘ │ Evidence │──▶│ Reviews │
┌───────────┐ every run ┌────────────┐ │ (versioned, │ │ │
│ Datasets │ ─────────────────▶ │ Evaluation │──▶│ pinned) │ │ Promotion│
└───────────┘ │ + Assurance│ └──────────────────┘ │ gate │
└────────────┘ └────┬─────┘
▲ │
└────────────────── change (versioned, diffable) ───────────────────────┘
Rules and Evaluation come first because they are what you define. Activity and Reviews are the evidence and the decisions.
Why evaluation is part of governance
Rules govern each invocation in the moment. They decide what may enter a model, what may leave it, and which model may answer. Evaluation governs the configuration between changes. Is this prompt, this model or this agent revision good enough, behaving as intended, and no worse than before? A rule cannot tell you an agent has started answering refund questions wrongly. Evaluation can.
The two meet in four places:
They produce the same kind of evidence. A rule outcome is pinned to the rule revision that ran. An evaluation result is pinned to the agent revision it scored. Both are append-only once written. Nothing in the application edits them, though the database doesn't yet enforce or seal that (see Known limits).
They send decisions to the same queue. An audit flag and a regressed run are both governance signals that need a person. Governance → Rules → Reviews holds both, and Kind filters between them.
Evaluation gates change. Promoting a prompt onto an agent is refused when it scored worse than the prompt already live. Overriding the gate is recorded with its reasons.
Rules act on evaluation evidence. The
require_evaluationAccess action refuses an agent whose version in force has not passed an evaluation: a completed, scored run of the agent as configured that reaches the dataset's pass mark without regressing. Editing an agent starts a new version, which the gate refuses until it is evaluated. Change control is enforced at inference time, not left to process. See The evidence gate.
Standards to measure against: gold datasets and pass marks
Every account starts with gold datasets, built-in benchmarks for the properties an assurance review asks about first: hallucination and grounding, tool use, political neutrality, prompt injection, refusal calibration, privacy and personal data, and clarification. They are maintained by CHAIN-R and read-only. Anyone can run their own models and agents on them, and Copy to my datasets makes an editable dataset from one. Each release is a version, and runs on different versions are never compared.
Every dataset has a pass mark, the mean score that passes it. It is 0.8 unless the dataset sets its own, because the bar depends on the use case: the grounding and privacy sets ask for 0.9. Assurance and the evidence gate both judge runs against it, and a rule can ask for more. See Evaluation.
Evaluation used to be a tab of Inference, next to the things it measures. It moved here because what it answers is an assurance question, not a building one. Every old address redirects.
Assurance: which version has evidence behind it
Governance → Evaluation → Assurance lists every agent you own and whether the version now in force has evaluation evidence behind it:
| Status | Meaning |
|---|---|
| Below pass mark | The version in force was evaluated, and falls below a dataset's pass mark. |
| Not scored yet | The version in force was evaluated, but its run has not been scored (manual grading). |
| Changed since evaluated | Only an older version was scored; the agent has been edited since. |
| Version not recorded | It was scored before runs recorded agent versions (migration 75). Run it again to know. |
| Never evaluated | No completed run has scored it as it is configured. |
| Regressed | Its latest run scored worse than the one before, whatever else is true. A review item has been opened. |
Each agent shows a chip per dataset with its score against that dataset's pass mark. Passing is exactly what the evidence gate lets through: both read the runs through services/evaluation/evidence.py.
This works because every run stamps ExperimentBatch.target_versions at the moment it starts, recording the revision of each agent it runs and whether it ran the agent as configured. A variant on another model or with a candidate prompt is evidence about an alternative, not about the agent in production. Editing the agent mid-run does not change what the run evaluated. A model has no version history (models are svc-ai's records), so a run of models alone records none.
GET /app/evaluations/assurance serves it, with the same owner scoping as the reports (services/evaluation/assurance.py).
The evidence chain
Every question an auditor or reviewer is likely to ask resolves to a stored record, not to a person's memory:
| Question | Where the answer is |
|---|---|
| Which rules applied to it, and what did each do? | Governance → Rules → Activity, one row per rule with its revision and outcome, linked from the message. |
| Was personal data removed, and of what kind? | Governance → Rules → Activity, per rule: kinds and counts ({"nhs_number": 1}), never the text. The rule's page names every kind it redacts. |
| Has this agent version been tested, and how did it score? | Governance → Evaluation → Assurance, and the run with its per-case results. |
| Was it allowed to answer without passing? | Not if an evidence gate governs it. A refusal is in Governance → Rules → Activity with the version, the reason and the runs it rested on. |
| Did a change make things worse, and who decided what to do? | The run's regression verdict, and its review item with the reviewer's decision and note. |
| Why was this prompt promoted despite scoring worse? | The promotion record: the override, the gate's reasons and the agent version it produced. |
| Was this resource generated by AI, and from what request? | is_ai_generated and generation_id, which open the GenerationRun with the redacted request and the model. |
| What did it cost, and whose budget was it? | The usage ledger, attributed to the resource that caused the call. Cost-cap rules read it before the model is called. |
Properties an enterprise can rely on
Enforced, not advisory. Rules run where the model is called, in svc-core and again inside svc-ai's graph runs. Access and Input rules apply before the model sees a prompt, and Output rules after it answers. If a rule cannot be evaluated, it fails as documented (Failure semantics).
Versioned end to end. Every rule, agent, skill, dataset, evaluation and prompt has an append-only, diffable version history. Evidence is pinned to a revision: the rule revision on an outcome, the agent revision on a turn, and the dataset, evaluation and agent revisions on a run.
Human decisions are final. A review decision cannot be reopened. It records who decided, when and why, so the record is the audit answer rather than a setting that can drift.
Retention is a decision. Flags are kept indefinitely unless a rule states a retention period. Deleting audit evidence has to be chosen on the rule, never left to a platform default.
Records are redacted first. A review excerpt is taken after Output rules have redacted the response. The activity log counts redactions and never stores the text.
Personal data is kept from the model, verifiably. PII rules detect UK identifiers (National Insurance, NHS, driving licence, taxpayer and bank details), EU national identity numbers (France, Germany, Spain, Italy, the Netherlands, Belgium, Poland, Sweden, Denmark, Finland, Ireland, Portugal), IBANs and payment cards — each identifier's own checksum verified — and names, contact details and dates of birth. An Input rule redacts the prompt, the conversation history, attached documents and answers before any model sees them; an Output rule redacts the answer as it streams, its trace and what is stored. Placeholders are keyed, so the model can still tell two people apart without seeing either. See Personal data.
Scoped precisely. A rule targets anything you own, from the whole account down to one worker. Rules you write govern your own invocations, including your use of shared built-in agents.
Costed and attributed. Every model call, including evaluation judges and generation flows, is on the ledger. Cost caps and rate limits act before the call.
Provenance for generated resources. Anything the platform generates carries the invocation that produced it, with the redacted request and the model that answered.
Tested before it is promoted. The promotion gate compares a candidate prompt with the one already live in the same run, and blocks on evidence of a regression.
Evaluated before it answers, if you require it. The evidence gate refuses traffic to an agent version with no passing evaluation, and names the dataset and score it failed on. It stands aside only for evaluation runs, and fails open only when the evidence cannot be read, never when it is missing.
Measured against standards. Gold datasets for hallucination, tool use, political neutrality, prompt injection, refusal calibration, privacy and clarification, each with a stated pass mark, and versioned so a result names the standard it met.
How this supports common assurance expectations
Regulation and assurance frameworks for AI — the EU AI Act's obligations for high-risk systems, the UK's AI regulation principles, ISO/IEC 42001 — share a handful of expectations. CHAIN-R supplies controls and evidence for each. It does not by itself make a deployment compliant: that depends on how it is configured, what is evaluated, and the organisation's own processes.
| Expectation | What CHAIN-R provides |
|---|---|
| Human oversight | The review queue (audit flags and regressions), human-in-the-loop pauses and approval gates in agents and skills, and the promotion gate. |
| Accuracy and robustness, before and after change | Datasets with criteria, facts and expected behaviour, gold datasets for standard properties, and pass marks. Automatic regression verdicts on every run, repeats to measure consistency, assurance per agent version, and an evidence gate that can refuse an unevaluated version. |
| Data protection by design | PII redaction before the model (prompt, history, attachments, answers) and after it (streamed, traced and stored), with UK and EU identifiers checksum-verified and keyed placeholders in place of each value; counted, never stored. Every model's data region is in the catalogue, and a deployment on Bedrock runs every route in the UK or EU. |
| Monitoring after deployment | Governance → Rules → Activity, the regression review queue, and dashboards over the governance ledger (blocks, redactions, review backlog). |
| Transparency about the system | Every generated resource says it was generated and by which invocation. Every answer resolves to the configuration that produced it. |
| Transparency to the people using it (AI Act Art. 50) | Every chat says, under the message box, that the person is talking to an AI system, and every answer carries an AI label. Generated PDFs say so on every page and in their metadata, and chat exports (PDF, Markdown, JSON) carry the same statement. |
Known limits
Stated plainly, because an assurance claim is only as good as its boundaries:
Gold datasets are small and English-language. They are 8–12 cases each, enough to catch a model that fabricates or takes sides but not to rank two good ones finely. Copy and extend one for a finer or local measurement.
Nothing re-runs an evaluation on a timer. A verdict appears when someone runs the evaluation (Known gap 9 in
CLAUDE.md).Rule enforcement inside a graph run is traced, not logged to the activity log (Known gap 11).
Access is per area, not per resource, and duties aren't separated. A member holds reader, writer or editor in each of four areas, but the person who edits an agent can also approve its regression (reviewer / builder separation is MVP-2), and "may edit this agent but not that one" can't be expressed (Known gap 13).
Runs before migration 75 carry no agent version. They show as version not recorded until the agent is evaluated again.
No rule moves an invocation to another model. Routing rules were removed (October 2026): data residency is the deployment's, which on Bedrock runs every route in the UK or EU, and each model's region is in the catalogue.
PII detection is pattern-based. Names are found after a title or a form label, not in free prose; street addresses are not detected (postcodes are, when chosen); identifiers from countries not listed are not detected. Knowledge passages and tool results reach the model as they are — an audit rule still redacts what the model writes back.
Audit records are append-only, not sealed. Nothing in the application edits a version, governance event or ledger row, but the database doesn't refuse an edit, and nothing would detect one. Hash-chained sealing with a verify endpoint is an MVP-1 item. Until then, say "append-only", not "tamper-evident".
The quality check is uncalibrated. svc-ai's evaluator scores each draft out of 100, but nobody has checked that score against outcomes, so never call it "confidence". What it records is honest: an answer it could not check is
unavailablewith no score (it used to read as a pass scored 80), and a rewritten answer isrevised. Thequality_checkrule field and the built-in "Review answers the quality check could not stand behind" send those answers to a person. A direct model prompt has no check at all.A pending approval doesn't survive a restart. Human-in-the-loop checkpoints are held in svc-ai's memory, so a deploy abandons every pause (refused, never silently restarted). Durable checkpoints are an MVP-1 item.
Where it lives
| fe-core | svc-core | |
|---|---|---|
| Evaluation | Governance → Evaluation (Datasets, Reports, Assurance); /user/governance/datasets/id/…, /user/governance/experiments/id/… | services/evaluation/ (evidence.py, assurance.py), /app/evaluations; gold datasets in services/system_resources/datasets.py |
| Evidence gate | Governance → Rules, Access action Require passing evaluations | services/rules/actions.py (RequireEvaluationAction), services/rules/references.py |
| Activity | Governance → Rules → Activity | governance_activity.py, /app/rules/activity |
| Reviews | Governance → Rules → Reviews | review.py, evaluation/assurance.py, /app/reviews |