EU AI Act AI-First Compliance & Engineering Skill
Help engineers understand Regulation (EU) 2024/1689 (EU AI Act), inspect real codebases and CI/CD pipelines without manual checklists or static manifests, surface article-traceable gaps, generate evidence-backed compliance documentation, and wire in engineering toolkits.
Mandatory Framing: Every assessment, gap report, or generated document is engineering readiness support—not legal advice or formal conformity certification. Explicitly flag items that require legal counsel review.
Progressive Disclosure Map
Load only the reference files needed for the user's request and the codebase you inspect:
- Scope, roles, open-source rules, Art. 25 role shifts: references/roles-and-scope.md
- Prohibited practices (Art. 5) & red flags: references/prohibited-art5.md
- High-risk classification (Art. 6, Annex I & III, Art. 6(3) derogation): references/high-risk-classification.md
- High-risk provider obligations (Arts. 8–17, Annex IV, conformity, Art. 72–73): references/high-risk-obligations.md
- General-Purpose AI (GPAI) models (Arts. 51–55, Annex XI/XII): references/gpai-obligations.md
- Transparency & synthetic content (Art. 50): references/transparency-art50.md
- Deployer obligations, FRIA & AI literacy (Art. 4, 26, 27): references/deployer-and-literacy.md
Compliance document templates (populate with real codebase evidence, never leave boilerplate placeholders unflagged):
- resources/gap-assessment-report.md
- resources/annex-iv-technical-doc.md
- resources/risk-management-register.md
- resources/fria-template.md
Modern-stack integrations & engineering toolkits (relative to repo root):
- Standards-first modern-stack integrations (check first!):
../../integrations/README.md(OpenTelemetry GenAI, C2PA, OpenFeature, LangGraph/Temporal, Promptfoo, Next.js/Vercel AI SDK, FastAPI, Langfuse) - Fallback language-agnostic specs (any language):
../../toolkits/specs/ - Fallback zero-dependency Python package:
../../toolkits/python/eu_ai_act_kit/ - Fallback zero-dependency TypeScript package:
../../toolkits/typescript/src/
Choose the Active Mode
Determine which mode(s) match the user's request (you may combine them in a single workflow):
Mode 1: Explain & Orient
When the user asks how the EU AI Act works or whether a concept applies:
- Load the relevant reference file(s) from
./references/. - Translate legal Articles into concrete software engineering impacts (architecture, data, logging, UI, CI/CD, governance).
- Always cite exact Articles/Annexes (e.g.,
Art. 12(1),Annex III §4(a)).
Mode 2: AI-First Codebase & CI/CD Audit (Core Workflow)
When asked to assess a repository, find compliance gaps, or review an AI system:
Step 1 — Automated Codebase & CI/CD Discovery
Inspect the repository directly before asking questions. Look for concrete evidence across:
- AI/ML Surface Area:
- Dependencies (
pyproject.toml,requirements*.txt,package.json,Cargo.toml,go.mod,pom.xml) for LLM/ML SDKs (openai,anthropic,google-genai,langchain,llamaindex,transformers,torch,scikit-learn,onnxruntime,vllm,litellm,face_recognition,mediapipe, etc.). - Model inference calls, system prompts, agent loops, tool/function calling, RAG pipelines, fine-tuning/training scripts, and weight files.
- Dependencies (
- Domain & Use-Case Signals:
- Endpoints, database schemas, UI labels, READMEs, and prompt instructions revealing domain (HR/recruiting, credit/scoring, healthcare, biometrics, education, content moderation, customer chatbot, image/audio/video generation, autonomous actions).
- Engineering Controls Already Present:
- Logging & auditability (Art. 12): Structured logs, immutable/hash-chained storage, retention configs, PII redaction, trace IDs.
- Versioning & lineage (Art. 11 / Annex IV): Pinned model IDs (not floating aliases like
latest), prompt versioning, dataset cards/hashes, eval benchmark results. - Transparency (Art. 50): User-facing AI disclosures in UI/APIs, synthetic media metadata/watermarking (C2PA, headers, labels).
- Human oversight (Art. 14): Confidence thresholds, human approval workflows, override hooks, feature flags / kill switches.
- Robustness & security (Art. 15): Input validation, prompt-injection guards, rate limits, fallback handling, adversarial/red-team tests.
- Data governance (Art. 10): Training/eval dataset lineage, bias/fairness checks, consent/PII handling.
- CI/CD & Release Governance:
- Inspect
.github/workflows/,.gitlab-ci.yml,Jenkinsfile,Dockerfile,Makefile, pre-commit hooks, and evaluation scripts. - Check whether model/prompt changes trigger automated evaluations, safety/regression tests, dependency security scans, and versioned artifact publishing.
- Inspect
Step 2 — Targeted Context Questions (Only What Code Cannot Answer)
Ask only concise questions that cannot be inferred from the repo (group into 3–5 bullets max):
- Will the system or its outputs be used in the EU? (Art. 2(1))
- Are you releasing this as a commercial product/service, internal tool, or open-source project? (Art. 2(12), Art. 3)
- Are you modifying/fine-tuning a third-party model or building on a third-party API? (Art. 25 role-shift check)
- Who makes final decisions—fully automated, or human-reviewed? (Art. 6(3), Art. 14)
(If the user asks for an immediate best-effort audit without back-and-forth, proceed with explicitly labeled [ASSUMPTION] tags.)
Step 3 — Classify Role, Scope & Risk Tier
Load roles-and-scope.md, prohibited-art5.md, and whichever tier references apply (high-risk-classification.md, gpai-obligations.md, transparency-art50.md, deployer-and-literacy.md). Determine:
- Territorial & Material Scope (and whether any Art. 2 exclusion applies).
- Operator Role(s): Provider, Deployer, Importer, Distributor, or Art. 25 Role-Shifted Provider.
- Risk Tier(s): Prohibited red flags (check first!), High-Risk (Annex I / Annex III + Art. 6(3) derogation check), GPAI model, Limited/Transparency (Art. 50), or Minimal Risk (+ Art. 4 AI literacy).
Step 4 — Article-Traceable Gap Analysis
For every applicable obligation, compare against actual codebase & CI/CD evidence. Produce a structured report following resources/gap-assessment-report.md with:
- Status:
Compliant (Code Evidence)|Partial|Gap|Needs Legal/Process Review - Legal Basis: Exact Article, paragraph, and Annex citation.
- Codebase / CI Evidence: Exact file paths and line ranges inspected (never guess or fabricate).
- Concrete Remediation: Specific code, doc, or CI/CD change—referencing the matching toolkit or spec in
toolkits/. - Priority:
P0 Blocker(Art. 5 red flags / hard compliance blockers) →P1 High→P2 Medium→P3 Recommended.
Mode 3: Documentation Generation
When asked to draft compliance documentation:
- Run Step 1 discovery first so every section is grounded in real code, models, endpoints, and CI/CD pipelines.
- Use the templates in
./resources/:- High-Risk Technical Documentation →
annex-iv-technical-doc.md(Art. 11 & Annex IV) - Risk Management Register →
risk-management-register.md(Art. 9) - Deployer Fundamental Rights Impact Assessment →
fria-template.md(Art. 27)
- High-Risk Technical Documentation →
- Clearly mark any non-code organizational fields (e.g., EU authorized representative, notified body, legal sign-off) as
[TODO: Legal/Org Input Required].
Mode 4: Engineering Remediation & Stack-First Integration
When asked to fix gaps or implement compliance controls, prefer integrating with the repo's existing modern stack rather than forcing bespoke libraries:
- Step 1 — Check Existing Modern Stack First (
../../integrations/):- Already using OpenTelemetry / Datadog / Arize / Grafana / Langfuse? Wire in
integrations/opentelemetry-genai/(EuAiActSpanProcessor+ WORM retention) instead of replacing observability with a local file logger. - Generating images, audio, or video (Art. 50(2))? Use
integrations/c2pa-provenance/(C2PA Content Credentials withtrainedAlgorithmicMedia) alongside visible labels. - Already using OpenFeature / LaunchDarkly / Flagsmith / PostHog / LangGraph / Temporal? Wire in
integrations/openfeature-hitl/(OpenFeatureKillSwitchStore+ durableinterrupt()/ signal HITL). - Need Art. 9 & 15 pre-release eval gates in CI? Adapt
integrations/promptfoo-eval-gate/promptfooconfig.eu-ai-act.yaml. - Built on Next.js + Vercel AI SDK, FastAPI, or Langfuse? Follow
integrations/vercel-ai-and-fastapi/README.md.
- Already using OpenTelemetry / Datadog / Arize / Grafana / Langfuse? Wire in
- Step 2 — Fallback to Zero-Dependency Toolkits or Language-Agnostic Specs (
../../toolkits/): Where the repo has no existing stack tool (or needs EU-AI-Act-specific primitives like tamper-evident hash chaining, Art. 73 statutory deadline tracking, or Annex IV changelog export), match the gap to:- Art. 12 / Art. 19 Logging, Retention & Traceability →
toolkits/specs/logging-traceability.md - Art. 11 / Annex IV Model, Prompt & Dataset Versioning →
toolkits/specs/versioning-lineage.md - Art. 50 Transparency, EU Locales & Web Middleware →
toolkits/specs/transparency-disclosure.md - Art. 14 Human Oversight, Reversal & Kill Switch →
toolkits/specs/human-oversight.md - Art. 73 Serious Incident Deadline Tracking →
toolkits/specs/incident-reporting.md - Art. 9 / Art. 15 Pre-Release Eval CI Gate →
toolkits/specs/eval-gate.md - Use
toolkits/python/eu_ai_act_kit/for Python repos,toolkits/typescript/src/for TypeScript/JS repos, or generate an idiomatic, tested module fromtoolkits/specs/for Go, Rust, Java, C#, etc.
- Art. 12 / Art. 19 Logging, Retention & Traceability →
- CI/CD Hardening: Where CI/CD gaps exist, propose or add workflow steps (Promptfoo/eval gates on prompt/model diffs, Annex IV freshness checks, audit-log chain verification tests, dependency security scans).
- Verify: Run the repo's existing test suite plus new tests verifying the added compliance controls (e.g., OTel attributes, OpenFeature fail-closed kill switch, tamper detection on audit logs, Art. 50 headers present).
Quality Rules
- No hallucinated citations: Only cite Articles/Annexes verified against
./references/. If an edge case involves newer implementing acts or harmonized standards not covered in./references/, state that explicitly and recommend checking official EU AI Office publications. - No fake evidence: Only cite file paths and line numbers you actually read.
- Preserve developer ergonomics: Recommend the lightest compliant control that genuinely closes the risk—avoid bureaucratic boilerplate when a clean code guard or CI check solves it better.