En este modulo

  1. The GRC problem in 2026
  2. Regulatory frameworks: ENS, NIS2, DORA, ISO 27001
  3. Control mapping with AI
  4. Automated gap analysis
  5. Audit preparation with AI
  6. Policy and procedure generation
  7. Continuous compliance monitoring
  8. GRC tools with AI
  9. Ejercicio practico
  10. Puntos clave

The GRC problem in 2026

A European company in the financial sector must simultaneously comply with ENS (if it works with the Spanish public administration), NIS2 (European cybersecurity directive), DORA (digital operational resilience for the financial sector), ISO 27001 (if it seeks certification), GDPR (data protection) and, potentially, the EU AI Act (if it uses AI systems). That means hundreds of controls, many overlapping across frameworks.

The compliance department of an average company has between 1 and 5 people. Keeping documentation up to date, preparing audits, tracking findings, mapping controls across frameworks and generating evidence is work that consumes thousands of hours per year. Most of it goes to bureaucratic tasks, not to improving actual security.

AI does not replace the CISO or the compliance team. What it does is eliminate mechanical work: automatically mapping controls across frameworks, identifying compliance gaps, generating policy drafts and preparing audit documentation. The human team reviews, adjusts and makes decisions.

The compliance paradox

The most audited companies are not necessarily the most secure. An organization can have all controls documented (in a 2,000-row Excel) and be vulnerable because nobody verifies whether those controls actually work. AI can help close that gap: from paper compliance to real compliance.

Regulatory frameworks: ENS, NIS2, DORA, ISO 27001

ENS (Esquema Nacional de Seguridad)

Mandatory for every Spanish public sector entity and for companies providing them technological services. Three levels (basic, medium, high) with increasing controls. ENS High requires 75 security measures organized in 3 frameworks (organizational, operational, protection).

What AI automates in ENS:

NIS2 (Network and Information Security Directive 2)

European directive in force since October 2024, with national transposition in each member state. Applies to essential and important entities in 18 sectors (energy, transport, banking, health, water, digital, public administration, space, food, chemicals, manufacturing, postal, waste, research). Penalties can reach 10M EUR or 2% of global turnover.

Key obligations AI can automate:

DORA (Digital Operational Resilience Act)

Specific to the European financial sector. In force since January 2025. Focuses on digital operational resilience: ICT risk management, resilience testing (including threat-led penetration testing), ICT third-party risk management, threat intelligence sharing.

ISO 27001:2022

The international standard for information security management systems (ISMS). 93 controls in 4 categories (organizational, people, physical, technological). ISO 27001 certification has become a de facto requirement for selling B2B services to large enterprises.

Control mapping with AI

The biggest headache in GRC is that each framework has its own controls, but many overlap. The "access control policy" control appears in ENS (mp.ac), NIS2 (Art. 21.2), DORA (Art. 9) and ISO 27001 (A.5.15, A.8.3). Without mapping, the team documents the same thing 4 times.

Automated mapping with LLMs

An LLM can compare controls from different frameworks and determine whether they are equivalent, partially overlapping or independent:

# Control mapping between frameworks with LLM
CONTROL_MAPPING_PROMPT = """
You are a GRC expert with deep knowledge of ENS, NIS2, DORA and ISO 27001.

Given the following control from {framework_source}:
Control ID: {control_id}
Title: {control_title}
Description: {control_description}

Identify all equivalent or partially equivalent controls in
{framework_target}. For each mapping, indicate:
- Target control ID
- Target control title
- Degree of equivalence: "complete" (covers the same), "partial" (overlap),
  "complementary" (related but different)
- Key differences between both controls
- Evidence that serves both controls

JSON format:
{
  "mappings": [
    {
      "source": {"framework": "ENS", "id": "mp.ac.1", "title": "..."},
      "target": {"framework": "ISO27001", "id": "A.5.15", "title": "..."},
      "equivalence": "complete|partial|complementary",
      "differences": "...",
      "shared_evidence": ["..."]
    }
  ]
}
"""

Unified Control Framework (UCF)

The result of mapping is a unified framework owned by the organization: a catalog of controls where each control has cross-references to all applicable frameworks. This way, when evidence is documented, it covers multiple frameworks simultaneously.

Example of a unified control:

Control UCF-AC-001: Access control policy
├── ENS:       mp.ac.1 (Access control)
├── NIS2:      Art. 21.2.d (Supply chain security)
├── DORA:      Art. 9.4 (Access rights management)
├── ISO 27001: A.5.15 (Access control), A.8.3 (Access restriction)
├── GDPR:      Art. 32 (Security of processing)
├── Shared evidence:
│   ├── Access control policy (document)
│   ├── Roles and permissions matrix (IAM export)
│   ├── Access review log (last quarter)
│   └── User provisioning/deprovisioning procedure
└── Status: Compliant (last review: 2026-05-15)

ROI of unified mapping

An organization complying with 4 frameworks may have 300+ controls. With a well-built UCF, they reduce to 120-150 unique controls. That is 50-60% less documentation and audit work.

Automated gap analysis

Gap analysis compares what the framework requires with what the organization has implemented. Traditionally it is a weeks-long manual process: review each control, speak with the responsible parties, verify evidence.

Gap analysis with AI

An AI system can automate much of the process:

  1. Automated control inventory. Scan the infrastructure to verify: MFA enabled? Encryption at rest active? Centralized logs? Scheduled backups? Patching up to date? This can be automated with APIs from the systems themselves (AWS Config, Azure Policy, Supabase management API).
  2. Comparison with framework requirements. The LLM compares the collected evidence with each control's requirements and determines: compliant, partially compliant, non-compliant.
  3. Gap prioritization. Not all gaps are equal. AI prioritizes by risk (what happens if this control fails?), remediation effort (how much does it cost to implement?) and regulatory impact (is it a critical control for certification?).
  4. Remediation plan. For each gap, the LLM suggests concrete actions, estimated timelines and owners.
# Automated gap analysis
def run_gap_analysis(organization, framework):
    controls = framework.get_controls()
    results = []

    for control in controls:
        # 1. Collect automated evidence
        auto_evidence = collect_automated_evidence(control, organization)

        # 2. Search existing documentation
        docs = search_documentation(control, organization.doc_repository)

        # 3. LLM evaluates compliance
        assessment = llm.assess_compliance(
            control=control,
            evidence=auto_evidence,
            documentation=docs,
            organization_context=organization.profile
        )

        results.append({
            "control_id": control.id,
            "status": assessment.status,  # compliant | partial | non_compliant
            "confidence": assessment.confidence,
            "gaps": assessment.gaps,
            "remediation": assessment.remediation_plan,
            "effort_estimate": assessment.effort_hours,
            "risk_if_unaddressed": assessment.risk_level
        })

    return sorted(results, key=lambda r: r["risk_if_unaddressed"], reverse=True)

Audit preparation with AI

Preparing an audit (internal or certification) consumes between 2 and 6 weeks of the compliance team's time. Most of it goes to: collecting evidence, organizing documentation, preparing interviews and anticipating findings.

Preparation automation

Evidence collection. An AI agent can automatically traverse systems and collect the evidence the auditor will ask for: firewall configuration exports, access review logs, training records, security committee minutes, patching metrics, business continuity test results.

Documentation organization. The LLM generates a documentation index aligned with the framework structure, where each control has its folder with the corresponding evidence, labeled and dated.

Audit simulation. An LLM can act as an auditor and ask the typical questions an auditor would ask for each control. This lets the team rehearse answers and detect weaknesses before the actual audit.

Finding anticipation. Based on the gap analysis, AI identifies the points where the auditor will likely find non-conformities and suggests preventive actions.

Policy and procedure generation

Each framework requires a set of documented policies. ISO 27001 requires at least 15 mandatory policies. ENS High adds more. Writing a security policy from scratch takes between 8 and 40 hours depending on complexity.

LLMs as policy drafters

A well-configured LLM can generate policy drafts that cover 80% of the final content. The human analyst reviews, adjusts to the organization's specific context and approves.

POLICY_GENERATION_PROMPT = """
Generate a {policy_type} policy for {organization_name}.

Organization context:
- Sector: {sector}
- Size: {employee_count} employees
- Applicable frameworks: {frameworks}
- ENS level: {ens_level}
- Specific requirements: {special_requirements}

The policy must include:
1. Purpose and scope
2. Regulatory references (specific articles from each applicable framework)
3. Definitions and terms
4. Roles and responsibilities
5. Specific guidelines (minimum 8)
6. Exceptions and exception approval process
7. Sanctions for non-compliance
8. Review and update (frequency, responsible)
9. Version history

Format: professional, clear and direct language, no ambiguities.
Tone: normative (using "shall", "must", not "should" or "may").
Length: 3-6 pages.
"""

Policies LLMs generate well

Continuous compliance monitoring

Compliance is not a project done once a year before the audit. It is a continuous process. AI enables the shift from point-in-time audits to continuous monitoring.

Automated compliance indicators

A dashboard with these indicators, updated in real time, lets the CISO see compliance status at a glance instead of waiting for the next quarterly report.

GRC tools with AI

Ejercicio practico

Ejercicio TS03: Automated GRC with AI
  1. Choose a framework (ENS High, ISO 27001 or NIS2) and list its 10 most critical controls.
  2. For each control, define: what evidence is needed? Can it be obtained automatically? From what system?
  3. Use an LLM to map the 10 controls from your framework to equivalent controls in a second framework. Evaluate the mapping quality.
  4. Generate a complete policy with an LLM (e.g., incident management policy). Review the draft: what percentage is directly usable? What needs adjustment?
  5. Design a continuous compliance dashboard with 5 automated indicators and define the data source for each.
  6. Bonus: create a "simulated auditor" prompt that asks audit questions for a specific control and evaluates the answers.

Puntos clave

Puntos clave from TS03

  1. Manual GRC does not scale. With 4+ simultaneous frameworks, AI is necessary for mapping controls, identifying gaps and generating documentation.
  2. A Unified Control Framework reduces documentation work by 50-60% by eliminating duplications across frameworks.
  3. LLMs generate policy drafts covering 80% of the final content. The human reviews and contextualizes.
  4. Automated gap analysis combines technical scanning (implemented controls) with LLM evaluation (compliance with requirements).
  5. Continuous compliance (real-time dashboard) is more effective than annual point-in-time audits.
  6. In ENS High environments, GRC tools must work with data in the EU and self-hosted LLMs.
Guia de estudio — Conceptos clave de TS03

El problema de GRC en 2026

  • La paradoja del compliance: Las empresas mas auditadas no son necesariamente las mas seguras. Una organizacion puede tener todos los controles documentados (en un Excel de 2.000 filas) y ser vulnerable porque nadie verifica si esos controles funcionan realmente. La IA puede ayudar a cerrar esa brecha: del compliance documental al compliance real.

Frameworks regulatorios: ENS, NIS2, DORA, ISO 27001

  • Categorizacion automatica de sistemas segun la valoracion de dimensiones (disponibilidad, integridad, confidencialidad, autenticidad, trazabilidad).
  • Seleccion de medidas de seguridad aplicables segun el nivel.
  • Generacion de la Declaracion de Aplicabilidad (SOA).
  • Seguimiento del Plan de Adecuacion.
  • Analisis de riesgos y politicas de seguridad de los sistemas de informacion.
  • Gestion de incidentes (incluyendo notificacion en 24h a CSIRT/autoridad competente).

Mapeo de controles con IA

  • ID del control destino
  • Titulo del control destino
  • Grado de equivalencia: "completo" (cubre lo mismo), "parcial" (solapamiento),
  • Diferencias clave entre ambos controles
  • Evidencias que sirven para ambos controles
  • ROI del mapeo unificado: Una organizacion que cumple con 4 frameworks puede tener 300+ controles. Con un UCF bien construido, se reducen a 120-150 controles unicos. Eso es un 50-60% menos de trabajo de documentacion y auditoria.

Gap analysis automatizado

  • Inventario automatico de controles implementados.Escanear la infraestructura para verificar: MFA habilitado? Cifrado en reposo activo? Logs centralizados? Backups programados? Parcheado al dia? Esto se puede automatizar con APIs de los propios sistemas (AWS Config, Azure Policy, Supabase management API).
  • Comparacion con requisitos del framework.El LLM compara las evidencias recopiladas con los requisitos de cada control y determina: conforme, parcialmente conforme, no conforme.
  • Priorizacion de gaps.No todos los gaps son iguales. La IA prioriza segun riesgo (que pasa si este control falla?), esfuerzo de remediacion (cuanto cuesta implementarlo?) e impacto regulatorio (es un control critico para la certificacion?).
  • Plan de remediacion.Para cada gap, el LLM sugiere acciones concretas, plazos estimados y responsables.

Preparacion de auditorias con IA

  • Recopilacion de evidencias. Un agente de IA puede recorrer automaticamente los sistemas y recopilar las evidencias que el auditor va a pedir: exports de configuracion de firewalls, logs de revision de accesos, registros de formacion, actas de comite de seguridad, metricas de parcheo, resultados de tests de continuidad.
  • Organizacion de documentacion. El LLM genera un indice de documentacion alineado con la estructura del framework, donde cada control tiene su carpeta con las evidencias correspondientes, etiquetadas y fechadas.
  • Simulacion de auditoria. Un LLM puede actuar como auditor y hacer las preguntas tipicas que un auditor haria para cada control. Esto permite al equipo ensayar respuestas y detectar debilidades antes de la auditoria real.
  • Anticipacion de hallazgos. Basandose en el gap analysis, la IA identifica los puntos donde el auditor probablemente encontrara no conformidades y sugiere acciones preventivas.

Generacion de politicas y procedimientos

  • Sector: {sector}
  • Tamano: {employee_count} empleados
  • Frameworks aplicables: {frameworks}
  • Nivel ENS: {ens_level}
  • Requisitos especificos: {special_requirements}
  • Politica de control de acceso y gestion de identidades.

Siguiente: TS04 - OWASP LLM Top 10

So far we have seen how AI helps security. Now let us see how AI can be attacked: the 10 most critical vulnerabilities of language models.

Ir al modulo TS04