Thesis: Human-in-the-Loop Sanitization for Hybrid Local and Cloud LLM Agents under Data Sovereignty Constraints
Join us for your thesis work! Gain hands-on experience, work on real projects, and develop your skills in a supportive and innovative environment!
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:
One-way sanitization: the answer comes back in generic form and the local agent adapts it to the real codebase.
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?
Bachelor/Master of Science in Computer Science/Engineering
Graduation in June 2027
Fluency in Swedish, both written and spoken
Fluency in English, both written and spoken
Purpose
In this thesis, investigate these questions:
How much sensitive information remains after sanitization, and does a rule-based, LLM-based or combined sanitizer work best?
How close does a local model with sanitized cloud help get to a cloud-only setup on realistic coding tasks?
Does keeping context to restore the original names give better results than one-way sanitization, and what risks does the stored mapping add?
How much effort does the human review step cost, and does it catch what the sanitizer misses?
How complex is the setup?
Can it be built on existing agent harnesses and anonymization tools, or are custom components needed?
What local hardware is needed to run the agent and the sanitizer?
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.
- Business unit sweden
- Thesis Sweden
- Role
- Bachelor thesis
- Location
- Sundsvall
- Employment type
- Internship