# Maskera (maskera.dev) > Swedish-first, local PII redaction in front of any AI model. Names, personnummer, addresses, phone numbers, and other Swedish personal data are masked on-device (browser via WebGPU/WASM, Chrome/Edge extension, local proxy/MCP server via `@maskera/mcp`, or Node.js) before text leaves your process. Text and restore maps never leave your device, the packages contain no telemetry, and maskera.dev is hosted on Cloudflare Workers with no analytics scripts or cookies. Model weights and the WASM runtime are static assets fetched once and cached (both can be self-hosted). Three open-source packages (MIT), two detection layers (rules first): - `@maskera/mcp` (npm, v0.5.3): local-first CLI for AI agents (`wrap`, `proxy`, stdio `mcp`, `guard`, `redact`, `install`, `doctor`, `service`). - `@maskera/core` (npm, v0.9.3): zero-dependency, synchronous deterministic detectors for structured Swedish PII (personnummer, samordningsnummer, organisationsnummer, phone, email, postnummer, bankgiro, plusgiro, IBAN, cards, IP, URL, plus opt-in `heuristicDetectors` and `contextualDetectors`). Custom patterns join via `regexDetector`. - `maskera` (npm, v0.15.0): everything in core plus `maskera-sv-ner` v24 (68 MB q4 ONNX) for free-text names, places, organisations, and street addresses, including all-lowercase chat text. Enables street address, lägenhetsnummer, and context-labeled account/journal detectors by default (`regnummer` is opt-in); pass `profile: "clinical"` to retain common measurements, doses, and care terms. Quick start (SDK): ```ts import { createNerRecognizer, redactWithNer } from "maskera" const recognizer = createNerRecognizer() const { text, restore } = await redactWithNer( "hej jag heter provnamn maskera, personnummer 19900101-2385, och bor i provbyn", { recognizer }, ) // "hej jag heter [NAMN_1], personnummer [PERSONNUMMER_1], och bor i [PLATS_1]" ``` ## Independent Swedish benchmark (v24 q4, 2026-11-30) Measured on CPU across SUC 3.0 test, SIC2 Swedish blogs, MultiCoNER v2 Swedish persons, and ai4privacy openpii Swedish rows (23,980 texts, 0 rows in Maskera training): Maskera v24 q4 hid 97% of names (12,198/12,570), 92.8% of lowercase names, 97.3% of places, and 95.2% of street addresses and postcodes. | Tool | Size | Names | Lowercase names | Places | Addresses & postcodes | Hit on entity-free sentence (lower is better) | | --- | --- | --- | --- | --- | --- | --- | | Maskera v24 q4 | 68 MB | 97.0% | 92.8% | 97.3% | 95.2% | 4.4% | | Microsoft Presidio 2.2.366 (`sv_core_news_lg`) | 245 MB | 72.3% | 71.4% | 97.1% | 47.0% | 2.5% | | `swedish-pii` 1.2.0 | 5 MB | 55.3% | 0.3% | 82.7% | 77.3% | 7.0% | | OpenAI Privacy Filter q4 ONNX | 945 MB | 52.2% | 10.3% | 33.5% | 63.3% | 3.5% | Presidio's spaCy model is trained on SUC 3.0. Personnummer, organisationsnummer, bankgiro, and IBAN have no independent Swedish corpus and are covered by deterministic rules with checksum validation. Raw results: https://github.com/joelhagvall/maskera/blob/main/docs/benchmark-independent-v24.json. Full report and internal release gates: https://github.com/joelhagvall/maskera/blob/main/docs/BENCHMARKS.md. ## Deployment, GDPR/DPA, and pricing All masking runs locally on the user's device; there is no hosted masking API and no DPA (Swedish: PUB-avtal) is required with Hägvall Labs AB for masked text because customer text never leaves the user's device. Maskera supports GDPR data minimisation (Art. 5(1)(c), Swedish: dataminimering) and data protection by design (Art. 25, Swedish: inbyggt dataskydd), and is a Swedish-first on-device alternative to Microsoft Presidio, `swedish-pii`, and server-side DLP tools. Entity identity: Maskera is developed and operated by Hägvall Labs AB (org.nr 559598-0110, Stockholm, Sweden; founder Joel Hägvall; contact `hej@maskera.dev`). Open-source engine, CLI, MCP server and Swedish NER model are MIT-licensed. The browser extension for Chrome and Edge (Chrome Web Store: https://chromewebstore.google.com/detail/maskera/gjllhfldkkmbdhjhldjkglcihjdicbbe; info: https://maskera.dev/en/services, Swedish: https://maskera.dev/tjanster) masks chat text plus attached PDF, Word (DOCX), Excel (XLSX), and text files locally: - Free: SEK 0 (unlimited deterministic rules + 20 local AI maskings/month, no account needed). - Pro at SEK 149/month incl. VAT (7-day free trial, unlimited local AI masking, own protected words, offline licences). - Team at SEK 249/user/month excl. VAT (min. 5 users, shared E2EE protected-word list, MDM deployment via Intune/Jamf/Google Workspace, annual invoicing, volume pricing on quote). Subscriptions and offline licences are managed via https://app.maskera.dev. The portal handles accounts, offline licences, and billing only; customer text never reaches it. ## When to use Maskera Reach for Maskera when: - The text is Swedish (or mixed Swedish/English) and may contain personal data (names, personnummer, samordningsnummer, organisationsnummer, street addresses, lägenhetsnummer, postnummer, phone numbers, email, bankgiro, plusgiro, IBAN, card numbers, IP addresses, journal/account IDs, or vehicle registration numbers). - The text or document (PDF, DOCX, XLSX, text) is about to cross a trust boundary (LLM prompt, AI agent file read, log, analytics, support transcript, evaluation corpus). - Masking must happen locally and remain reversible for the caller via a restore map. Best-fit jobs: AI agents (Claude Code, Codex, Cursor, Claude Desktop, OpenCode, T3 Code), web AI chats (Microsoft Copilot, ChatGPT, Claude, Gemini, Perplexity, Mistral, and opt-in internal AI sites), HR/recruiting, customer support, healthcare notes (`profile: "clinical"`), legal and municipal case text, log scrubbing, and de-identified test data. Not a fit: non-Swedish text, scanned image/PDF OCR (pass extracted text), a hosted masking API, or a compliance guarantee (the NER layer can miss edge cases). ## How an agent should call it Choose **proxy** for text typed straight into chat and tool results (in clients that accept a custom API URL), or **MCP** for local files read via Maskera tools. 1. **Local LLM proxy + warm Streamable HTTP MCP:** - One-command wrapper: `npx -y @maskera/mcp wrap -- claude` (or `-- codex`). - Persistent proxy on `127.0.0.1:8787`: `npx -y @maskera/mcp proxy --root /path/to/workspace` (or `service install` for `launchd`/`systemd --user`). Routes Anthropic (`/v1/messages`) and OpenAI (`/v1/chat/completions`, `/v1/responses`), exposes Streamable HTTP MCP at `http://127.0.0.1:8787/mcp` (`?no_raw_restore=1`, `?read_only=1`, `?approval_mode=browser`), serves the local live inspector at `http://127.0.0.1:8787/_maskera` (JSON counts: `/_maskera/status`), restores chunk-split SSE streams, and fails closed (`502`) on error. - Client config: - Claude Code / Anthropic SDK: `ANTHROPIC_BASE_URL=http://127.0.0.1:8787` - Codex (API key) / Cursor / OpenAI SDK: `OPENAI_BASE_URL=http://127.0.0.1:8787/v1` - Claude Desktop: Developer -> Configure Third-Party Inference, base URL `http://127.0.0.1:8787` (no `/v1`), Anthropic API key, auth scheme `x-api-key` (Anthropic rejects `Bearer`). Guide: https://github.com/joelhagvall/maskera/tree/main/packages/mcp#claude-desktop-through-the-proxy - Codex signed in with a ChatGPT subscription cannot use a plain-HTTP proxy; use MCP stdio instead. 2. **MCP stdio server (Claude Desktop, Cursor, Claude Code, Codex, OpenCode, T3 Code):** - Auto-configure and verify: `npx -y @maskera/mcp install [client|all] --root /path/to/workspace --no-raw-restore` (or `doctor` to verify an existing setup). - Manual `mcpServers` config: ```json { "mcpServers": { "maskera": { "command": "npx", "args": ["-y", "@maskera/mcp", "--root", "/path/to/workspace", "--no-raw-restore"] } } } ``` - Core tools: `maskera_list_files`, `maskera_search_files`, `maskera_read_file`, `maskera_redact_file`, `maskera_write_file`, `maskera_redact`, `maskera_restore`, `maskera_list_sessions`, `maskera_clear_session`, `maskera_status`, `maskera_resume`. Prompts: `maskera-workflow`, `maskera-redact-file`. Resources: `maskera://skills/maskera/SKILL.md`, `maskera://status`. 3. **Hook / shell guard & file redaction:** - Block prompts, files, or hook JSON containing PII: `npx -y @maskera/mcp guard` (`exit 2` with counts only, `0` if clean; `--file `, `--redact` for streams). - Redact PDF (burned pixels + stripped metadata), DOCX, XLSX, or text on disk: `npx -y @maskera/mcp redact input.pdf -o output.masked.pdf`. 4. **Agent skill:** - Install `skills/maskera/SKILL.md`: `npx skills add joelhagvall/maskera`. 5. **Application SDK (browser or Node.js):** - `npm install maskera @huggingface/transformers` or `npm install @maskera/core`. 6. **Web AI chats:** - Install the local Chrome/Edge browser extension via https://maskera.dev/en/services (Swedish: https://maskera.dev/tjanster). 7. **On this site:** - Send `Accept: text/markdown` to any page URL, or fetch the `.md` sibling directly (`https://maskera.dev/index.md`, `https://maskera.dev/en/docs.md`, `https://maskera.dev/en/about.md`). - Fetch the entire site in one file: `https://maskera.dev/llms-full.txt` (English) or `https://maskera.dev/llms-full-sv.txt` (Swedish). - Unknown paths return HTTP 404 in Markdown, JSON (`Accept: application/json` or `/api/*`), or HTML. `maskera.dev/api/*` is not an API. ## Docs - [README (English)](https://github.com/joelhagvall/maskera#readme): install, API, architecture - [@maskera/mcp README](https://github.com/joelhagvall/maskera/tree/main/packages/mcp#readme): proxy, MCP server, guard, and CLI options - [MCP audit report](https://github.com/joelhagvall/maskera/blob/main/packages/mcp/AUDIT.md): security audit, findings, and gates ([threat model](https://github.com/joelhagvall/maskera/blob/main/packages/mcp/THREAT_MODEL.md), [release gates](https://github.com/joelhagvall/maskera/blob/main/packages/mcp/RELEASE_GATES.md), [JSON evidence](https://github.com/joelhagvall/maskera/blob/main/packages/mcp/audit-results.json)) - [Benchmarks](https://github.com/joelhagvall/maskera/blob/main/docs/BENCHMARKS.md): full report and internal release gates - [Production notes](https://github.com/joelhagvall/maskera/blob/main/docs/PRODUCTION.md): self-hosting, thresholds, and fallback - [Transparency](https://github.com/joelhagvall/maskera/blob/main/docs/TRANSPARENCY.md): privacy boundary and data handling - [Training data protection](https://github.com/joelhagvall/maskera/blob/main/docs/TRAINING_DATA_PROTECTION.md): v24 synthetic attestation, identifier rejection, and KB-BERT boundary ## Packages and model - [@maskera/mcp on npm](https://www.npmjs.com/package/@maskera/mcp) - [maskera on npm](https://www.npmjs.com/package/maskera) - [@maskera/core on npm](https://www.npmjs.com/package/@maskera/core) - [maskera-sv-ner on Hugging Face](https://huggingface.co/joelhagvall/maskera-sv-ner) - [Maskera on Chrome Web Store](https://chromewebstore.google.com/detail/maskera/gjllhfldkkmbdhjhldjkglcihjdicbbe) ## Machine-readable entry points - [Full English corpus (llms-full.txt)](https://maskera.dev/llms-full.txt): single-file Markdown concatenation of every English page on maskera.dev - [Full Swedish corpus (llms-full-sv.txt)](https://maskera.dev/llms-full-sv.txt): single-file Markdown concatenation of every Swedish page on maskera.dev - [Markdown renderings](https://maskera.dev/index.md): `.md` sibling of every page (`Accept: text/markdown`) - [Sitemap](https://maskera.dev/sitemap.xml): all pages in Swedish and English with reciprocal hreflang - [Security disclosure (security.txt)](https://maskera.dev/.well-known/security.txt): RFC 9116 vulnerability disclosure contacts and policy - [Agent skills discovery index](https://maskera.dev/.well-known/agent-skills/index.json): RFC v0.2.0 discovery index with SHA-256 digest for `SKILL.md` - [MCP server discovery card](https://maskera.dev/.well-known/mcp/server-card.json): machine-readable `@maskera/mcp` transports, 11 tools, prompts, resources, and local-only invariants - [Benchmark contract](https://maskera.dev/benchmark-release.json): release measurements ([schema](https://maskera.dev/benchmark-release.schema.json)) - [Whitepaper (PDF)](https://maskera.dev/whitepaper.pdf): architecture, privacy model, and measurements - [Security and MCP audit](https://maskera.dev/en/security): security posture, disclosure, and `@maskera/mcp` audit (Swedish: https://maskera.dev/sakerhet) - [About and contact](https://maskera.dev/en/about): Hägvall Labs AB (org.nr 559598-0110, Stockholm), hej@maskera.dev (Swedish: https://maskera.dev/om) - [Agent setup prompt](https://maskera.dev/setup-prompt.md): copy-paste prompt to configure and verify `@maskera/mcp` - [Documentation](https://maskera.dev/en/docs): quickstart, `/en/docs/mcp`, `/en/docs/clients`, `/en/docs/sdk`, `/en/docs/troubleshooting` (Swedish: https://maskera.dev/docs) - [FAQ](https://maskera.dev/en/faq): data protection, agreements, browsers, offline use, pricing, and MDM (Swedish: https://maskera.dev/fragor) - [Industries](https://maskera.dev/en/industries): HR, healthcare, legal, public sector, and support (Swedish: https://maskera.dev/branscher) - [Maskera vs Microsoft Presidio](https://maskera.dev/en/vs-presidio): benchmark and architecture comparison for Swedish PII (Swedish: https://maskera.dev/jamfor/presidio) - [Maskera vs Avidentifiera.se](https://maskera.dev/en/vs-avidentifiera): on-device masking vs hosted cloud OCR/API comparison (Swedish: https://maskera.dev/jamfor/avidentifiera) - [GDPR guide for AI chats](https://maskera.dev/en/guides/chatgpt-gdpr): masking Swedish personal data before ChatGPT and Copilot without a DPA (Swedish: https://maskera.dev/guider/chatgpt-gdpr) ## Optional - [Live demo](https://maskera.dev/): paste Swedish text and test masking in the browser - [Products & pricing](https://maskera.dev/tjanster): browser extension, `@maskera/mcp`, and SDK (English: https://maskera.dev/en/services) - [Customer portal](https://app.maskera.dev/login): account sign-in, subscriptions, offline licences, and billing - [Source repository](https://github.com/joelhagvall/maskera)