En este modulo

  1. Why AI ethics is a legal matter
  2. EU guidelines for trustworthy AI
  3. Algorithmic bias: types, detection, and mitigation
  4. Fairness metrics and their trade-offs
  5. Explainability: requirements and XAI techniques
  6. Transparency obligations
  7. AI ethics committees
  8. Responsible AI frameworks
  9. ISO 42001: AI management system
  10. Ejercicio practico
  11. Puntos clave

Why AI ethics is a legal matter

AI ethics is not abstract philosophy. It is quantifiable legal risk. A company that deploys an AI system with racial bias in hiring faces discrimination lawsuits, administrative sanctions, and reputational damage. A bank whose credit scoring algorithm discriminates by gender violates equality regulations and financial regulation. A surveillance system with facial recognition that misidentifies a person can generate government liability.

For lawyers and compliance officers, AI ethics translates into three concrete dimensions:

Ethics and law are not the same

Legal is the minimum. Ethical is the standard. An AI system can be legal yet ethically questionable (or vice versa). The compliance officer must cover both: comply with the law AND ensure ethical practices. When the law has not caught up yet (and in AI, the law always lags), ethics is your guide.

EU guidelines for trustworthy AI

In April 2019, the High-Level Expert Group on AI (AI HLEG) of the European Commission published the "Ethics Guidelines for Trustworthy AI." This document establishes 7 requirements that every AI system must meet to be considered trustworthy. These requirements are the philosophical foundation of the AI Act and the mandatory reference for any AI governance framework in Europe.

The 7 requirements for trustworthy AI

  1. Human agency and oversight. AI systems must support human autonomy and decision-making. They must not manipulate, deceive, or coerce persons. Adequate human oversight must exist: human-in-the-loop (human decides), human-on-the-loop (human supervises), or human-in-command (human can intervene at any time).
  2. Technical robustness and safety. Systems must be resilient to attacks (adversarial attacks), reliable, reproducible, and capable of managing errors safely. Includes a fallback plan: what happens when the system fails.
  3. Privacy and data governance. GDPR and data protection compliance. Training data quality. Integrity and controlled access. Data minimization.
  4. Transparency. Traceability of the system's decisions. Explainability of the results. Clear communication to users that they are interacting with an AI system and what its limitations are.
  5. Diversity, non-discrimination, and fairness. Avoid unfair biases. Universal accessibility. Participation of diverse stakeholders in design and deployment.
  6. Societal and environmental well-being. Consider the system's impact on society and the environment. Sustainability. Impact on employment and skills.
  7. Accountability. Auditability of systems. Reporting and remedy mechanisms. Minimization of negative impacts. Continuous assessment.
Evaluate the following AI system against the EU's 7 requirements
for trustworthy AI:

System: [description of the system, sector, users, data it uses,
decisions it makes or supports]

For each requirement:
1. Current status: COMPLIANT / PARTIAL / NON-COMPLIANT
2. Evidence: what measures currently exist
3. Gaps: what is missing for full compliance
4. Legal risk: what regulation could be breached if not corrected
5. Recommendation: concrete action, owner, deadline

Prioritize recommendations by legal risk (highest to lowest).
Include a summary table at the end.

Algorithmic bias: types, detection, and mitigation

Algorithmic bias is the most tangible ethical problem of AI. It is not an abstract concept: it has real victims. People who do not get a loan, who do not pass a hiring filter, who receive an incorrect medical diagnosis, or who are wrongfully detained by a facial recognition error.

Types of bias in AI systems

Bias detection

Analyze the following AI system to detect potential biases:

System: [description]
Training data: [sources, size, period, variables]
Relevant protected variables: [gender, race/ethnicity, age,
disability, nationality, religion, sexual orientation]
Decisions it makes: [what the system decides or recommends]
Affected population: [who receives the decisions]

Requested analysis:
1. DATA BIAS:
   - Representativeness of each protected group in the data
   - Correlation between proxy variables and protected variables
   - Differential data quality between groups
2. MODEL BIAS:
   - Performance metrics by group (if data is available)
   - Variables with highest weight in the decision: is any a proxy?
3. DEPLOYMENT BIAS:
   - Training population vs actual production population
   - Contexts where the system should not be applied
4. FEEDBACK LOOPS:
   - Does the system's output generate data that feeds back into it?
   - Risk of bias amplification?
5. RECOMMENDATIONS:
   - Technical mitigation (rebalancing, fairness constraints, etc.)
   - Organizational mitigation (audit, HITL, monitoring)
   - Legal mitigation (DPIA, fundamental rights impact assessment)

Mitigation strategies

Bias mitigation operates in three phases of the system lifecycle:

Zero bias does not exist

Every AI system has some degree of bias. The goal is not to eliminate it (impossible), but to manage it: identify it, quantify it, mitigate it to acceptable levels, and monitor it continuously. The standard is not perfection; it is demonstrable diligence.

Fairness metrics and their trade-offs

Measuring the fairness of an AI system is not trivial. Multiple fairness metrics exist, and the problem is they are mutually incompatible in many scenarios. Chouldechova's impossibility theorem (2017) demonstrates that, except in trivial cases, not all definitions of fairness can be satisfied simultaneously.

Main fairness metrics

The inevitable trade-off

A concrete example. A credit scoring system for a bank:

There is no universal correct answer. Metric choice is an ethical and legal decision, not a technical one. The lawyer and compliance officer must participate in that decision, not delegate it to the technical team.

An AI system of [type] uses these fairness metrics:
[list metrics applied]

Relevant protected groups: [list]

Analyze:
1. Which metrics are compatible with each other in this case?
2. Which are mutually exclusive?
3. Which metric is most appropriate according to:
   - Applicable regulation (AI Act, GDPR, sector-specific)
   - Impact on the fundamental rights of those affected
   - Legal risk for the organization
4. How to document the metric choice for an audit
5. What continuous monitoring to implement

Explainability: requirements and XAI techniques

Explainability (Explainable AI, XAI) is the ability of an AI system to provide comprehensible reasons for its decisions. It is not an academic whim: it is a right of EU citizens. Article 22 of the GDPR grants the right not to be subject to automated decisions with significant effects, and Article 15 grants the right to obtain "meaningful information about the logic involved."

Levels of explainability

Main XAI techniques

Explainability vs accuracy

The most accurate models tend to be the least explainable (deep learning, ensembles). The most explainable tend to be less accurate (regressions, simple trees). The AI Act does not require total explainability, but explainability "appropriate to the context and risk." A high-risk system needs more explainability than a low-risk one, even at the cost of some accuracy.

Transparency obligations

Transparency in AI has three dimensions that are often confused:

Transparency evaluation prompt

Evaluate the transparency obligations for this AI system:

System: [description]
Users: [who interacts with it]
Affected persons: [who receives the decisions]
AI Act classification: [high-risk / limited risk / minimal risk]
Sector: [health, finance, employment, education, etc.]

Analyze:
1. INTERACTION TRANSPARENCY:
   - Is the user informed they are interacting with AI? How?
   - Is there AI-generated content? Is it identified?
   - Does it comply with Article 50 AI Act?

2. DECISION TRANSPARENCY:
   - Do affected persons know AI participates in the decision?
   - Can they obtain an explanation of the logic? In what format?
   - Does it comply with Articles 13-15 GDPR?
   - Is there a contestation mechanism?

3. SYSTEM TRANSPARENCY:
   - Does complete technical documentation exist?
   - Are training data documented?
   - Are per-group performance metrics available?
   - Has an impact assessment been conducted?

4. GAPS and RECOMMENDATIONS:
   - What is missing for each level of transparency?
   - Legal priority of each gap
   - Recommended correction timeline

AI ethics committees

An AI ethics committee is the internal body of an organization responsible for evaluating, overseeing, and guiding the ethical use of artificial intelligence. It is not a direct legal requirement of the AI Act, but it is a recommended practice that demonstrates due diligence and that many sector-specific regulations are beginning to require.

Committee composition

An effective ethics committee needs diversity of perspectives. Recommended minimum composition:

Mandate and functions

Draft the Terms of Reference for an AI ethics committee
for an organization of [size] in the [sector] sector.

Include:
1. MISSION AND SCOPE:
   - Which AI systems does it evaluate (all or only high-risk?)
   - What decisions can it make (binding or advisory?)
   - Relationship with the Board/Senior Management

2. COMPOSITION:
   - Permanent members and their profiles
   - Appointment mechanism and tenure
   - Quorum and voting rules

3. FUNCTIONS:
   - Pre-deployment evaluation of AI systems
   - Review of ethical incidents
   - Issuance of internal guidelines
   - Training and awareness
   - Annual AI ethics report

4. EVALUATION PROCESS:
   - Who can request an evaluation?
   - Response timelines
   - Opinion format
   - Escalation mechanism if there is disagreement

5. RESOURCES:
   - Dedicated budget
   - Access to information and systems
   - Technical and legal support

The committee is not a blocker

The greatest risk of a poorly designed ethics committee is that it becomes a bottleneck that blocks innovation. The committee must have clear response timelines (maximum 2-4 weeks), predefined criteria for fast-track evaluation of low-risk systems, and an express channel for emergencies. If the committee takes 3 months to evaluate a customer service chatbot, nobody will consult it.

Responsible AI frameworks

Major technology companies and international organizations have published responsible AI frameworks. Each has a different approach, but they share common principles. Knowing them lets you design your organization's internal framework by taking the best of each.

Microsoft Responsible AI Standard

Microsoft structures its framework around 6 principles: Fairness, Reliability and Safety, Privacy and Security, Inclusiveness, Transparency, Accountability. What differentiates it is its operationalization: each principle has goals, requirements, and concrete tools. It includes a mandatory "Responsible AI Impact Assessment" before launching any AI system. It is the most mature framework in terms of practical implementation.

Google AI Principles

Google published 7 principles in 2018, including 4 areas where it will NOT develop AI (weapons, mass surveillance, technologies violating international law, harmful purposes). Its strength is public transparency: it publishes progress reports and case studies where principles conflicted with business objectives. Its weakness: it has been criticized for the gap between declared principles and actual practices (Timnit Gebru case, 2020).

OECD AI Principles

Adopted by 46 countries, the OECD principles are the international public policy reference. 5 principles: inclusive growth, human-centered values, transparency, robustness and safety, accountability. Their impact: they are the basis of the G7 AI Code of Conduct and have influenced legislation in the EU, Canada, and Japan.

UNESCO Recommendation on AI Ethics

Adopted by 193 countries in November 2021. It is the broadest global normative instrument. It includes 10 principles and specific areas of action for governments. Relevant because many developing countries will use it as the basis for their national legislation.

Comparative for practical implementation

Compare these responsible AI frameworks for my organization:

Organization: [type, size, sector, primary jurisdiction]
AI systems in use or planned: [list]
Applicable regulation: [AI Act, GDPR, sector-specific]

Frameworks to compare:
1. Microsoft Responsible AI Standard
2. Google AI Principles
3. OECD AI Principles
4. IEEE Ethically Aligned Design
5. UNESCO Recommendation on AI Ethics

For each framework:
- Key principles
- Strengths for my organization
- Weaknesses or gaps
- Practical tools it offers
- Compatibility with AI Act / GDPR

Recommendation: which framework (or combination) to adopt and why.
3-phase implementation plan.

ISO 42001: AI management system

ISO/IEC 42001:2023 is the first international standard for artificial intelligence management systems (AIMS). Published in December 2023, it follows the high-level structure (HLS) common to ISO 9001, ISO 27001, and ISO 14001, which facilitates integration with other existing management systems.

ISO 42001 structure

ISO 42001 and the AI Act

ISO 42001 does not guarantee AI Act compliance, but it facilitates it enormously. The AI Act establishes the possibility that harmonized European standards (which CEN/CENELEC is developing) may align with ISO 42001. In practice, an organization certified to ISO 42001 will have significant ground covered for demonstrating AI Act conformity.

Design an ISO 42001 implementation plan for my organization:

Organization: [size, sector, number of AI systems,
existing certifications (ISO 27001, ISO 9001, etc.)]

Generate:
1. GAP ANALYSIS:
   - What do we already have that is compatible with ISO 42001?
   - What do we need to create from scratch?
   - What can we reuse from ISO 27001 / ISO 9001?

2. IMPLEMENTATION PLAN (12 months):
   - Phase 1 (months 1-3): scope definition, policy, inventory
   - Phase 2 (months 4-6): risk assessment, controls
   - Phase 3 (months 7-9): operation, training, documentation
   - Phase 4 (months 10-12): internal audit, correction, certification

3. REQUIRED RESOURCES:
   - Dedicated team
   - External consultancy (yes/no, for what)
   - Estimated budget
   - Tools

4. INTEGRATION:
   - With ISO 27001 (information security)
   - With GDPR / existing DPO
   - With AI Act compliance program

ISO 42001 as a defensive strategy

ISO 42001 certification is the best proof of due diligence in AI ethics. If a regulator investigates your organization over an AI incident, having a certified AIMS demonstrates you had controls, processes, and governance in place. It does not exempt you from liability, but it can significantly reduce penalties.

Ejercicio practico

Ejercicio LG09: Ethical evaluation of an AI system

Scenario: Your organization is about to deploy an AI system to screen candidates in hiring processes. The system analyzes CVs, evaluates compatibility with the role, and generates a candidate ranking.

  1. EU 7-requirement evaluation: Use the evaluation prompt against the EU guidelines. Identify the 3 requirements with the highest non-compliance risk.
  2. Bias analysis: Identify at least 4 types of bias that could affect the system. For each, propose a concrete mitigation measure.
  3. Fairness metric selection: Use this prompt:
    For an AI hiring screening system:
    Protected variables: gender, age, nationality, disability
    
    1. Which fairness metric is most appropriate and why?
    2. What trade-offs does that choice imply?
    3. How do I document the decision for an audit?
    4. What fairness thresholds do I set?
    5. How frequently do I monitor the metrics?
  4. Ethics committee design: Draft the Terms of Reference for your organization's AI ethics committee using the provided prompt. Define composition, functions, and evaluation process.
  5. Transparency plan: Draft the information you would provide to:
    • Candidates (do they know AI participates? How can they contest?)
    • The HR team (how do they interpret the ranking? When must they intervene?)
    • The DPA if it requests information (technical documentation, DPIA)

Puntos clave

Puntos clave from LG09

  1. AI ethics is quantifiable legal risk: sanctions, litigation, reputational damage. It is not optional philosophy.
  2. The EU's 7 requirements for trustworthy AI are the foundation of the AI Act and the mandatory reference for any AI governance framework in Europe.
  3. There are at least 6 types of algorithmic bias. Historical bias and feedback loop bias are the most dangerous because they are self-reinforcing.
  4. Fairness metrics are mutually incompatible. Metric choice is an ethical and legal decision, not a technical one. The lawyer must participate.
  5. Explainability has three levels (global, local, post-hoc). Counterfactual explanations are the most useful for affected citizens.
  6. Transparency obligations operate in three dimensions: interaction (knowing it is AI), decision (knowing why), and system (documentation for regulators).
  7. An AI ethics committee needs diversity (legal, technical, business, external) and must not become a bottleneck.
  8. ISO 42001 is the best defensive strategy: it demonstrates due diligence and facilitates AI Act compliance.
Guia de estudio — Conceptos clave de LG09

Por que la etica de IA es un asunto legal

  • Cumplimiento normativo:el AI Act, el RGPD, la Directiva de responsabilidad por IA y las normativas sectoriales imponen obligaciones especificas de equidad, transparencia y explicabilidad.
  • Gestion de riesgos:los riesgos eticos (sesgo, opacidad, falta de supervision humana) se traducen en riesgos legales (sanciones, litigacion, perdida de licencias) y financieros (dano reputacional, perdida de clientes).
  • Ventaja competitiva:las organizaciones que implementan IA de forma etica y pueden demostrarlo ganan la confianza de clientes, reguladores e inversores. En un mercado donde la desconfianza hacia la IA crece, la etica es diferenciacion.
  • Etica y ley no son lo mismo: Lo legal es el minimo. Lo etico es el estandar. Un sistema de IA puede ser legal y aun asi ser etico cuestionable (o viceversa). El compliance officer debe cubrir ambos: cumplir la ley Y garantizar practicas eticas. Cuando la ley no ha llegado todavia (y en IA, la ley siempre va detras), la etica es tu guia.

Directrices europeas para una IA fiable

  • Agencia humana y supervision (Human Agency and Oversight).Los sistemas de IA deben apoyar la autonomia humana y la toma de decisiones. No deben manipular, enganar ni coaccionar a las personas. Debe existir supervision humana adecuada: human-in-the-loop (humano decide), human-on-the-loop (humano supervisa) o human-in-command (humano puede intervenir en cualquier momento).
  • Robustez tecnica y seguridad (Technical Robustness and Safety).Los sistemas deben ser resilientes ante ataques (adversarial attacks), fiables, reproducibles y capaces de gestionar errores de forma segura. Incluye un plan de fallback: que pasa cuando el sistema falla.
  • Privacidad y gobernanza de datos (Privacy and Data Governance).Cumplimiento con RGPD y normativa de proteccion de datos. Calidad de los datos de entrenamiento. Integridad y acceso controlado. Minimizacion de datos.
  • Transparencia (Transparency).Trazabilidad de las decisiones del sistema. Explicabilidad de los resultados. Comunicacion clara a los usuarios de que estan interactuando con un sistema de IA y cuales son sus limitaciones.
  • Diversidad, no discriminacion y equidad (Diversity, Non-discrimination and Fairness).Evitar sesgos injustos. Accesibilidad universal. Participacion de stakeholders diversos en el diseno y despliegue.
  • Bienestar social y medioambiental (Societal and Environmental Well-being).Considerar el impacto del sistema en la sociedad y el medio ambiente. Sostenibilidad. Impacto en el empleo y las habilidades.

Sesgo algoritmico: tipos, deteccion y mitigacion

  • Sesgo historico:los datos de entrenamiento reflejan discriminaciones del pasado. Si un sistema de seleccion se entrena con datos de contrataciones de los ultimos 20 anos de una empresa que sistematicamente contrataba menos mujeres en puestos tecnicos, el sistema replicara esa discriminacion. El caso Amazon de 2018 es el ejemplo canonico.
  • Sesgo de representacion:determinados grupos estan infra o sobrerepresentados en los datos. Un sistema de reconocimiento facial entrenado mayoritariamente con rostros caucasicos tendra peor rendimiento con personas de piel oscura. El estudio de Joy Buolamwini (Gender Shades, 2018) demostro tasas de error del 34.7% para mujeres de piel oscura frente al 0.8% para hombres de piel clara.
  • Sesgo de medicion:las variables proxy capturan informacion que no deberian. El codigo postal como predictor de riesgo crediticio es un proxy de raza y nivel socioeconomico. El sistema no usa la raza directamente, pero la codifica indirectamente.
  • Sesgo de evaluacion:las metricas de rendimiento del sistema no capturan el impacto diferencial entre grupos. Un sistema puede tener un 95% de precision global pero un 70% para un grupo minoritario.
  • Sesgo de despliegue:el sistema funciona correctamente en el entorno para el que fue disenado, pero se aplica en un contexto diferente donde sus supuestos no son validos.
  • Sesgo de feedback loop:el sistema genera datos que se usan para reentrenarlo, amplificando los sesgos iniciales. La policia predictiva es el ejemplo clasico: mas vigilancia en un barrio genera mas detenciones, que alimentan el modelo para predecir mas delincuencia en ese barrio.

Metricas de equidad y sus trade-offs

  • Demographic Parity (Paridad demografica):la proporcion de resultados positivos es la misma para todos los grupos. Si el 30% de los hombres obtiene el prestamo, el 30% de las mujeres tambien debe obtenerlo. Problema: ignora si la cualificacion real difiere entre grupos.
  • Equalized Odds (Igualdad de oportunidades):la tasa de verdaderos positivos y falsos positivos es la misma para todos los grupos. El sistema acierta (y se equivoca) con la misma frecuencia para hombres y mujeres. Problema: puede requerir sacrificar precision global.
  • Predictive Parity (Paridad predictiva):la precision de las predicciones positivas es la misma para todos los grupos. Si el sistema dice "aprobado", la probabilidad de que sea correcta es la misma independientemente del grupo. Problema: puede generar tasas de falsos negativos dispares.
  • Individual Fairness (Equidad individual):individuos similares reciben tratamientos similares. Problema: definir "similar" es subjetivo y requiere una metrica de distancia que puede ser sesgada en si misma.
  • Counterfactual Fairness (Equidad contrafactual):la decision seria la misma si el individuo perteneciera a otro grupo protegido. "Si esta persona fuera hombre en lugar de mujer, obtendria el mismo resultado?" Problema: requiere modelar un mundo contrafactual, lo cual es complejo.
  • Si aplicas demographic parity, apruebas el mismo porcentaje de prestamos para cada grupo etnico. Pero si un grupo tiene historicamente peor capacidad de pago (por desigualdad estructural, no por capacidad inherente), el banco asumira mas riesgo con ese grupo.

Explicabilidad: requisitos y tecnicas XAI

  • Transparencia global:el modelo es comprensible en su totalidad. Una regresion lineal con 5 variables es transparente: puedes ver exactamente como cada variable contribuye al resultado. Un modelo de deep learning con millones de parametros no lo es.
  • Explicabilidad local:para una decision concreta, puedes explicar por que el sistema llego a esa conclusion. "Su solicitud de prestamo fue denegada porque su ratio de endeudamiento (42%) supera el umbral (35%) y su historial crediticio tiene 2 incidencias en los ultimos 12 meses."
  • Interpretabilidad post-hoc:tecnicas que generan explicaciones aproximadas de modelos opacos. No explican como funciona realmente el modelo, sino que proporcionan una aproximacion comprensible.
  • LIME (Local Interpretable Model-agnostic Explanations):genera un modelo simple (lineal) que aproxima el comportamiento del modelo complejo en el entorno de una decision concreta. "Para este paciente, los factores mas relevantes fueron: edad (40%), presion arterial (25%) y colesterol (20%)."
  • SHAP (SHapley Additive exPlanations):basado en teoria de juegos, asigna a cada variable su contribucion marginal al resultado. Mas robusto que LIME, pero mas costoso computacionalmente.
  • Attention maps:en modelos de lenguaje y vision, muestran que partes del input recibieron mas "atencion" del modelo. "El sistema detecto fraude porque se fijo en la hora de la transaccion (3:47 AM) y la localizacion (diferente al pais habitual)."

Obligaciones de transparencia

  • Transparencia de interaccion:la persona debe saber que esta interactuando con un sistema de IA, no con un humano. El AI Act (articulo 50) obliga a informar a los usuarios cuando interactuan con chatbots, contenido generado por IA (deepfakes, texto sintetico) o sistemas de categorizacion biometrica.
  • Transparencia de decision:la persona afectada por una decision automatizada tiene derecho a saber que un sistema de IA participo en esa decision, que datos se usaron y cual fue la logica aplicada (RGPD, articulos 13-15).
  • Transparencia de sistema:las autoridades reguladoras deben poder acceder a la documentacion tecnica del sistema, sus datos de entrenamiento, sus metricas de rendimiento y sus evaluaciones de impacto. Esto es lo que el AI Act exige para sistemas de alto riesgo.
  • Se informa al usuario de que interactua con IA? Como?
  • Hay contenido generado por IA? Se identifica?
  • Cumple articulo 50 AI Act?

Siguiente: LG10 - Project: AI Act Compliance in Your Company

You have mastered the ethics and governance fundamentals. Now let us put it all together: a step-by-step practical project to create a complete AI Act compliance program for your organization.

Ir al modulo LG10