HITL and EU-aware governance for brownfield systems
|
Juan Antonio Breña Moral Engineering @ IG Group, EU Division
Twitter | GitHub | LinkedIn |
|
|
"Make it work, make it right, make it fast." - Kent Beck "Lead me, follow me, or get out of my way.", "Pressure makes diamonds." - George S. Patton Jr. |
|
Source: Leavitt's Alignment Model (1965) >> People, Process and Technology
Framework
Train Specialized LLMs
Fine-tuning, LoRA/QLoRA, Distillation, ...
Automate stable processes using AI Agents
Spring AI, LangChain4j, Embabel, ...
Software Engineering enhanced with AI
SDD, Java Skills, MCP-Servers, Knowledge bases, ...
Design the context
Define boundaries
contracts
and owners
Discover and connect context
Trace dependencies
document decisions
and close gaps
Recover and validate context
Read behavior
data and incidents
then test assumptions
Focus: brownfield enterprise systems—working software, fragmented knowledge, and live dependencies.
ACT I
Implementation accelerates. Context discovery and review capacity do not.
When people move to another company, their tacit knowledge leaves with them.
Team rotations, Reorganizations change responsibility and accountability.
AI Agents turn backlog items into code at industrial speed.
Then Software engineer using an AI agent picks up a seemingly local story...
RenamecustomerIdtoclientId.
record Order(String clientId, BigDecimal total) {}
The agent implements it quickly. Repository checks pass.
💥 Production breaks
The checks proved the implementation—not the whole consequence.
customerId → clientIdThe repository cannot always be the unit of correctness.
Organizations design systems that mirror their communication structures.
Paraphrased from Melvin Conway, 1968.
Faster generation does not repair a weak boundary—it propagates its gaps faster than people can discover and review them.
Ownership
Communication
Specification
Validation
Agents
Tools
AI accelerates technology.
System correctness still depends on all three.
Rename customerId
to clientId
clientId compatiblycustomerId after adoptionSame requirement. Different context. Different plan.
Parallel Change: expand → migrate → contractMost coding agents start at task and repository.
Many
dependency failures live outside them.
Diff
Repository tests
CI status
Agent summary
External consumers
Uncertainty
Applicable controls
Decision authority
Without system context and decision authority, human approval becomes cosmetic oversight.
ACT II
Human review only counts when reviewers see the evidence, own the risk, and can say no.
A human presence does not guarantee a human judgment.
Without them, approval is human-as-a-button.
Start with impact and uncertainty. Autonomy, reversibility, data, rights, safety, sector, and applicable law can raise the level.
The goal is effective control where consequences matter, not approval everywhere.
The diff proposes the change; the evidence package makes the consequence reviewable.
“The customerId migration was validated successfully.”
Checks are green.
The diff looks reasonable.
APPROVE
Which consumers were checked?
What remains unverified?
How is compatibility preserved?
What triggers rollback?
The right reviewer depends on the risk, not on who is available.
A reviewer needs real alternatives to “Approve.”
Monitor, rollback, preserve evidence, and improve the control that failed.
Prediction ↔ outcome ↔ corrective action
ACT III
Classify first, then let triggers turn regulation into reviews, evidence, and release gates.
HITL is the decision mechanism connecting policy to execution.
Article 14 requires effective human oversight for applicable high-risk AI systems.
Using an AI coding agent does not by itself classify the software being changed as a high-risk AI system.
Classify the deployed system and use case first. Apply human review, intervention, auditability, and rollback as engineering controls regardless.
Regulation (EU) 2024/1689These are routing signals—not final applicability determinations.
An AI system or GPAI model is placed on the EU market, used in the EU, or its output affects people in the EU.
Provider or deployer · intended purpose · prohibited practice · Annex III/I high-risk signal · transparency · GPAI.
Human oversight · model and data lineage · logs · accuracy and robustness tests · monitoring · rollback or disablement.
High-risk milestones: Annex III · 2 Dec 2027; Annex I product AI · 2 Aug 2028. Classification and legal interpretation require qualified owners. Regulation (EU) 2024/1689
| Issue | Risk | Fix | AI Act hook |
|---|---|---|---|
| 1 · No human oversight | Agent-generated or model-driven change to financial logic reaches production on a green pipeline | Merge blocked until a competent reviewer approves, modifies, rejects, or stops; prompt, model version, diff, and tests exposed | Art. 14: human oversight |
| 2 · No traceability of AI outputs | Model output drives a decision, but model version, input, and result are not recorded | Decision log with model version, input reference, output, confidence, and reviewer, retained under a defined policy | Art. 12 · 26: logging, deployer log retention |
| 3 · AI interaction not disclosed | A chatbot or generated content is presented to users as human or unmarked | Disclosure flag in the API and UI; generated content labeled and machine-readable where required | Art. 50: transparency obligations |
| 4 · AI feature shipped unclassified | A scoring or ranking feature reaches users with no intended-purpose or risk classification | Classification record (role, purpose, Annex III signal) required by a CI gate before release | Art. 5 · 6: prohibited practices, high-risk classification |
A Java service collects, stores, transforms, exposes, logs, exports, or deletes data linked to a natural person.
Purpose and lawful basis · controller or processor role · sensitive data · DPIA · transfers · retention.
Data inventory · narrow DTOs · field authorization · rights workflows · deletion propagation · privacy-safe observability.
The GDPR has applied since 25 May 2018.
Privacy, DPO, legal, security, and data owners decide lawful basis, roles, DPIA, transfers, and risk acceptance. Regulation (EU) 2016/679
| Issue | Risk | Fix | GDPR hook |
|---|---|---|---|
| 1 · Entity exposed by the API | findById returns the whole CustomerProfile; every stored field becomes API data |
Purpose-specific CustomerSummary DTO with authorization and access audit |
Art. 5(1)(c) · 25: minimisation, data protection by design |
| 2 · PII in logs and traces | log.info("Customer {}", customer) writes email and address to logs, traces, and metrics |
Log ids only; masking layer and field-level redaction policy; no PII in observability | Art. 5(1)(f) · 32: confidentiality, security of processing |
| 3 · Erasure not propagated | repository.delete(id) removes the row, but copies stay in caches, search indexes, topics, backups, and analytics |
Erasure workflow that fans out to every store and records completion | Art. 17: right to erasure |
| Issue | Risk | Fix | GDPR hook |
|---|---|---|---|
| 4 · Retention never enforced | Data kept forever; no retention period or purge job | retentionUntil per purpose and a scheduled purge with a recorded outcome |
Art. 5(1)(e): storage limitation |
| 5 · No access or export path | Data subject requests are answered with ad hoc SQL | DataSubjectExport gathers data across services into a portable format with an audit trail |
Art. 15 · 20: access, portability |
| 6 · Purpose creep | Data collected for billing is reused for marketing or model training with no check | Purpose tags on fields and a policy check at the point of use; basis or consent recorded | Art. 5(1)(b) · 6: purpose limitation, lawful basis |
Software or a connected Java component may be a product with digital elements made available on the EU market.
Product classification · manufacturer role · important or critical category · conformity route · support period.
Threat model · secure defaults · SBOM · vulnerability handling · signed updates · user guidance · end-of-support.
Article 14 reporting applies from 11 Sep 2026; full application starts 11 Dec 2027.
Product, product-security, legal, compliance, support, and market-access owners decide applicability and conformity. Regulation (EU) 2024/2847
| Issue | Risk | Fix | CRA hook |
|---|---|---|---|
| 1 · Secrets in the artifact | Hardcoded API key or signing key inside the JAR or properties | Inject secrets at runtime; block secrets in the artifact with a build scan | Annex I: confidentiality, protection of data |
| 2 · Insecure defaults | Default password, open admin surface, or trustAllCerts shipped in the product |
Secure-by-default config; SecurityDefaults .validate(config) fails on weak settings |
Annex I: secure by default, minimal attack surface |
| 3 · SBOM drift | Fat JAR built with latest or version ranges; no inventory of what shipped |
Pinned dependency lock; CycloneDX SBOM generated in CI and attached to the release | Annex I: SBOM, component transparency |
| 4 · Unsafe deserialization | new ObjectInputStream(in) .readObject() on update or plugin metadata |
Typed DTO with schema validation and an ObjectInputFilter |
Annex I: limit attack vectors, input validation |
A system supports a possible essential or important entity, critical sector, managed service, or digital infrastructure provider.
Entity and sector classification · Member State law · significant-incident reporting · provider responsibility.
Asset inventory · secure configuration · incident workflow · supply-chain review · access control · restore and continuity tests.
EU transposition deadline: 17 Oct 2024; verify the applicable national law.
Legal, security, risk, resilience, continuity, and executive owners decide entity scope and reporting duties. Directive (EU) 2022/2555
| Issue | Risk | Fix | NIS2 hook |
|---|---|---|---|
| 1 · Incident as log line | logger.error("Security issue", e); no triage, owner, or reporting handoff |
SecurityIncident classified by severity, evidence captured, owners notified, containment opened |
Art. 23: significant-incident reporting |
| 2 · Reporting clock ignored | Detection time and report deadlines are not recorded | ReportingDeadlines.from (incident.detectedAt()) computes the 24h, 72h, and 1-month milestones and alerts owners |
Art. 23: early warning 24h · notification 72h · final report 1 month |
| 3 · Unvetted supplier dependency | Third-party SDK or SaaS client added with no inventory, owner, or review | SupplierRegister entry (component, provider, criticality, review, exit plan) enforced by a CI check |
Art. 21(2)(d): supply-chain security |
| Issue | Risk | Fix | NIS2 hook |
|---|---|---|---|
| 4 · Overprivileged access | Service account or admin API with a static token, no MFA, no least privilege | Role-scoped access, short-lived credentials, MFA on admin paths, access logged | Art. 21(2)(i, j): access control, MFA |
| 5 · Untested recovery | Backup job exists but nobody has restored from it; no continuity runbook | Scheduled restore test records RTO and RPO and stores the result as evidence | Art. 21(2)(c): continuity, backup, crisis management |
| 6 · Unmanaged vulnerabilities and config | Unpatched dependencies and drifting configuration; no asset inventory | Asset inventory, CI scanning, patch SLA by severity, and drift detection | Art. 21(2)(e, f): vulnerability handling, effectiveness assessment |
A Java system supports an in-scope financial entity, important business service, critical ICT function, or ICT provider relationship.
Applicability · function criticality · incident reporting · provider criticality · outsourcing and concentration risk.
ICT inventory · detection and escalation · restore and failover tests · change control · provider monitoring · exit plans.
DORA has applied since 17 Jan 2025.
Legal, compliance, risk, resilience, security, procurement, and business owners decide applicability and risk acceptance. Regulation (EU) 2022/2554
| Issue | Risk | Fix | DORA hook |
|---|---|---|---|
| 1 · No resilience on a critical dependency | paymentNetwork.settle(batch) with no timeout, idempotency, bounded retry, circuit breaker, or fallback |
ResiliencePolicy with timeout, bounded retry, and circuit breaker; idempotent replay and deferAndEscalate |
Art. 9 · 11: ICT risk management, response and recovery |
| 2 · Incidents not classified or reportable | Failure logged as error; no major-incident criteria, clock, or report handoff |
IncidentClassifier applies the criteria (clients affected, duration, data loss, criticality) and routes to the reporting workflow |
Art. 17–19: incident classification and reporting |
| 3 · Concentration on one ICT provider | One cloud or payment provider hardcoded across the code; no abstraction or exit path | Port/adapter boundary plus a ProviderRegister with criticality, alternative provider, and tested exit plan |
Art. 28 · 30: third-party risk, exit strategies |
| Issue | Risk | Fix | DORA hook |
|---|---|---|---|
| 4 · Recovery never tested | Failover and restore exist on paper but were never exercised; RTO and RPO unknown | Scheduled failover and restore drills record RTO and RPO and store the results as evidence | Art. 11 · 24–25: continuity, resilience testing |
| 5 · Uncontrolled ICT change | Direct production deploy or config change with no approval, rollback, or audit trail | Gated change pipeline with approval, automated rollback, and a change record linked to the release | Art. 9: ICT change management |
| 6 · No ICT asset or dependency inventory | Unknown libraries, services, and data flows behind an important function | Inventory mapping each function to components, dependencies, owner, and criticality, built from the SBOM and service catalog | Art. 8: identification, ICT asset mapping |
| Regulation | Project trigger | Application milestone |
|---|---|---|
| GDPR | Processes personal data | 25 May 2018 · applies |
| NIS2 | Supports an in-scope essential or important entity | 17 Oct 2024 · EU transposition deadline; check national law |
| DORA | Falls within EU financial-sector scope | 17 Jan 2025 · applies |
| EU AI Act | Provides or deploys an in-scope AI system or GPAI model |
2 Feb 2025 · prohibitions + AI literacy 2 Aug 2025 · GPAI + governance 2 Aug 2026 · transparency + enforcement 2 Dec 2027 · Annex III high-risk AI 2 Aug 2028 · Annex I product AI |
| CRA | Places a product with digital elements on the EU market | 11 Sep 2026 · reporting 11 Dec 2027 · full application |
Dates are legal milestones—readiness starts earlier. Confirm the organization, role, sector, use case, market, and Member State before deciding applicability.
Development governance controls the agent-created PR. System regulation depends on what the deployed system does and where it operates.
CLOSE
🙏 Thank you 🙏
jbang trust list
jbang cache clear
jbang catalog list jabrena
jbang qr-code@jabrena \
--url https://jabrena.github.io/plinth/dvbe26/