Skip to content

DueCare: A Gemma 4 Safety Ecosystem for Migrant-Worker Protection

Subtitle: A self-hostable multi-faceted Gemma 4 implementation for content moderation, case analysis, worker support, research, and anonymized knowledge sharing.

Tracks: Impact - Safety & Trust (primary); Special Technology - Unsloth for Gemma 4 LoRA fine-tuning and LiteRT through the DueCare Journey Android app.

0. Quick Start

Launch the demo interfaces by forking the notebooks below into your Kaggle account. Click Save and Run, watch the logs until a https://*.trycloudflare.com URL appears, then open that URL in your browser.

Inside the main workbench, /static/demo-recording.html provides the recording checklist, lane order, bundled sample artifacts, and cached replay trace for the platform-moderation example.

Kernel split for recording: duecare-app is the operational workbench (/static/chat.html, /static/process.html, /static/knowledge.html, /static/search.html, /static/share.html, and /static/demo-recording.html); duecare-live-demo is the focused walkthrough and slide deck (/start, /slides, /slides/setup, and /api/slides/recording-pack); duecare-fine-tuning-and-evaluation is the benchmark/evaluation notebook. Repo sources, respectively: kaggle/01-duecare-exploration-workbench/, kaggle/02-live-demo/, and kaggle/A-00-omni-experiment-workbench/.

1. The problem: migrant-worker exploitation

Migrant-worker exploitation is large, profitable, and often hidden behind paperwork. The ILO estimates 28 million people are in forced labor, forced labor generates $236 billion in illicit profit each year, and 169 million people work outside their country of birth. Migrant workers face roughly three times the forced-labor risk (ILO 2022, 2024).

The patterns are not limited to obvious abuse. They include recruitment-fee camouflage, worker-paid training and medical costs, wage deductions, passport retention, contract substitution, retaliation threats, debt bondage, jurisdiction confusion, pressure to use a recruiter-controlled training center, clinic, lender, or travel provider, and other evolving modus operandi.

2. Why AI has not helped enough

AI is bringing enormous progress to many industries, but it has not yet meaningfully protected migrant workers. The reason is not simply model size. This domain has weak training coverage, volatile legal facts, fragmented evidence, complex cross-jurisdiction rules, and high consequences when advice is wrong.

In early testing, frontier and open models often responded poorly to migrant-worker exploitation prompts. Common failures included poor recall of international standards, wrong corridor-fee rules, confusion about which international standards and which origin- or destination-country laws apply, vague "consult a lawyer" advice, privacy oversharing, and responses that failed to identify key indicators of human exploitation. When prompted as a business operator, models sometimes provided operational uplift for structuring prohibited fees or salary deductions.

3. DueCare overview

DueCare is named for California Civil Code section 1714(a), the same duty-of-care standard a California jury applied in March 2026 to find Meta and Google negligent for defective platform design. The goal of DueCare is to create an effective ecosystem of tools that enterprises, civil-society organizations, regulators, and migrant workers themselves can deploy to combat migrant-worker exploitation.

The DueCare ecosystem consists of the following Gemma 4-powered modules:

Lane What it facilitates
Content moderation via Gemma 4 Review recruitment ads, messages, listings, and platform posts for exploitation risk.
Case analysis via Gemma 4 Turn bounded case bundles into people, payments, dates, typed edges, timelines, and graph chat.
Worker support via Gemma 4 Provide plain-language rights guidance, offline knowledge pages, evidence journaling, safety planning, and trusted contacts.
Research via Gemma 4 Find repeated agencies, accounts, routes, fee patterns, refund outcomes, and evidence gaps across anonymized cases.
Anonymized knowledge sharing via Gemma 4 Convert reviewed, redacted facts into reusable knowledge objects without exposing workers.
Custom API implementations Embed the same safety harness into platforms, NGO tools, regulator portals, hotline workflows, or case-management systems.

4. Gemma 4 application

Gemma 4 is one of the newest and most capable open-weight model families, but early testing showed that plain Gemma 4 still suffered from the same domain failures as prior models: weak recall of international standards, weak detection of illicit fee camouflage, confusion over cross-border jurisdiction, and incomplete recognition of human-exploitation indicators.

To address this, DueCare wraps Gemma 4 in model harnesses and logic pipelines:

  • GREP: 451 deterministic rules — fee camouflage, debt novation, document retention, contract substitution, sham employment-status / misclassification, digital/app recruitment + crypto + e-wallet fee rails, Gulf "free visa" scam, student-visa labour, sex / child / organ trafficking, visa abuse (seasonal / WHM / J-1 / A-3 / R-1), port + maritime, artisanal mining, forced begging, cybercrime compounds, spiritual coercion, witness intimidation.
  • Context: 37 audience-aware personas (worker, NGO, regulator, clinician, survivor advocate, FIU, engineer).
  • Knowledge packs: 859 documents — 16 ILO conventions (incl. C097/C143 migrant-worker + ICRMW), Palermo, regional treaties (EU 2011/36, ASEAN ACTIP, SAARC, AU/Ouagadougou, Lanzarote, GCM), destination + origin statutes (POEA MC 14-2017, BP2MI 9/2020, FEA 2007, HK 57/57A, UAE 33/2021, Saudi RD M/51, Qatar 15/2017, TVPRA + UFLPA, UK MSA, EU CSDDD, BD/ID/LK/IN origin-state laws, Kuwait DW law, US TVPA, AU/CA supply-chain acts), IRIS fair-recruitment standard, screening tools, case studies, 6 landmark case-law, 3 national LE units, oversight bodies (GRETA, UK IASC, 3 UN SRs, ICAT, CoE Warsaw), maritime governance (IMO/ITF), research institutes (MPI, Amnesty, BHRRC, ECPAT, HRW) — plus a separate 610-document multidomain corpus spanning 51 integrity verticals (UN SDGs 1-17), kept isolated from the trafficking corpus.
  • Templates: 36 pre-filled complaint + narrative templates — citations + procedural language baked in; only worker-specific blanks remain.
  • Tools: corridor fee-cap lookup, trusted-contact lookup, statute validation, agency/license checks, source verification, and case-graph queries.
  • Sensitive-data handling: raw worker chats, case files, IDs, contact details, and private documents stay on the worker device or trusted NGO hardware unless an authorized user creates a sanitized submission. Local Gemma 4 and deterministic detectors anonymize sensitive PII before anything reaches the hub; the server runs a second PII detector before storage.
  • Rubric grading: refusal correctness, legal grounding, evidence preservation, contact quality, retaliation-risk handling, privacy minimization, and statute-section validity.

These techniques significantly improved Gemma 4 outputs across the tested Gemma 4 variants. The improvement was most visible in cases where the model needed to detect substance-over-form exploitation: a "training reimbursement," "voluntary salary assignment," or "third-party service charge" that functionally shifted recruitment costs onto the worker.

5. What the demo shows

The live demo follows the same six-lane story as the website and slides.

Content moderation: a risky recruitment post moves through GREP, RAG, tools, Gemma 4 generation, and audit grading.

Case analysis: Bulk File Review accepts ZIP, PDF, CSV, Office, image, email, and text bundles; deterministically extracts people, agencies, employers, payments, dates, locations, document types, journey stages, and typed graph edges from parsable text and metadata; queues OCR/media review explicitly; and can run optional Gemma case-brief and edge-generation passes when a compatible model is loaded.

Worker support: the mobile app shows chat-style guidance, offline knowledge pages, evidence journaling, safety planning, multilingual support, local privacy, and case handoff.

Research: analysts can investigate repeated agencies, training centers, medical clinics, payment accounts, routes, fees, refund outcomes, and small-claim patterns.

Anonymized knowledge sharing: reviewed facts become privacy-safe knowledge objects that can improve future packs.

Custom API implementations: external teams can call DueCare through configured endpoints, webhooks, SDK blocks, and audit traces.

6. Evaluation

In side-by-side review the harness made Gemma 4 responses much closer to international anti-exploitation standards. To quantify that, the DueCare harness-lift benchmark answers every adversarial prompt twice with the same model — a baseline arm and a harnessed arm — and grades both on a 0–100 component rubric (identifies the indicator / cites the controlling law / refuses without a playbook / gives concrete resources / preserves safety) with a self-family-excluded panel of frontier judges (inter-judge Krippendorff α = 0.927). The score is the paired lift, which cancels each judge's absolute scale.

Across seven model families the harness adds +15.6 to +42.6 points (gemma4:31b 46.0→88.6, gpt-oss:120b 39.3→77.9, glm-5.2 58.8→92.4, deepseek-v4-pro 59.4→93.1). Three findings stand out. (1) The harness is an equalizer: lift is inversely proportional to baseline and every model converges to ~88–95/100, so a small local model behind the harness reaches roughly the same safety ceiling as a frontier one — Claude Opus, already at 8.17/10, lifts only +0.27 for lack of headroom. (2) The lift completes a refusal rather than causing one: gains concentrate in citing the specific law and giving concrete resources, not in refusing — models already refuse, but a refusal without details or citations scores low, and the harness supplies the grounding that makes the refusal useful. (3) The cheap offline core (fired indicator rules + retrieved law) does not merely capture the lift — it slightly beats the full harness (core 87.1 vs full 84.9 mean; full ≤ core for every model), because the extra online/tool layer adds volume that dilutes the focused answer. So the highest-scoring configuration is also the cheapest and the only one that runs fully on-device with no web or API dependency — the on-device thesis, strengthened rather than merely supported. (The full harness's tool layer still earns its keep for a real worker — it supplies the volatile specifics a rubric doesn't score, like the current hotline or fee cap — so it stays on in the product even though core wins the benchmark.)

A complementary four-arm comparison (stock Gemma 4, stock + harness, fine-tuned, fine-tuned + harness) on a 2026-05-18 E2B smoke matrix:

Arm Score
Stock Gemma 4 2B 29.5%
Stock + chat-offline harness 35.6%
Fine-tuned 26.4%
Fine-tuned + harness 41.2%

The harness added +6.1 over stock; fine-tuned + harness added +14.8 over fine-tuning alone. Fine-tuning alone dipped below stock because the small 2B fine-tune traded factual recall for refusal shape — exactly the gap the harness closes (fine-tuning shapes refusals; the harness supplies the facts, citations, tools, and indicators). An earlier 911-prompt run scored by an independent gpt-oss:120b judge agrees in direction: +1.73/10 mean paired lift (95% CI [+1.57, +1.89], 73.3% win rate).

These are LLM-judge results, not practitioner-validated outcomes — the largest open caveat, and expert validation is the next priority; the full-registry sweep toward all ~74,640 prompts and the hardest prompt tiers are still in progress, so per-model coverage varies. Reproducibility: the A-00 report/CSV/JSON/manifest under /kaggle/working; the live board and methodology at docs/research/benchmark_leaderboard.md and benchmark_methods.md; the 911-prompt study at docs/research/harness_lift_report.md (regenerable via scripts/build_lift_report.py --all).

7. duecare-ai.com

duecare-ai.com is the public hub for the ecosystem. It explains the six lanes, links the Kaggle kernels, hosts the knowledge-pack and use-case story, and provides the broader product surface for information exchange. The long-term role of the hub is to help partners share reviewed, anonymized knowledge objects, propose updates to corridor packs, and keep public-facing guidance synchronized without exposing private case files. Submissions can be anonymous, pseudonymous, organization-tagged, verified-organization-tagged, region-tagged, corridor-tagged, or aggregate-only depending on consent; automatic labels can suggest metadata, but cannot silently upgrade an anonymous submission into an attributed one.

8. Attribution and scope

Models and frameworks include Gemma 4, Unsloth, MediaPipe LiteRT, FastAPI, Pydantic, Uvicorn, DuckDB, and Cloudflare quick tunnels. Legal and policy sources include ILO conventions and forced-labour indicators, Palermo Protocol, POEA/DMW, BP2MI, Nepal DoFE, Hong Kong Labour Department, Singapore EFMA, UAE MoHRE, and RA 8042 / RA 10022. Prior art includes my 2025 Kaggle red-teaming research on LLM complicity in modern slavery. Full per-file attribution is in docs/CREDITS.md.

DueCare drafts; the user or trusted caseworker decides. The system does not replace human caseworkers, does not auto-report, and does not bundle real worker case data.

9. Future work

Next steps are deeper federated knowledge-object exchange, on-device multimodal when LiteRT exposes the needed Gemma 4 kernels, more corridor packs, scoring-gated CI for GREP rules and LoRA adapters, and reviewer-feedback loops for misfire-driven updates.