#214 Data governance 5.8 min
Build an AI Model Register and Risk Score
We listed seven AI systems. A short script found two more nobody had listed. Here is the register.
Clear the overdue review
Copy the code folder first. In register.yaml, change the next_review date of web-chat from 2026-09-15 to 2027-06-01, then run python risk.py register.yaml. Predict first what happens to the score and the band of web-chat. When I ran it, web-chat still showed high 7, but the overdue note was gone.
A hint
The review date is checked against the as_of date in the file. It does not feed into the points.
Take away the invoice reader's freedom
In register.yaml, change the autonomy of invoice-reader from acts to approves, then run python risk.py register.yaml. Work out the new points first from the scoring table in risk.py. When I ran it, invoice-reader scored 2 and was low, and the web chat and CV screener lines did not change.
A hint
In risk.py, POINTS has the numbers for data, autonomy and audience. Add the three together.
Register the marketing site
Add a new system at the end of the systems list in register.yaml, copying the layout of the others. Give it an id, a purpose, repo: marketing-site, an owner that contains an at sign, data: none, autonomy: suggests, audience: staff and a next_review date in the future. Run python risk.py register.yaml and then python scan.py. When I did this, the register had 8 systems with 0 errors and the scan listed only data-lab: 1 repository without an entry.
A hint
The scan compares the repo field of each register entry with the repository names in repos.yaml.
Break a register on purpose
In broken.yaml, change the owner of tagger from sam@example.com to just sam. Run python risk.py broken.yaml and then print the exit code with echo %errorlevel% in cmd, or echo $LASTEXITCODE in PowerShell. When I ran it, both systems had errors, tagger showed owner is not an email address, and the exit code was 1.
A hint
Look at the check for the at sign in the problems function.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
Made-up company and files. The scan only matches seven package names in a hand-typed list of requirements. The score is a teaching model, not a legal assessment under the EU AI Act.
Up next in Data governance
More in Data governance
- #203 A Business Glossary in YAML With Four Python Checks
- #204 Tag PII Columns in Python, Including a False Positive
- #205 Column-Level Lineage from SQL with SQLGlot
- #208 Right to Erasure Across a Pipeline: Delete, Scan, Restore
- #209 UK GDPR Data Map as Code: A Practical Checklist
- #210 A Data Quality Scorecard That Shows a Hidden Failure
Related videos
- #97 EU AI Act for Developers: A Practical Tier Checklist AI security and governance
- #100 Fake but Realistic Test Data in Python With Faker AI security and governance
- #101 Differential Privacy Basics: Noisy Counts in Python AI security and governance
- #102 Red-Team Your AI Agent With a Checklist AI security and governance
