# Security overview

This page answers the questions a security or procurement review usually asks about Apier. It describes the service as it runs today and was last checked against the code on 2026-11-25. A pre-filled questionnaire with the same answers is available as a CSV file at the end of the page.

## Architecture

Apier is one web application. Its server functions run on Vercel and its data lives in a Postgres database run by Supabase. The API, the MCP server, the website and the dashboard are parts of that one application.

Company data comes from Brønnøysund's public registers. Apier keeps a daily copy of what it read, so it can answer what the register showed on an earlier date. The sandbox answers from fixed test data and never calls a government service.

No company or personal data is sent to an external AI or LLM service.

## Data location

The database is in the EU, in Supabase's Stockholm region (`eu-north-1`). The server functions run in Vercel's Stockholm region (`arn1`).

Requests first reach Vercel's global network, which can handle them outside the EU before they are passed to the functions in Stockholm. Backups stay in the same region as the database.

## Encryption

In transit: TLS 1.2 or later between callers and Vercel, and between the application and the database.

At rest: AES-256 on the primary database and on every backup, provided by the database host.

API keys are never stored. Apier stores only a SHA-256 hash of each key, so a copy of the database does not reveal a working key.

## Key management

Production certificates (the signed responses a caller asks for with `?certificate=true`) are signed with RS256. The public key is published at `/.well-known/jwks.json`. When a key is retired it stays in that file with its retirement date, so older certificates can still be checked; a compromised key is marked with the date it was compromised.

The production signing key is the same RSA key Apier uses as its Maskinporten client, so rotating one rotates the other. The private key is held only in the server environment, never in the code repository, and a written runbook covers rotation and a suspected leak.

Sandbox certificates are signed with a separate Ed25519 key, `apier-sandbox-cert-1`, published at `/.well-known/sandbox-jwks.json`. That key is public on purpose: anyone can reproduce it, so a sandbox certificate shows only that the format checks out, never that Apier vouched for the content.

The planned Apier Verify mandate receipts have their own signing key in the design, and signer references use a separate HMAC key, kept apart from every signing key. Neither is in use today.

## Access control

The API takes an API key as a Bearer token. Each key carries scopes, and every endpoint checks the scope it needs. An account can hold at most three active keys. It can also create sub-keys for its agents: each one expires, carries only the scopes it was given, and counts against its parent key's limits.

Public endpoints, such as the receipt check and the public receipt log, need no key. The API and the MCP server are rate limited: per key where there is one, per IP address where there is not.

The dashboard uses a one-time sign-in link sent by email; there are no passwords. The internal admin surface is open only to a signed-in account whose email address is on an allowlist, or to a separate admin key; both are set in the server environment. Multi-factor sign-in is not in place yet.

## Logging and retention

API request and response logs and error logs are kept for 30 days and then deleted. Delta logs, the records of what changed, are anonymised after 12 months.

Each MCP tool call is logged for 24 months. Secrets are removed before a row is written, and tools that handle signer data have their signer fields replaced with `[REDACTED]`.

The audit log is append-only: rows are never updated or deleted. Government access tokens are never logged; only the time, the scope and whether the call succeeded.

Errors are reported to Sentry with personal data scrubbed before sending.

## Incidents

Report a vulnerability to security@apier.no. The disclosure policy is at /security and the machine-readable contact at `/.well-known/security.txt`.

Outages and their updates are posted on the status page, /status.

If personal data is breached, Apier notifies Datatilsynet without undue delay and, where possible, within 72 hours of becoming aware of it, unless the breach is unlikely to put people's rights and freedoms at risk (GDPR article 33). A suspected leak of a signing key follows its own runbook: the key is rotated and marked compromised in the published key file.

## Sub-processors

This is the list /trust shows, where each data processing agreement's status is given. It also names public authorities and services that receive no data from Apier's servers, so every data flow is listed.

Supabase: Primary database. Region: EU (Stockholm, eu-north-1).

Vercel: Build + hosting (server functions in Stockholm). Region: Global CDN edge; server functions EU (Stockholm, arn1).

Sentry: Error tracking (no PII per scrubber config). Region: EU.

Plausible: Privacy-first analytics (cookieless, no PII). Region: EU (Germany).

Betterstack: Uptime monitoring + hosted status page. Region: EU-region storage by default; US parent (Better Stack, Inc.); transfers under the EU-US Data Privacy Framework with SCC fallback.

Maskinporten (Digdir): Norwegian government auth broker (operator-side client and connectivity check only; the customer-facing Altinn paths were withdrawn on 2026-10-21). Region: Norway (EU/EEA).

Lovdata: Read-only legal-text reference (no data sent). Region: Norway (EU/EEA).

Resend: Transactional email (welcome, magic link). Region: EU (Ireland).

Stripe: Payment processing + subscription billing (Checkout, webhooks, invoicing). Region: EU entity (Stripe Payments Europe Ltd, Ireland); US parent; transfers under the Stripe Data Transfers Addendum (SCCs / EU-US Data Privacy Framework).

Altinn (Digdir): Norwegian government platform (no submissions through Apier: Apier submits nothing to Altinn and holds no customer delegation; the filing and delegation routes answer 410 CAPABILITY_WITHDRAWN since 2026-10-21). Region: Norway (EU/EEA).

Skatteetaten: Norwegian Tax Administration (no filing and no status polling through Apier: Apier holds no Skatteetaten scope or certificate for customers; the filing routes answer 410 CAPABILITY_WITHDRAWN since 2026-10-21). Region: Norway (EU/EEA).

NAV: Norwegian Labour and Welfare Administration (employment-relationship reads; mock by default, live flag-gated; not yet in production use). Region: Norway (EU/EEA).

Google: Preferred Sources button on guide pages (publisher.js script + button iframe loaded from news.google.com by the visitor's own browser; once loaded it persists for the rest of the client-side browsing session; no data sent by Apier's servers). Region: United States (Google LLC); browser-side loading only; transfer mechanism for that processing not asserted here (unverified; see DPA note).

## Penetration test

No external penetration test of the API has been done yet. When one has been done, its summary is published in this section.

## Certifications

Apier holds no security certification. It does not claim ISO 27001, SOC 2 or any other certification.

## Vendor questionnaire

The common questions from vendor security assessments, answered from this page, are in a CSV file you can download and fill into your own form: /trust/security/questionnaire.csv.

## Related pages

- [Trust and data handling](https://www.apier.no/trust)
- [Security disclosure policy](https://www.apier.no/security)
- [Privacy policy](https://www.apier.no/privacy)
- [Service levels](https://www.apier.no/sla)
- [Vendor questionnaire (CSV)](https://www.apier.no/trust/security/questionnaire.csv)
