Industry Focus

AI in the Swedish public sector: municipalities, IMY and secrecy

Swedish municipalities are adopting generative AI. IMY, offentlighetsprincipen and OSL: the real risks of pasting citizen data into an AI assistant at work.

·5 min
Civil servants working in a Swedish municipal office in Stockholm

Swedish municipalities have often been early adopters of digital services. Many are now testing generative AI to draft letters, summarise case files or answer residents faster. The time savings are real, especially in social services, schools and planning, where staff spend much of their day writing.

But a Swedish municipality does not work like a company. It is bound by the principle of public access to official documents and by a strict secrecy law. Pasting a resident's case file into an AI assistant therefore raises questions that a private firm never has to ask.

A public sector that wants to use AI

Sweden has 290 municipalities and 21 regions, which run most everyday services: social care, schools, elderly care and, for the regions, healthcare. The government is pushing for AI adoption. In July 2024 it asked the Agency for Digital Government (Digg) and the Authority for Privacy Protection (IMY) to draw up national guidelines on generative AI in public administration.

The guidelines were presented in January 2025. They cover six areas: governance and accountability, cybersecurity, the GDPR, ethics, labour law and procurement. They will be updated as the tools evolve.

IMY, the regulator to know

Integritetsskyddsmyndigheten (IMY), known as Datainspektionen until 2021, supervises the GDPR and Sweden's supplementary data protection act (lag 2018:218). Its message on AI is clear: AI and privacy can go together, provided data questions are dealt with at the start of the project.

The authority has also shown that it fines public bodies. In 2019, still called Datainspektionen, it fined the Skellefteå school board 200,000 kronor for a facial recognition trial used to track pupil attendance. It was Sweden's first GDPR fine. In 2021, IMY sanctioned the national police for using Clearview AI. Neither case involved generative AI, but both show that a mere trial is not exempt from the rules.

Swedish municipal social worker meeting a resident in her office

Offentlighetsprincipen: what you write can become public

The principle of public access to official documents, offentlighetsprincipen, is written into the Freedom of the Press Act, one of Sweden's fundamental laws. Any citizen can ask to see documents held by a public authority, unless a secrecy rule applies.

For generative AI, this raises practical questions. Can a prompt sent by an official, or an answer saved to a case file, become an official document? Does it need to be registered and archived? The answer depends on how the tool is used and what is kept. Each authority has to work this out, ideally before rollout.

OSL: secrecy does not stop at the chatbot's door

The other pillar is the Public Access to Information and Secrecy Act, offentlighets- och sekretesslagen (OSL, 2009:400). Among other things, it protects information in social services, healthcare and schools. Passing protected information to a third party without a legal basis can amount to an unlawful disclosure.

Since 1 July 2023, a new rule (chapter 10, section 2 a) allows protected information to be handed to a provider that only processes or stores it technically on the authority's behalf, unless that would be inappropriate in the circumstances. It is designed for contracted IT outsourcing. It is hard to see how it could cover an official pasting a case file into a consumer AI assistant opened with a personal account.

The concrete risks in a municipality

The situations to watch are often ordinary:

  • a social worker asking a chatbot to rephrase an assessment of a family;

  • a planning officer summarising an appeal that contains names and addresses;

  • a school nurse drafting a letter from a health record;

  • an HR team analysing job applications that include personal identity numbers.

In each case, the problem is not the AI itself but the data that leaves. We describe this mechanism in our anatomy of an AI data leak.

Using AI without exposing residents

Simply banning AI solves nothing: staff who save time with it will find another route, often a less safe one. A small municipality rarely has a team able to review every use case either. It is better to provide an approved tool, write a short rule on the data that must never leave, and add a technical safeguard that acts at the moment of sending, where mistakes actually happen.

AI DLP such as ZeusLock acts at the moment an official sends text. Running on the device or in the browser, it detects sensitive data such as identifiers, names or health information, then replaces it with realistic placeholders through format-preserving anonymisation, warns the official or blocks the upload. Every incident is logged, which helps the municipality document its security measures.

This control complements the bigger choices: preferring EU-hosted solutions, as we explain in our article on sovereign AI for European CISOs, and building AI into the cyber risk management expected under NIS2.

Summary

Swedish municipalities have good reasons to use generative AI, and national guidelines to help them. But offentlighetsprincipen, the OSL and the GDPR as supervised by IMY demand particular care with residents' data. Filtering what goes into prompts lets them keep the benefits of AI without breaking citizens' trust.

Working in a Swedish municipality or region? Book a ZeusLock demo to put guardrails around how your staff use AI.

Protect your data from AI leaks

See ZeusLock stop sensitive data before it reaches ChatGPT, Claude, Gemini and more, in a 30-minute demo.

Book a demo