Thesis: Human-in-the-Loop Sanitization for Hybrid Local and Cloud LLM Agents under Data Sovereignty Constraints
Knightec Group ABOm tjänsten
High Level Description
Many Swedish public authorities cannot send sensitive information to cloud LLM services. At the same time, the hardware needed to
run open models that come close to the leading cloud models on-premise is expensive, and the smaller models that are affordable to
run locally are less capable.
This thesis aims to investigate a hybrid setup where a small local model does the work and, when it gets stuck, asks a cloud model
for help through an anonymizing step that a human approves. Nothing leaves the network until it has been sanitized and approved.
Project Description
In this thesis, investigate and build an escalation path from a local coding agent to a cloud LLM within an agentic coding
harness. When the local agent needs help, its question passes a sanitization step that removes or generalizes sensitive details,
for example rewriting the Java package se.foretag to com.example. The user reviews and approves the sanitized question before it
is sent, and the answer is returned to the local agent.
Two variants should be compared:
- Reversible sanitization: the sanitizing model keeps the mapping and context, and rewrites the answer back to the original names
before the agent receives it.
The solution should be provider-agnostic: which cloud model is used is a configuration choice, not tied to a specific vendor.
OpenCode is suggested as the harness, since its plugin and permission system appears to allow a local agent, a local sanitizer and
an approval step for outgoing requests without changing the tool itself, but other harnesses may be considered. Evaluation is done
on synthetic or open-source code with seeded sensitive identifiers, never on real sensitive data.
Who are we looking for?
Purpose
In this thesis, investigate these questions:
- Does keeping context to restore the original names give better results than one-way sanitization, and what risks does the
stored mapping add?
Out of scope: classified information, a legal assessment of compliance, and cryptographic approaches such as homomorphic
encryption.
References:
OpenCode, https://opencode.ai/
Digg and IMY, Riktlinjer för generativ AI inom offentlig förvaltning,
https://www.digg.se/ai-for-offentlig-forvaltning/riktlinjer-for-generativ-ai
An Exciting Journey with Knightec Group
Semcon and Knightec have joined forces as Knightec Group. Together, we are Northern Europe’s leading strategic partner in product
and digital service development. With a unique combination of cross-functional expertise and a holistic business understanding, we
help our clients realize their strategies – from idea to complete solution.
Practical Information
This is a thesis position, located at our office in Sundsvall. Start date January or March 2027.
Please submit your application as soon as possible, but no later than 2026-11-30. If you have any questions, you are welcome to
contact johanna.edstrom@knightec.se. Note that due to GDPR, we only accept applications through our careers page.