docs(legal): align in-repo privacy and DPA pages with actual AI subprocessor facts (#1770)
* docs(legal): align in-repo privacy and DPA pages with actual AI subprocessor facts The published marketing-site DPA claimed Anthropic PBC and OpenAI Inc (USA) as AI subprocessors. Ground truth: AI inference runs Anthropic Claude models operated by AWS via Amazon Bedrock in eu-north-1 (Stockholm); no data is sent to Anthropic as a company and there is no third-country transfer. This commit updates the in-repo /privacy and /dpa pages to state that fact explicitly, discloses PostHog deny-by-default session-replay masking, and bumps the last-updated dates to 2026-08-20. The marketing-site pages are outside this repo and still need manual edits. Part of #1674 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(legal): fix systemdokumentation AI integration row, defer page wording to #1766 Resolves the CodeRabbit findings on PR #1770 in one pass: - public/docs/systemdokumentation-mall.md said transaction and document data flows Accounted -> Anthropic -> Accounted. Corrected to Amazon Bedrock (AWS, eu-north-1 Stockholm) with Anthropic Claude models running inside Bedrock; data does not leave the EU. - The privacy and DPA page edits this PR originally carried are dropped: PR #1766 merged the same #1674 alignment first with wording pinned by app/(public)/privacy/__tests__/ai-and-replay-disclosures.test.ts, which forbids the DPA naming Anthropic and forbids the Bedrock row asserting sub-processor status either way. Both pages are now byte-identical to main. Part of #1674 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs(legal): self-host note in systemdokumentation template AI row Swedish compliance review on PR #1770: the blanket 'datan lamnar inte EU' claim in the Amazon Bedrock integration row is only true for the hosted default configuration. A self-hosted operator running AI_PROVIDER=anthropic or a custom AI_BASE_URL endpoint who fills in this template unchanged would produce systemdokumentation that misstates the data flow (BFNAR 2013:2 kap 8 requires the documentation to describe the actual system). Adds a bracketed template note, in the same style as the existing integrations placeholder, telling self-hosted operators to update the row to their actual provider, region and data flow. Part of #1674 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1126,6 +1126,7 @@ One line per decision: `[YYYY-MM-DD] <decision>: <why>`. Appended by agents and
|
||||
[2026-08-20] Strict JSON on OpenAI-compatible endpoints uses a hand-maintained JSON-schema mirror of the extraction Zod schema, opt-in via AI_STRICT_JSON, never an automatic Zod-to-JSON-schema conversion: the Zod schema carries .catch()/.transform() that have no schema equivalent and a generated schema would drift silently. Zod stays the validator either way; JSON-in-prose + extractJsonObject remains the default everywhere because it works on every model and is what hosted runs.
|
||||
[2026-08-20] AI_API_KEY made optional for the OpenAI-compatible backend: a base URL alone now counts as configured (hasAiCredentials / resolveAiProvider), so a local model server (llama.cpp/Ollama/LM Studio/vLLM), which usually has no auth, works with just AI_BASE_URL + AI_MODEL. The openai-compatible service only sends an Authorization: Bearer when AI_API_KEY is set, so a keyless local server is never handed an empty bearer. Hosted providers that require a key still set AI_API_KEY. Bedrock/Anthropic credential logic unchanged.
|
||||
[2026-08-20] poppler-utils is the one system package added to the self-host runner image (Sovereign plan WS1 PR2): pdftoppm renders the first pages of a PDF for AI backends without native PDF input (an OpenAI-compatible Swedish endpoint), measured at ~4 MB plus shared libs on node:22-alpine (pdftoppm 25.12), written to /tmp which docker-compose.yml already mounts as tmpfs under the read-only root. Hosted never calls it (Bedrock reads PDFs natively) and the cron image is untouched. pdfjs-dist + @napi-rs/canvas were rejected earlier (two npm deps, memory spikes, dead weight on hosted). scripts/smoke-ai-provider.ts is the backend-agnostic "is AI wired up" check; verified live against hosted Bedrock and against a local OpenAI-compatible mock (the mock received Bearer auth, per-tier model ids and one image_url part per rasterized page).
|
||||
[2026-08-20] Issue #1674 audit: did NOT touch the middleware to make /privacy and /dpa reachable without login (app.accounted.se 307s both to /login?next=...), even though prospects therefore only ever see the stale marketing-site legal pages: the task was scoped to text edits only, no code behavior changes. The published contradiction (www.accounted.se/dpa listing Anthropic PBC and OpenAI Inc in USA) lives in the marketing site, outside this repo; handled via external-edit list to Emil, not repo changes.
|
||||
[2026-08-20] #1663 filed-declaration read API (v1 GET /skatteverket/vat-declarations) reaches the Skatteverket extension through a registry-resolved read service (lib/skatteverket/declaration-status.ts, mirroring the skatteverket-commit boundary), not by importing extension code into core (CI guard forbids it) and not by dispatching to the cookie-session extension routes (wrong auth surface, deadline-completion side effects): the service uses resolveReadAuth so any company member's API key can read what another member connected (#1673 model); the existing MCP gnubok_vat_declaration_status stays on caller-token auth (changing it is a separate concern); AGI got no v1 endpoint because gnubok_agi_status covers MCP reads and the /agi/kvittenser read path carries reconciliation writes that need their own design.
|
||||
[2026-08-20] RIP-3 chat cutover is scoped to general.help only: the free-form Q&A /chat panel now runs on a page-scoped single-call console (AskConsole → POST /api/agent/ask, persist:true), so it works on any configured backend incl. a local OpenAI-compatible model. The tool-loop intents (transaction.categorization, invoice.draft, supplier_invoice.review) and the docked AgentSheet still use AgentChat + run-turn.ts because they stage operations and need the tool loop, so run-turn.ts is NOT deleted here (the plan gates its deletion on "once nothing calls them"; RIP-4 migrates the rest). Persistence is an opt-in branch on the existing /api/agent/ask route rather than a new endpoint, so page-scoped one-off asks (a report page) stay stateless; the console writes both turns to agent_conversations/agent_messages as canonical Anthropic text blocks so the /chat sidebar and resume keep working across old streaming threads and new single-call ones.
|
||||
[2026-08-19] Provider re-sync replace mode resolves EVERY overlapping completed sie_imports row and treats one it cannot resolve (not_found/not_completed) as a stale watermark to skip, importing the year fresh, but still aborts on a locked or closed period: an unresolvable row has nothing left to delete, while importing over entries that could not be deleted would duplicate verifikationer.
|
||||
@@ -1136,6 +1137,7 @@ One line per decision: `[YYYY-MM-DD] <decision>: <why>`. Appended by agents and
|
||||
[2026-08-19] #1674 audit fixed the in-repo disclosures only (privacy sub-processor Bedrock row now names Anthropic as model vendor, replay paragraph states the deny-by-default guarantee, both locked by app/(public)/privacy/__tests__): Anthropic was deliberately NOT added as its own sub-processor row because no code path sends data to Anthropic (hosted uses Bedrock in eu-north-1, lib/ai/provider.ts); the artifact the prospect actually read (published DPA PDF or marketing security page listing Anthropic/OpenAI in the US) lives outside this repo and needs founder/legal action, as does any underbitraede-list wording.
|
||||
[2026-08-19] #1674 audit fixed the in-repo disclosures only (privacy sub-processor Bedrock row now says AI requests go to Amazon Bedrock and the models are Anthropics Claude running inside Bedrock, replay paragraph states the deny-by-default guarantee, both locked by app/(public)/privacy/__tests__): Anthropic was not added as its own sub-processor row because the HOSTED posture is Bedrock by credential precedence (lib/ai/provider.ts: static AWS keys select Bedrock, region is AWS_REGION with eu-north-1 as the default, not a guarantee); a direct Anthropic API path DOES exist in code for self-hosted deployments (AI_PROVIDER=anthropic, or ANTHROPIC_API_KEY without static AWS keys), so "no code path sends data to Anthropic" would be false and the page asserts nothing about Anthropics underbitraede status either way; whether Anthropic is an underbitraede, plus aligning the published DPA PDF / marketing security page (which listed Anthropic/OpenAI in the US), is founder/legal action outside this repo.
|
||||
[2026-08-20] Reverted #1765: the company switcher is NOT mounted at the top of the desktop sidebar. Founder call after seeing it live: switching belongs in the bottom user block only (the UserMenu flyout), so the sidebar top stays brand + collapse and the nav starts immediately below. #1664's "one-click from the top" framing is therefore declined, not merely unimplemented; the logo title tooltip went back with the revert since it shipped inside the same commit. Do not re-add a top-of-sidebar switcher from #1664 without a new founder decision.
|
||||
[2026-08-20] PR #1770 dropped its own privacy/DPA rewording (Anthropic-korda-av-AWS phrasing, enda-underbitraede claim, date bumps) in favor of the wording #1766 already merged and pinned with app/(public)/privacy/__tests__/ai-and-replay-disclosures.test.ts: the test forbids the DPA naming Anthropic and forbids the Bedrock row asserting underbitraede status either way, so this PR keeps only what #1766 did not cover, the systemdokumentation-mall.md integration row (said Accounted -> Anthropic -> Accounted; now Amazon Bedrock, EU) and the middleware-scope decision line.
|
||||
[2026-08-20] Fortnox voucher-attachment scopes (Arkivplats + Koppla filer) are requested per authorize call from the underlag follow-up only, never from an ordinary connect, and gated on FORTNOX_DOCUMENT_SCOPES_APPROVED in lib/providers/fortnox/oauth.ts (the portal-registration switch). Two reasons: Fortnox derives customer licence requirements from what the integration requests, so an all-connects request would put an Arkivplats licence in front of customers who never import a receipt (the portal says so in as many words); and a scope the registered app lacks makes authorize reject with invalid_scope before login, so keeping it off the default connect caps the blast radius at the underlag flow instead of every Fortnox connection (incident 2026-08-13). A document consent is always a superset of an ordinary one, because the callback overwrites the consent's tokens in place and a narrower grant would revoke the migration's own ledger access. While the flag is false the attachment 403 reports PROVIDER_DOCUMENT_SCOPES_UNAVAILABLE with no action offered, instead of reconnect advice for a permission we never ask for: that advice sent Klura AB around the OAuth loop four times and to buy the Fortnox Arkiv module for nothing (support case 2026-08-20). Portal registration alone changes nothing observable, which is why turning the scopes on and back off that day neither caused nor fixed the error.
|
||||
[2026-08-21] Flipped FORTNOX_DOCUMENT_SCOPES_APPROVED to true: Arkivplats and Koppla filer are now enabled for integration 39254 in the Fortnox Developer Portal (founder confirmed). Only the opt-in underlag reconnect requests them, so the ordinary connect is unchanged and no customer is asked for an Arkivplats licence to connect. Set it back to false if the portal ever loses the scopes, since authorize then rejects with invalid_scope before login.
|
||||
[2026-08-21] Qvalia is the Peppol Access Point (contract signed 2026-08-21); the adapter lives in lib/invoices/transports/qvalia.ts behind the provider-neutral PeppolTransport seam, switched on per environment by PEPPOL_TRANSPORT_PROVIDER=qvalia plus QVALIA_* credentials: Storecove was the doc's technical preference, Qvalia won on the commercial track (Swedish AP+SMP, partner model, existing relationship); v1 is consolidated-account send-only (recipient lookup, submit, shared-secret webhook, evidence), a draft is issued with mark-sent semantics only after the network accepts it, and a sync rejection freezes that exact XML as terminal failed so the identical document is never re-sent; inbound, credit notes, 0088 GLN for enskild firma and per-company registration are separate PRs.
|
||||
|
||||
@@ -252,13 +252,15 @@ Momsperiod: [ ] Månad [ ] Kvartal [ ] Helår
|
||||
|---|---|---|
|
||||
| Enable Banking (PSD2) | Bankkontosynkronisering | Bank -> Accounted (läsning av transaktioner och saldon) |
|
||||
| Skatteverket | Momsdeklaration, arbetsgivardeklaration (AGI), skattekonto | Accounted -> Skatteverket (inlämning signeras med BankID) |
|
||||
| Anthropic (Claude) | Maskinell kategorisering av transaktioner och avläsning av underlag | Accounted -> Anthropic -> Accounted (transaktions- och dokumentdata skickas, förslag returneras) |
|
||||
| Amazon Bedrock (AWS) | Maskinell kategorisering av transaktioner och avläsning av underlag. Modellerna som används är Anthropics Claude-modeller, körda inom Bedrock (eu-north-1, Stockholm) | Accounted -> Amazon Bedrock -> Accounted (transaktions- och dokumentdata skickas, förslag returneras; datan lämnar inte EU) |
|
||||
| Resend | E-postutskick | Accounted -> Resend -> mottagare (fakturor, påminnelser) |
|
||||
| BankID (via identitetsleverantör) | Inloggning och signering | Accounted -> leverantör -> Accounted |
|
||||
| PostHog | Användningsstatistik för tjänsten | Accounted -> PostHog |
|
||||
|
||||
[ANGE YTTERLIGARE INTEGRATIONER OM TILLÄMPLIGT, t.ex. import från Fortnox, Visma, Bokio, Björn Lundén eller Briox]
|
||||
|
||||
[SJÄLVHOSTAD DRIFT: raden för Amazon Bedrock ovan beskriver den hostade tjänstens standardkonfiguration. Om din installation använder en annan AI-leverantör (t.ex. AI_PROVIDER=anthropic med direkt Anthropic-API, eller en egen endpoint via AI_BASE_URL) gäller inte skrivningen "datan lämnar inte EU" automatiskt; uppdatera raden så att den beskriver din faktiska leverantör, region och ditt faktiska dataflöde]
|
||||
|
||||
**Notering om maskinell behandling:** förslag från maskinella hjälpmedel bokförs aldrig automatiskt utan att en användare har granskat och godkänt dem. Godkännandet loggas i behandlingshistoriken.
|
||||
|
||||
## 12. API-nycklar och maskinell åtkomst
|
||||
|
||||
Reference in New Issue
Block a user