{"playbook":"Machine learning","url":"https://agentwranglers.se/playbook/machine-learning","updated":"2026-10-27","license":"https://creativecommons.org/licenses/by/4.0/","credit":"Required by the licence: credit Agent Wranglers with a link to the rule or playbook you used.","ids":"Each rule has an id, such as PAY-14, that never changes. Open a rule by its id at /r/PAY-14. Its revision changes whenever its content changes.","how":"Each rule's How and Measured text is on its own page: add .md to its url.","rules":[{"id":"MLO-1","revision":"2c7cbeab1531","updated":"2026-10-22","name":"Write down the decision and what each error costs","level":"Recommended","applies":["ai-features"],"rule":"Before training, write one page per model. It names the decision the output drives and who acts on it. It states the cost of a false positive, the cost of a false negative and the score that counts as success.","check":"Every model in the registry links a decision page. A script fails when a page lacks the action, the owner, both error costs or the success score.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/problem-and-baseline/decision-and-error-costs","related":["/playbook/machine-learning/problem-and-baseline/threshold-from-costs","/playbook/compliance/ai-act/ai-high-risk-check","/playbook/ai-features/deciding-to-use-a-model/define-ai-success","/playbook/machine-learning/training-runs-and-the-registry/model-cards"],"sources":["https://developers.google.com/machine-learning/guides/rules-of-ml","https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-1.pdf"]},{"id":"MLO-2","revision":"1ab62ee3332f","updated":"2026-10-22","name":"Beat a simple baseline before you ship a model","level":"Recommended","applies":["ai-features"],"rule":"Build two baselines first, one that ignores the inputs and one simple rule or linear model. A trained model ships only when it beats both on the frozen test set.","check":"Each evaluation report holds scores for the input-blind baseline, the simple baseline and the candidate on the same test set. The release gate fails when the candidate does not beat both.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/problem-and-baseline/baseline-first","related":["/playbook/ai-features/deciding-to-use-a-model/model-or-code","/playbook/machine-learning/evaluation/offline-eval-gate","/playbook/machine-learning/serving-and-release/model-fallback"],"sources":["https://developers.google.com/machine-learning/guides/rules-of-ml","https://scikit-learn.org/stable/modules/generated/sklearn.dummy.DummyClassifier.html"]},{"id":"MLO-3","revision":"66fa72866aa4","updated":"2026-10-22","name":"Choose the threshold from the cost of errors","level":"Recommended","applies":["ai-features"],"rule":"Pick the decision threshold that gives the lowest expected cost on validation data, using the error costs from the decision page. Never keep the default of 0.5 without that test.","check":"The registry entry of each classifier holds a threshold and the expected cost it gave on validation data. A test compares that cost with the cost at 0.5 and records both in the report.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/problem-and-baseline/threshold-from-costs","related":["/playbook/machine-learning/problem-and-baseline/decision-and-error-costs","/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/machine-learning/evaluation/accuracy-alone"],"sources":["https://scikit-learn.org/stable/modules/classification_threshold.html"]},{"id":"MLO-4","revision":"acada3430498","updated":"2026-10-22","name":"Record where every dataset came from and why you may use it","level":"Required","risk":"law","applies":["ai-features"],"rule":"Keep a record for every dataset a model trains on. It names the source, the owner, the licence or contract, the legal basis for any personal data and the purpose it was collected for.","check":"The training pipeline refuses to start when any input dataset has no record, or a record lacks a source, licence, purpose or legal basis. A test runs it with an unregistered dataset and expects the refusal.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-data/dataset-provenance","related":["/playbook/compliance/records-and-data-map/records-of-processing","/playbook/ai-features/logs-privacy-and-feedback/consent-before-training","/playbook/ai-features/logs-privacy-and-feedback/erase-from-ai-stores","/playbook/machine-learning/training-data/poisoning-checks"],"sources":["https://eur-lex.europa.eu/eli/reg/2016/679/oj","https://eur-lex.europa.eu/eli/reg/2024/1689/oj"]},{"id":"MLO-5","revision":"b6c94588cca9","updated":"2026-10-22","name":"Keep direct identifiers out of training data","level":"Required","risk":"data","applies":["ai-features"],"rule":"Remove names, email addresses, phone numbers, street addresses and account numbers before data reaches the training store. Replace a join key with a keyed hash that serving can compute too.","check":"A test scans every column of the latest training snapshot for email addresses, phone numbers and card numbers. It also checks the list of banned column names. It finds no match.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/training-data/no-identifiers-in-training","related":["/playbook/data/personal-data/minimal-columns","/playbook/data/personal-data/masked-copies","/playbook/machine-learning/serving-and-release/log-serving-features"],"sources":["https://eur-lex.europa.eu/eli/reg/2016/679/oj"]},{"id":"MLO-6","revision":"ae1b5926af6c","updated":"2026-10-22","name":"Freeze each training set as a versioned snapshot","level":"Recommended","applies":["ai-features"],"rule":"Train only from an immutable snapshot with a content hash. Record that hash with every model, and never train from a live table or a folder that can change.","check":"Recompute the hash of the snapshot named by each model in production. It matches the recorded hash, or the registry marks the snapshot as deleted with a date.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/training-data/data-snapshots","related":["/playbook/machine-learning/training-runs-and-the-registry/training-run-record","/playbook/compliance/records-and-data-map/retention-schedule","/playbook/machine-learning/training-data/label-agreement","/playbook/machine-learning/splits-and-leakage/test-set-untouched","/playbook/machine-learning/people-affected-by-the-model/erasure-from-models"],"sources":["https://mlflow.org/docs/latest/ml/tracking/"]},{"id":"MLO-7","revision":"e5ec66e0e3ea","updated":"2026-10-22","name":"Write labelling instructions and measure agreement","level":"Recommended","applies":["ai-features"],"rule":"Give labellers written instructions with worked edge cases. Have two people label at least 5% of each batch. Reject a batch whose agreement is under the floor you set, such as a Cohen's kappa of 0.6.","check":"Every labelled batch in the latest snapshot has a recorded kappa from at least 5% double-labelled items. A script fails when any batch is below the floor or has no kappa.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-data/label-agreement","related":["/playbook/machine-learning/training-data/data-snapshots"],"sources":["https://scikit-learn.org/stable/modules/generated/sklearn.metrics.cohen_kappa_score.html","https://eur-lex.europa.eu/eli/reg/2024/1689/oj"]},{"id":"MLO-8","revision":"7570e512addd","updated":"2026-10-22","name":"Check that every group you serve is in the training data","level":"Recommended","applies":["ai-features"],"rule":"List the groups the model must serve, such as countries, languages, device types or age bands. Fail the training run when any group has fewer examples than the minimum you set.","check":"The training pipeline prints the count per listed group and stops when any group is under its minimum. A test with one group removed from the data expects the stop.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-data/group-coverage","related":["/playbook/machine-learning/evaluation/score-intervals","/playbook/machine-learning/people-affected-by-the-model/per-group-metrics","/playbook/machine-learning/monitoring-and-retraining/prediction-drift-alerts","/playbook/machine-learning/monitoring-and-retraining/feedback-loops"],"sources":["https://eur-lex.europa.eu/eli/reg/2024/1689/oj"]},{"id":"MLO-39","revision":"46a80f65811f","updated":"2026-10-22","name":"Check every new snapshot against the last one before training","level":"Recommended","applies":["ai-features"],"rule":"Before a training run, compare the new snapshot with the schema and statistics of the snapshot behind the production model. Stop on a missing or new column, a row count change over the set limit or a label share that moved over its limit.","check":"A test runs the pipeline on a snapshot with one column dropped, and on one with a label share moved by 10 points. Both runs stop before training and name the reason.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-data/validate-training-snapshot","related":["/playbook/machine-learning/monitoring-and-retraining/retraining-triggers","/playbook/machine-learning/serving-and-release/serving-input-schema"],"sources":["https://docs.cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning","https://cheatsheetseries.owasp.org/cheatsheets/Secure_AI_Model_Ops_Cheat_Sheet.html"]},{"id":"MLO-43","revision":"0f35aef813d8","updated":"2026-10-27","name":"Limit what any one source can put into training data","level":"Recommended","applies":["ai-features"],"rule":"Cap the share of each training snapshot that one account, labeller or outside source supplies, such as 1%. Stop the run when a source passes its cap or its labels disagree with a reference model far more than others do.","check":"A test adds rows from one account above the cap to a snapshot, and the pipeline stops and names the account. A second test flips the labels of one source, and the pipeline flags that source.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-data/poisoning-checks","related":["/playbook/machine-learning/training-data/dataset-provenance","/playbook/ai-features/logs-privacy-and-feedback/approve-feedback-before-training","/playbook/application-security/supply-chain/trusted-model-sources"],"sources":["https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-2e2025.pdf","https://github.com/GenAI-Security-Project/GenAI-LLM-Top10/blob/main/2026/final/LLM05_DataModelPoisoning.md"]},{"id":"MLO-9","revision":"570f1f300428","updated":"2026-10-22","name":"Split by time when the model predicts the future","level":"Recommended","applies":["ai-features"],"rule":"When a model predicts a later event, such as churn or fraud, train on data before a cutoff date and test on data after it. Never shuffle rows across time.","check":"A test reads the split of the latest training run. The newest training timestamp is earlier than the oldest test timestamp by at least the label delay.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/splits-and-leakage/time-based-splits","related":["/playbook/machine-learning/splits-and-leakage/point-in-time-features","/playbook/machine-learning/splits-and-leakage/group-splits"],"sources":["https://developers.google.com/machine-learning/guides/rules-of-ml","https://scikit-learn.org/stable/modules/cross_validation.html"]},{"id":"MLO-10","revision":"782e5b40f984","updated":"2026-10-22","name":"Keep each person or entity in one split","level":"Recommended","applies":["ai-features"],"rule":"Assign whole customers, devices, patients or documents to one split. Never let rows from the same entity sit in both training and test.","check":"A query joins the training and test sets of the latest run on the entity key. It returns no rows.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/splits-and-leakage/group-splits","related":["/playbook/machine-learning/splits-and-leakage/time-based-splits","/playbook/machine-learning/splits-and-leakage/cross-split-duplicates"],"sources":["https://scikit-learn.org/stable/modules/cross_validation.html"]},{"id":"MLO-11","revision":"6292ead51458","updated":"2026-10-27","name":"Fit every preprocessing step on training data only","level":"Required","risk":"money","applies":["ai-features"],"rule":"Learn scaling, encoding, imputation and feature selection from the training split alone. Apply the fitted steps to validation and test without fitting them again.","check":"A test trains the full pipeline on random labels and scores it on the test split. The score is within 0.05 of chance, which shows that no step saw the test data.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/splits-and-leakage/fit-on-train-only","related":["/playbook/machine-learning/serving-and-release/one-feature-pipeline"],"sources":["https://scikit-learn.org/stable/common_pitfalls.html"]},{"id":"MLO-12","revision":"9b0b5d9c5157","updated":"2026-10-27","name":"Use only features known at the moment of prediction","level":"Required","risk":"money","applies":["ai-features"],"rule":"Build each training row from feature values as they stood at that row's prediction time. Drop any feature that is written after the outcome, such as a refund reason or a closing status.","check":"A test builds a training row for a fixed past event. Each feature equals the value the serving logs recorded at that time. A second test fails when any single feature alone scores above 0.95 area under the curve.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/splits-and-leakage/point-in-time-features","related":["/playbook/machine-learning/splits-and-leakage/time-based-splits"],"sources":["https://docs.feast.dev/getting-started/concepts/point-in-time-joins","https://scikit-learn.org/stable/common_pitfalls.html"]},{"id":"MLO-13","revision":"bc1e1823635c","updated":"2026-10-22","name":"Remove duplicates across splits","level":"Recommended","applies":["ai-features"],"rule":"Before evaluation, remove from the test set every row whose inputs match a training row exactly, and every near duplicate of text or images.","check":"A query joins test and training rows on the input hash. It returns no rows, and the report states the count removed.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/splits-and-leakage/cross-split-duplicates","related":["/playbook/machine-learning/splits-and-leakage/group-splits"],"sources":[]},{"id":"MLO-14","revision":"e7d41f3a92e0","updated":"2026-10-22","name":"Tuning on the test set","level":"Avoid","applies":["ai-features"],"rule":"Never choose features, settings or thresholds by looking at test scores. Use the test set once per release candidate, after every choice is made on validation data.","check":"The test set is readable only by the evaluation job. Its access log shows at most one read per release candidate, and every read belongs to a gate run.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/splits-and-leakage/test-set-untouched","related":["/playbook/machine-learning/training-data/data-snapshots","/playbook/machine-learning/evaluation/offline-eval-gate"],"sources":["https://scikit-learn.org/stable/modules/cross_validation.html"]},{"id":"MLO-15","revision":"a1182486701f","updated":"2026-10-22","name":"Judging a model by accuracy alone","level":"Avoid","applies":["ai-features"],"rule":"Never report plain accuracy as the main score when one class holds less than 20% of the rows. Report precision, recall and a cost-based score for the class that matters.","check":"A script reads each evaluation report. It fails when a class under 20% of rows has no precision and recall, or when accuracy is the only headline score.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/evaluation/accuracy-alone","related":["/playbook/machine-learning/problem-and-baseline/threshold-from-costs"],"sources":["https://scikit-learn.org/stable/modules/model_evaluation.html#balanced-accuracy-score"]},{"id":"MLO-16","revision":"27a01cbeb5de","updated":"2026-10-22","name":"Check calibration when scores are shown as probabilities","level":"Recommended","applies":["ai-features"],"rule":"When a score is shown or used as a probability, check calibration on the test set. Recalibrate when any bin's observed rate differs from its mean score by more than the limit you set, such as 5 percentage points.","check":"The evaluation report holds a ten-bin calibration table for each model that exposes a probability. The gate fails when any bin with 100 or more rows is off by more than the limit.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/evaluation/calibrated-scores","related":["/playbook/machine-learning/people-affected-by-the-model/per-group-metrics"],"sources":["https://scikit-learn.org/stable/modules/calibration.html"]},{"id":"MLO-17","revision":"7c91bf27fe81","updated":"2026-10-22","name":"Report each score with its uncertainty","level":"Recommended","applies":["ai-features"],"rule":"Report every headline score with a 95% confidence interval. Call a new model better only when the interval of its difference from the current model lies above zero.","check":"Every score in the evaluation report has a lower and an upper bound. The gate rejects a candidate whose difference interval includes zero, unless the release is marked as a change that only has to hold the score.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/evaluation/score-intervals","related":["/playbook/machine-learning/training-data/group-coverage","/playbook/ai-features/evals-and-quality/repeat-eval-runs","/playbook/machine-learning/serving-and-release/model-ab-test"],"sources":[]},{"id":"MLO-18","revision":"7fdab7bb53f3","updated":"2026-10-22","name":"Test the model's behaviour case by case","level":"Recommended","applies":["ai-features"],"rule":"Keep a suite of behaviour tests next to the aggregate scores. It holds fixed cases with an expected answer and cases where a change must not move the score. It also holds cases where a change must move it one way.","check":"The behaviour suite runs in the gate for every candidate and every case passes. Each fixed production incident links a case in the suite.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/evaluation/behaviour-tests","related":["/playbook/machine-learning/evaluation/offline-eval-gate","/playbook/ai-features/evals-and-quality/counterfactual-evals"],"sources":[]},{"id":"MLO-19","revision":"6b16567b8413","updated":"2026-10-22","name":"Gate every release on an offline evaluation","level":"Recommended","applies":["ai-features"],"rule":"Promote a model only through an automatic gate. It scores the candidate and the current production model on the same frozen test set and blocks the release when any limit fails.","check":"Train a candidate on shuffled labels and send it through the pipeline. The gate blocks it and the serving alias still points at the old version.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/evaluation/offline-eval-gate","related":["/playbook/machine-learning/problem-and-baseline/baseline-first","/playbook/machine-learning/splits-and-leakage/test-set-untouched","/playbook/machine-learning/evaluation/behaviour-tests","/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/ai-features/evals-and-quality/reproducible-fine-tunes","/playbook/machine-learning/monitoring-and-retraining/delayed-label-quality","/playbook/machine-learning/monitoring-and-retraining/retraining-triggers","/playbook/machine-learning/people-affected-by-the-model/per-group-metrics"],"sources":["https://docs.cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning"]},{"id":"MLO-20","revision":"2e6fd53743e0","updated":"2026-10-22","name":"Record how every model was trained","level":"Recommended","applies":["ai-features"],"rule":"Store a run record with every trained model. It holds the data snapshot ID, the code commit, every setting, every random seed, the library versions and the hardware type.","check":"Retrain the current production model from its run record alone in a clean job. Its test score is within the tolerance written in the record, and the record has no empty field.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-runs-and-the-registry/training-run-record","related":["/playbook/machine-learning/training-data/data-snapshots","/playbook/ai-features/evals-and-quality/reproducible-fine-tunes","/playbook/machine-learning/training-runs-and-the-registry/training-run-cost"],"sources":["https://docs.pytorch.org/docs/stable/notes/randomness.html","https://mlflow.org/docs/latest/ml/tracking/"]},{"id":"MLO-21","revision":"551aabbbbb6b","updated":"2026-10-27","name":"Keep every model in a registry with versions and aliases","level":"Recommended","applies":["ai-features"],"rule":"Register every model that may serve traffic, with an immutable version number linked to its run record. Serving loads a model by an alias, such as `champion`, and rollback moves the alias back.","check":"Move the alias to the previous version in a staging environment. Serving reports the old version within the time your runbook states, and no code change or deploy was needed.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/training-runs-and-the-registry/model-registry","related":["/playbook/machine-learning/problem-and-baseline/threshold-from-costs","/playbook/machine-learning/evaluation/offline-eval-gate","/playbook/application-security/supply-chain/trusted-model-sources","/playbook/machine-learning/training-runs-and-the-registry/safe-model-formats","/playbook/machine-learning/serving-and-release/serving-input-schema","/playbook/machine-learning/serving-and-release/model-canary","/playbook/machine-learning/serving-and-release/model-retirement","/playbook/machine-learning/people-affected-by-the-model/decision-records"],"sources":["https://mlflow.org/docs/latest/ml/model-registry/"]},{"id":"MLO-22","revision":"a4c7a7237f95","updated":"2026-10-22","name":"Write a model card for every model in production","level":"Recommended","applies":["ai-features"],"rule":"Publish a model card with every registered version. It states the intended use, uses that are out of scope, the training data, the evaluation results per group, known limits and an owner.","check":"A script fails the registration when the card lacks any of the six sections. It also fails when the card's numbers differ from that version's evaluation report.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-runs-and-the-registry/model-cards","related":["/playbook/ai-features/deciding-to-use-a-model/ai-feature-card","/playbook/documentation/help-centres-and-user-guides/ai-system-card","/playbook/machine-learning/problem-and-baseline/decision-and-error-costs","/playbook/machine-learning/people-affected-by-the-model/proxy-features","/playbook/machine-learning/people-affected-by-the-model/training-data-extraction-test"],"sources":["https://eur-lex.europa.eu/eli/reg/2024/1689/oj","https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-1.pdf"]},{"id":"MLO-42","revision":"81ffe4767def","updated":"2026-10-27","name":"Store models in formats that cannot run code","level":"Required","risk":"takeover","applies":["ai-features"],"rule":"Save and load model weights only in formats that hold data and no code, such as safetensors or ONNX. Never unpickle a model file that did not come from your own registry with a matching hash.","check":"A code search finds no `pickle.load`, `joblib.load` or `torch.load` with `weights_only=False` outside the one loader that checks hashes. The registry refuses an upload with a `.pkl` or `.pt` file from outside the training pipeline. A test loads a file whose hash differs from the registry, and the loader refuses it.","check_type":"static","url":"https://agentwranglers.se/playbook/machine-learning/training-runs-and-the-registry/safe-model-formats","related":["/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/application-security/supply-chain/trusted-model-sources"],"sources":["https://docs.pytorch.org/docs/stable/generated/torch.load.html","https://scikit-learn.org/stable/model_persistence.html"]},{"id":"MLO-45","revision":"211f0ddcedc3","updated":"2026-10-27","name":"Record the compute cost of every training run","level":"Recommended","applies":["ai-features"],"rule":"Record the machine hours and the cost of every training and tuning run in its run record. Give each model a budget per run, and stop a run that passes it.","check":"Every run record in the last 30 days has machine hours and a cost. A test run with a budget below one checkpoint's cost stops at the first checkpoint with a budget status.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/training-runs-and-the-registry/training-run-cost","related":["/playbook/machine-learning/training-runs-and-the-registry/training-run-record"],"sources":["https://www.finops.org/wg/finops-for-ai-overview/","https://mlflow.org/docs/latest/ml/tracking/"]},{"id":"MLO-23","revision":"e2dc3b4d8d25","updated":"2026-10-22","name":"Compute features in one place for training and serving","level":"Recommended","applies":["ai-features"],"rule":"Define each feature once, in one module or feature store, and use that definition both to build training data and to answer live requests. Never write the same feature twice in two languages or two code paths.","check":"Each day a job recomputes the features of 1,000 logged requests with the training code. At least 99.9% of the values match the logged ones exactly, and the job alerts below that.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/one-feature-pipeline","related":["/playbook/machine-learning/splits-and-leakage/fit-on-train-only","/playbook/machine-learning/serving-and-release/log-serving-features"],"sources":["https://developers.google.com/machine-learning/guides/rules-of-ml","https://docs.feast.dev/getting-started/concepts/point-in-time-joins"]},{"id":"MLO-24","revision":"6242c819b8cc","updated":"2026-10-27","name":"Check every input against what the model was trained on","level":"Recommended","applies":["ai-features"],"rule":"Validate each request against a schema saved with the model version. It lists the type, the allowed range or categories and whether null is allowed, for every feature. Send a request that fails to the fallback, and count it.","check":"A test sends one request per feature with a value out of range, an unseen category and a missing field. Each one gets the fallback answer and adds one to the rejected count for that feature.","check_type":"http","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/serving-input-schema","related":["/playbook/machine-learning/training-data/validate-training-snapshot","/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/machine-learning/monitoring-and-retraining/input-drift-alerts","/playbook/events/contracts-and-schemas/source-schema-contracts"],"sources":[]},{"id":"MLO-25","revision":"d25d52b2b1b7","updated":"2026-10-22","name":"Log the features and prediction of every request","level":"Recommended","applies":["ai-features"],"rule":"For each prediction, log a prediction ID, the model version, the feature values, the score, the decision and the time. Store the log apart from app logs, under the retention set for it.","check":"Send 100 test requests. The prediction log holds 100 rows, each with a model version and every feature in the schema. No row holds an email address or a name.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/log-serving-features","related":["/playbook/machine-learning/serving-and-release/one-feature-pipeline","/playbook/operations/logs/logs-without-personal-data","/playbook/machine-learning/training-data/no-identifiers-in-training","/playbook/machine-learning/serving-and-release/limit-prediction-output","/playbook/machine-learning/people-affected-by-the-model/decision-records"],"sources":[]},{"id":"MLO-26","revision":"149f1b511c38","updated":"2026-10-22","name":"Run a new model in shadow before it decides","level":"Recommended","applies":["ai-features"],"rule":"Before a new model makes any decision, run it next to the current one on live traffic for a set period, such as seven days. Log both scores and act only on the current model's.","check":"During the shadow period, every request has a row for both models in the prediction log. A test confirms that a shadow model that always says yes changes no decision.","check_type":"http","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/shadow-mode","related":["/playbook/machine-learning/serving-and-release/model-canary","/playbook/machine-learning/monitoring-and-retraining/prediction-drift-alerts"],"sources":[]},{"id":"MLO-27","revision":"83d08a8cd380","updated":"2026-10-22","name":"Release models through a canary that compares predictions","level":"Recommended","applies":["ai-features"],"rule":"Send a new model a small share of traffic first, and widen it in steps. Roll back by itself when the error rate, the latency, the share of positive decisions or an early business metric moves past its limit.","check":"Release a test model that flags every case. The canary stops at the first step and the alias returns to the previous version without a person acting.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/model-canary","related":["/playbook/machine-learning/serving-and-release/shadow-mode","/playbook/engineering/build-test-and-deploy/staged-rollouts","/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/machine-learning/serving-and-release/model-ab-test"],"sources":["https://docs.cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning"]},{"id":"MLO-28","revision":"5253ffd20dd5","updated":"2026-10-22","name":"Answer with a fallback when the model fails or is slow","level":"Required","risk":"outage","applies":["ai-features"],"rule":"Give every model call a timeout and a written fallback answer, such as the rule-based baseline or a safe default. The feature keeps working when the model server is down, slow or rejects the input.","check":"A test stops the model server and sends requests. Each one gets the fallback within the timeout plus 100 ms, and the fallback count rises by the number of requests.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/model-fallback","related":["/playbook/machine-learning/problem-and-baseline/baseline-first","/playbook/ai-features/latency-cost-and-fallbacks/provider-fallback"],"sources":["https://sre.google/sre-book/addressing-cascading-failures/"]},{"id":"MLO-40","revision":"75001a4e7ea3","updated":"2026-10-22","name":"Limit what the prediction endpoint gives away","level":"Recommended","applies":["public-api"],"rule":"A prediction endpoint that callers outside the team can reach returns only the decision or a rounded score, never probability vectors or internal features. It enforces a quota per caller.","check":"A request to the public endpoint returns only the fields in its response schema, and no score has more than two decimals. A test sends one caller's quota plus one request, and the last one gets 429.","check_type":"http","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/limit-prediction-output","related":["/playbook/machine-learning/serving-and-release/log-serving-features","/playbook/machine-learning/people-affected-by-the-model/training-data-extraction-test"],"sources":["https://cheatsheetseries.owasp.org/cheatsheets/Secure_AI_Model_Ops_Cheat_Sheet.html"]},{"id":"MLO-46","revision":"8c7e82f6f725","updated":"2026-10-27","name":"Test a new model on live outcomes with a randomised split","level":"Recommended","applies":["ai-features"],"rule":"Before a new model replaces one that drives a business outcome, split users at random between the two. Write the success metric, the sample size and the stop date first, and ship only when the result clears the plan.","check":"Each model release that changed a business metric links an experiment plan dated before its start. The prediction log shows each user under one model version for the whole test.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/model-ab-test","related":["/playbook/analytics/experiments/experiment-plan","/playbook/machine-learning/evaluation/score-intervals","/playbook/machine-learning/serving-and-release/model-canary"],"sources":["https://docs.cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning"]},{"id":"MLO-47","revision":"03b9046aded0","updated":"2026-10-27","name":"Retire models on purpose","level":"Recommended","applies":["ai-features"],"rule":"When a model leaves production, remove its alias and endpoint and stop its feature jobs. Keep its registry entry, run record and card for as long as any decision record names it.","check":"No serving endpoint or alias points at a version marked retired. Every retired version has a date and a reason. A query finds no decision record that names a version whose weights are gone.","check_type":"http","url":"https://agentwranglers.se/playbook/machine-learning/serving-and-release/model-retirement","related":["/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/machine-learning/people-affected-by-the-model/decision-records"],"sources":["https://mlflow.org/docs/latest/ml/model-registry/"]},{"id":"MLO-29","revision":"cdad60afd74a","updated":"2026-10-22","name":"Alert when input data drifts from training","level":"Recommended","applies":["ai-features"],"rule":"Each day, compare the distribution of every input feature in the prediction log with the training snapshot. Alert when a distance passes the limit set for that feature, such as 0.3.","check":"Replay one day of logged requests with one feature shifted by two standard deviations. The drift job raises an alert for that feature and for no other.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/monitoring-and-retraining/input-drift-alerts","related":["/playbook/machine-learning/serving-and-release/serving-input-schema","/playbook/operations/alerts-and-on-call/actionable-alerts","/playbook/operations/alerts-and-on-call/page-or-ticket"],"sources":["https://docs.cloud.google.com/vertex-ai/docs/model-monitoring/overview"]},{"id":"MLO-30","revision":"55d2e2fc4e32","updated":"2026-10-22","name":"Alert when the prediction mix shifts","level":"Recommended","applies":["ai-features"],"rule":"Track the share of each decision and the mean score per hour or per day. Alert when either leaves the range seen in the 28 days after release.","check":"Replay a day of logged requests through a model whose threshold was set too low on purpose. The positive rate leaves the stored range and the alert fires within one check interval.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/monitoring-and-retraining/prediction-drift-alerts","related":["/playbook/machine-learning/serving-and-release/shadow-mode","/playbook/machine-learning/training-data/group-coverage"],"sources":[]},{"id":"MLO-31","revision":"9bade27d40c1","updated":"2026-10-27","name":"Measure live quality once the outcomes arrive","level":"Recommended","applies":["ai-features"],"rule":"Join each prediction to its outcome when it becomes known, by the prediction ID. Report the headline metric per week and per group, and alert when it falls below the limit in the release gate.","check":"A job computes the weekly metric and the label share from the joined table and writes them with the label coverage. A test with outcomes flipped for one week fires the alert. A test with the label share doubled for one week fires a label drift alert.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/monitoring-and-retraining/delayed-label-quality","related":["/playbook/machine-learning/evaluation/offline-eval-gate","/playbook/ai-features/evals-and-quality/production-quality-metrics","/playbook/machine-learning/people-affected-by-the-model/per-group-metrics"],"sources":[]},{"id":"MLO-32","revision":"0642ba044174","updated":"2026-10-22","name":"Retrain on written triggers","level":"Recommended","applies":["ai-features"],"rule":"Write down when each model is retrained. Use a schedule, a drift alert that persists, a quality drop below the gate limit, or a change in the business. Every retrained model goes through the same release gate.","check":"Each model's card lists its triggers. The pipeline log shows a run for every trigger that fired in the last 90 days, and each run has a gate result.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/monitoring-and-retraining/retraining-triggers","related":["/playbook/machine-learning/training-data/validate-training-snapshot","/playbook/machine-learning/evaluation/offline-eval-gate","/playbook/operations/alerts-and-on-call/job-heartbeats"],"sources":["https://docs.cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning"]},{"id":"MLO-33","revision":"31353125e726","updated":"2026-10-22","name":"Training only on outcomes the model chose","level":"Avoid","applies":["ai-features"],"rule":"Never retrain only on outcomes the model's own decisions allowed to happen. Keep a random holdout where the model does not decide, such as 1% to 5% of traffic. Log the chance each item had to be shown or picked.","check":"The prediction log marks holdout rows, and their share is within one percentage point of the target. Training data built from the log holds holdout rows and a selection probability column.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/monitoring-and-retraining/feedback-loops","related":["/playbook/machine-learning/training-data/group-coverage"],"sources":["https://developers.google.com/machine-learning/guides/rules-of-ml"]},{"id":"MLO-34","revision":"ead63d55e9a6","updated":"2026-10-22","name":"Measure every metric for each group of people","level":"Required","risk":"law","applies":["ai-features"],"rule":"For a model that scores or ranks people, compute the headline metric, error rates and calibration per group. List the groups, such as age band, sex or country. Block the release when the gap between groups passes the limit you wrote down.","check":"Every evaluation report of a model that scores people has a table per listed group with its count, metric, error rates and interval. The gate fails when a gap passes the limit or a group has no row.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/per-group-metrics","related":["/playbook/ai-features/evals-and-quality/counterfactual-evals","/playbook/machine-learning/training-data/group-coverage","/playbook/machine-learning/evaluation/calibrated-scores","/playbook/machine-learning/evaluation/offline-eval-gate","/playbook/machine-learning/monitoring-and-retraining/delayed-label-quality","/playbook/machine-learning/people-affected-by-the-model/sensitive-traits-for-bias-checks","/playbook/machine-learning/people-affected-by-the-model/proxy-features"],"sources":["https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-1.pdf","https://eur-lex.europa.eu/eli/reg/2024/1689/oj","https://developers.google.com/machine-learning/crash-course/fairness/evaluating-for-bias"]},{"id":"MLO-35","revision":"70474c3ce234","updated":"2026-10-22","name":"Features that stand in for protected traits","level":"Avoid","applies":["ai-features"],"rule":"Never give a model that scores people a feature that alone predicts a protected trait, such as postcode for ethnicity. Keep one only with a written reason and a passing group check.","check":"A script scores every feature against every listed trait. It fails when a feature passes the limit and the model card has no reason for it.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/proxy-features","related":["/playbook/machine-learning/training-runs-and-the-registry/model-cards","/playbook/machine-learning/people-affected-by-the-model/per-group-metrics"],"sources":["https://developers.google.com/machine-learning/crash-course/fairness/evaluating-for-bias","https://nvlpubs.nist.gov/nistpubs/ai/NIST.AI.100-1.pdf"]},{"id":"MLO-36","revision":"17f144e10454","updated":"2026-10-27","name":"Hold sensitive traits for bias checks apart from training","level":"Required","risk":"law","applies":["ai-features","eu-users"],"region":["EU"],"rule":"Use special categories of personal data, such as ethnicity or health, only to detect and correct bias, and only when other data cannot do it. Keep them in a separate store with logged access, never as model inputs, and delete them once the bias is corrected.","check":"No training snapshot or serving schema contains a special category column. The separate store has an access log, a deletion date and a record of processing entry that states why other data would not do.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/sensitive-traits-for-bias-checks","related":["/playbook/machine-learning/people-affected-by-the-model/per-group-metrics","/playbook/compliance/records-and-data-map/records-of-processing","/playbook/compliance/records-and-data-map/dpia-screening"],"sources":["https://eur-lex.europa.eu/eli/reg/2026/1744/oj","https://eur-lex.europa.eu/eli/reg/2016/679/oj"]},{"id":"MLO-37","revision":"5868725bffd2","updated":"2026-10-27","name":"Explain each decision to the person it affects","level":"Required","risk":"law","applies":["ai-features","eu-users"],"region":["EU"],"rule":"When model output shapes a decision about a person, such as credit, a job or an account ban, give them an explanation on request. It names the data used, how it counted and what would have changed the result.","check":"A test requests the explanation for a stored decision. It names the model version, the input values used and at least one reason with a change that would flip the outcome. It uses plain words and no feature codes.","check_type":"manual","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/explain-decisions","related":["/playbook/ai-features/guardrails-and-human-review/human-decides","/playbook/compliance/ai-act/ai-high-risk-check","/playbook/compliance/us-privacy-and-ai-laws/automated-decision-rights"],"sources":["https://eur-lex.europa.eu/eli/reg/2016/679/oj","https://curia.europa.eu/jcms/upload/docs/application/pdf/2025-02/cp250022en.pdf","https://eur-lex.europa.eu/eli/reg/2024/1689/oj"]},{"id":"MLO-38","revision":"83c67d23d7e3","updated":"2026-10-22","name":"Keep a record of every decision about a person","level":"Required","risk":"law","applies":["ai-features"],"rule":"Store each decision a model shaped about a person. Record the model version, inputs, score, threshold, reasons, reviewer and outcome. Keep it as long as the person can contest the decision.","check":"A query finds no decision row without a model version, score, threshold or reasons. For a sample of 20 rows, the named model version still loads from the registry.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/decision-records","related":["/playbook/ai-features/guardrails-and-human-review/human-decides","/playbook/machine-learning/serving-and-release/model-retirement","/playbook/machine-learning/serving-and-release/log-serving-features","/playbook/machine-learning/training-runs-and-the-registry/model-registry","/playbook/compliance/ai-act/ai-high-risk-check","/playbook/compliance/records-and-data-map/retention-schedule"],"sources":["https://eur-lex.europa.eu/eli/reg/2016/679/oj","https://eur-lex.europa.eu/eli/reg/2024/1689/oj"]},{"id":"MLO-41","revision":"49552a1a0bec","updated":"2026-10-27","name":"Test that the model does not give away its training records","level":"Required","risk":"data","applies":["ai-features","eu-users"],"rule":"Before you ship, share or call anonymous a model trained on personal data, run a membership inference test against it. Treat the model as personal data when the attack's AUC is above 0.55, or above a lower margin set in its model card.","check":"The release gate runs the membership inference test on every model trained on personal data. It fails when the attack AUC is above 0.55 or above the lower margin in the model card. A test with a deliberately overfit model expects that failure.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/training-data-extraction-test","related":["/playbook/machine-learning/serving-and-release/limit-prediction-output","/playbook/machine-learning/training-runs-and-the-registry/model-cards","/playbook/machine-learning/people-affected-by-the-model/erasure-from-models"],"sources":["https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf","https://cheatsheetseries.owasp.org/cheatsheets/Secure_AI_Model_Ops_Cheat_Sheet.html"]},{"id":"MLO-44","revision":"5f4e81bdd079","updated":"2026-10-27","name":"Remove erased people from every model trained on their data","level":"Required","risk":"law","applies":["ai-features"],"rule":"When a person's data must be erased, drop their rows from every snapshot used for future training. Retrain each model that learned from them within a set time, such as 90 days, unless its membership test shows it holds no personal data.","check":"A test erases a person and builds a new snapshot, and none of their rows appear in it. A script lists every production model trained on a snapshot holding erased rows. It fails when one is older than the set time and has no passing membership test.","check_type":"command","url":"https://agentwranglers.se/playbook/machine-learning/people-affected-by-the-model/erasure-from-models","related":["/playbook/machine-learning/training-data/data-snapshots","/playbook/machine-learning/people-affected-by-the-model/training-data-extraction-test","/playbook/ai-features/logs-privacy-and-feedback/erase-from-ai-stores"],"sources":["https://eur-lex.europa.eu/eli/reg/2016/679/oj","https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf"]}]}