Agents and perception · Medium · 20 min

EU AI Act: classify your system as a decision function

Regulation (EU) 2024/1689 classifies by use, not by technology. Write the order of questions: Article 5, Article 6 and Article 50.

Each item in CASES describes a system with facts a person has already decided: which Article 5 practices it carries out, whether it is a safety component of an Annex I product with third-party conformity assessment (annexI), which Annex III areas its use falls in, which Article 6(3) exception it claims, whether it profiles people, and what it does that Article 50 covers. Your function does not decide those facts; it applies the order of the Regulation.

Write classify(system), which returns { tier, articles }:

  1. If any of its practices is in PROHIBITED, the tier is 'prohibited' and articles lists 'Art. 5(1)(letter)' for each one, in alphabetical order with no repeats. Nothing else is looked at.
  2. If annexI is true, it is high-risk by 'Art. 6(1)'.
  3. If annexIII holds any valid area (1 to 8), it is high-risk by 'Art. 6(2)'. Exception: when exception is 'a', 'b', 'c' or 'd' and profiling is false, it is not high-risk and 'Art. 6(3)' and 'Art. 6(4)' are added (the assessment has to be documented). With profiling the exception never holds.
  4. Then, in this order: chatbot adds 'Art. 50(1)', generates adds 'Art. 50(2)', emotionOrBiometric adds 'Art. 50(3)' and deepfake adds 'Art. 50(4)'. A high-risk system carries them too.
  5. tier is 'high-risk' when step 2 or 3 says so; otherwise 'transparency' when any paragraph of Article 50 applies; otherwise 'other'.

Missing fields count as empty or false. This is a programming exercise on the structure of the law, not legal advice.

Challenges 0/5

  • A prohibited practice decides the tier and cites its Article 5 letter
  • Annex III and safety components: high-risk under Article 6
  • The Article 6(3) exception does not hold when there is profiling
  • Article 50 adds up by paragraph, on top of high-risk too
  • The six sample cases and an empty object

function classify(system) {
  // 1. any practice listed in PROHIBITED: tier 'prohibited', articles 'Art. 5(1)(letter)', sorted, no repeats
  // 2. annexI: high-risk by 'Art. 6(1)'
  // 3. a valid Annex III area: high-risk by 'Art. 6(2)', unless a valid exception (a to d) applies
  //    and there is no profiling; then it is not high-risk and the articles are 'Art. 6(3)', 'Art. 6(4)'
  // 4. Article 50, in any tier except prohibited: chatbot (1), generates (2), emotionOrBiometric (3), deepfake (4)
  // 5. tier: 'high-risk', else 'transparency' when Article 50 applies, else 'other'
  return { tier: system.chatbot ? 'transparency' : 'other', articles: [] };
}

for (const c of CASES) console.log(c.name, '->', JSON.stringify(classify(c)));

Tab indents, Ctrl+Z undoes. To leave the editor with the keyboard: Esc, then Tab.

Console output appears here (console.log).

Why this matters

Anyone building an HR assistant, an application sorter or a chatbot needs to know early which tier it falls in, because the documentation, the human oversight and what users must be told all depend on it. Writing the classification as a function forces you to separate the facts, which a person decides, from the order of the questions, which the Regulation fixes. It also exposes the most common mistake: believing that a "small" task takes a system that profiles people out of high-risk. To go through your own case question by question, use our AI Act checker.

The idea

Regulation (EU) 2024/1689 does not ask which model you use. It asks what the system is used for, and it does so in an order that can be written as code. First, Article 5: eight practices that may not be placed on the market, put into service or used, among them social scoring, subliminal manipulation, and inferring emotions at work and in education institutions. If your system does one, there is no second step.

Then, Article 6. A system is high-risk by two routes: because it is a safety component of a product covered by the legislation in Annex I that requires a third-party conformity assessment (Article 6, paragraph 1), or because its use appears in one of the eight areas of Annex III (paragraph 2): biometrics, critical infrastructure, education, employment, essential services, law enforcement, migration and justice. The area alone is not enough; the annex lists specific uses inside each one.

Paragraph 3 opens a way out: an Annex III system is not high-risk if it poses no significant risk, which is accepted when it meets one of four conditions: it (a) performs a narrow procedural task, (b) improves the result of a human activity already completed, (c) detects decision-making patterns without replacing the human assessment, or (d) performs a preparatory task. The way out has a lock: if the system profiles natural persons, it is always high-risk. And whoever relies on it must document their assessment before placing the system on the market, and register it (paragraph 4).

Lastly, Article 50 imposes transparency regardless of the above: say that people are talking to an AI, mark synthetic content, inform anyone exposed to emotion recognition or biometric categorisation, and disclose deep fakes. The labels "limited risk" and "minimal risk" you will see in many guides do not appear in the text: they are a way of summarising. General-purpose models have their own chapter (Chapter V) and stay outside this function, as does Article 4, which asks providers and deployers for AI literacy whatever the tier.

Run it on your machine

Ask your local model the same question (ollama pull llama3.1:8b if you do not have it, or change the name) and compare its answer with your function's. A model can get the tier right and cite an article that does not say that: the reference is the text of the Regulation, not the model.

python3 -c "
import json, urllib.request
caso = 'Un sistema que ordena los curriculos recibidos y descarta candidatos automaticamente.'
prompt = 'Reglamento (UE) 2024/1689. Clasifica este sistema como prohibited, high-risk, transparency u other y cita el articulo en que te basas. Responde SOLO con JSON {\"tier\": \"...\", \"articulo\": \"...\"}. Sistema: ' + caso
body = {'model': 'llama3.1:8b', 'prompt': prompt, 'stream': False, 'format': 'json', 'options': {'temperature': 0}}
req = urllib.request.Request('http://localhost:11434/api/generate', data=json.dumps(body).encode(), headers={'content-type': 'application/json'})
print('Tu modelo:', json.loads(json.load(urllib.request.urlopen(req))['response']))
print('Tu funcion: high-risk por el Art. 6(2), anexo III, punto 4 (empleo)')
"

Check what you learned

1. What do you check first when classifying a system?
2. A tool ranks CVs by building a profile of each candidate. The provider claims it only performs a "narrow procedural task". Is it high-risk?
3. A customer-support chatbot outside Annex III: what duty of its own does it have?
4. A provider concludes that its Annex III system is not high-risk under Article 6(3). What must it do?

Go deeper: the related guide →

This in production, with your data? Let's talk for 15 minutes →