# Privacy Notice

**Pre-launch version.** DevGrail is not available to the public yet, and this
notice is not finished. It can change at any time until DevGrail launches.
Each change is shown on the Agreements & privacy page as a new version.

## Who is responsible for what

A DevGrail installation runs on its operator's own server. Accounts, workspaces,
files and everything else stored in the installation stay there, and the
operator is responsible for them. The DevGrail provider receives none of them.

The DevGrail provider is responsible for the reports an installation sends to
the DevGrail site it was installed from: the heartbeat, the Operator Agreement
acceptance it delivers, and the usage report of plans billed by usage. It is
also responsible for the other requests DevGrail makes to that site: update
checks and downloads. It is also responsible for accounts on the DevGrail
website, which are separate from the accounts in an installation, and for
which installations they are linked to. This notice describes all three.

## The installation heartbeat

Every DevGrail installation reports to the DevGrail site it was installed from.
This report is called the heartbeat. It cannot be turned off.

**Why.** The heartbeat tells the DevGrail provider that an installation exists
and which release it runs. It also delivers the installation's acceptance of the
Operator Agreement, so the provider has a record that the terms were accepted.
The provider also checks that an installation applies the plan document it was
sent, to administer the agreed subscription limits and investigate possible
circumvention. A mismatch flag prompts human review; it does not itself change
the subscription or stop work.

**Legal basis.** Where the heartbeat identifiers and plan-check records are
personal data, the DevGrail provider processes them on the basis of its
legitimate interests in knowing which installations exist, keeping a record of
accepted terms, administering agreed subscription limits and preventing misuse
(GDPR Article 6(1)(f)). You can object to this processing; see Your rights.

**When.** Nothing is sent until an administrator accepts the Operator Agreement.
After that, the installation sends a heartbeat each time the DevGrail server
starts and then about once every 24 hours, or more often, at most hourly, when
the DevGrail site asks, for example while it moves plans or deals with an
outage. The site asks in its reply to a heartbeat, and the installation returns
to about once every 24 hours as soon as a reply no longer asks. An
administrator can also send one by hand.

**What a heartbeat contains**, and nothing else:

- `protocol_version`: the version of the report format.
- `installation_id`: a random ID created when DevGrail was installed, or
  when an administrator started a new installation identity.
- `instance_id`: a random ID for this copy of the installation, so a copy
  restored on another server can be told apart.
- `run_id`: a random ID for this start of the DevGrail server.
- `report_id`: a random ID for this report, so one sent twice counts once.
- `sequence`: the number of this report within the run.
- `release`: the DevGrail release, such as v1.4.0.
- `os`: the operating system, such as linux.
- `arch`: the CPU architecture, such as amd64.
- `entitlement_sha256`: a checksum of the plan document the installation
  received, which tells the DevGrail site whether it applies the document sent;
  empty when no document is stored.
- `entitlement_applied`: which part of that document applies now (`current`,
  `next` or `fallback`), or `none` before the first document.

**What an Operator Agreement acceptance contains:** the document's type,
version, language and SHA-256 checksum, when it was accepted, that the
administrator declared authority to accept it, and a random event ID. It does
not say who accepted.

A random credential, created with the installation ID, proves that reports
come from the same installation. The DevGrail site stores only a hash of it.
If an administrator starts a new installation identity, because the old one can
no longer report, DevGrail reports as a new installation and sends nothing
that links it to the old one.

**What is not sent:** user names, email addresses, User Agreement acceptances,
workspaces and their files, domain names, usage data and machine fingerprints.
A plan billed by usage sends daily counts in a separate usage report, described
below; the heartbeat itself never does. What may be recorded of the IP
address a report comes from is described under IP addresses.

**Limiting registrations.** So that one network cannot register new
installations without limit, the DevGrail site counts the registrations that
come from each IPv4 address, or from each IPv6 network of the size usually
given to one customer (a /56), and refuses more than three in an hour. The
counter keeps a keyed hash of the address in memory, whose key is lost whenever
the site restarts, and forgets it once the hour is over. Heartbeats and Operator
Agreement acceptances are not counted this way. A refused registration does not
affect the installation, which keeps working and tries again later.

**What the reply contains.** The site answers each registration and heartbeat
with the installation's plan document: plan names and versions, limits,
features, any end date and scheduled plan, and the default plan to use after a
long outage. Heartbeat replies also give the release support status
(supported, outdated or retired), with the provider's reason and any date by
which the release should be updated, and may ask for the next heartbeat
sooner; registration does not report a release, and its reply omits that
status. The reply never includes prices. The installation
stores the document locally so that plan changes can take effect while it is
offline.

**What is kept.** Details of each server start are kept for 90 days after it
was last seen. When an installation has not reported for 12 months, its
release, operating system, architecture and when it was seen are removed. Its
random ID and the hash of its credential are kept with its acceptance records,
so the installation can report again if it comes back. Acceptance records are
kept as evidence that the terms were accepted, for as long as claims under the
Operator Agreement can be made.

The provider also keeps a record of each plan document sent, its checksum,
installation and instance IDs, issue time and the term it describes, for
31 days. A mismatch flag and the instance's consecutive mismatch state are
kept until a matching heartbeat clears them or an administrator dismisses them.
The subscription history records when a flag was set, cleared or dismissed, and
is kept with the acceptance records. A heartbeat retry does not count as
another mismatch.

**Seeing it.** Every user can read this description on the Agreements & privacy
page. Administrators can see the last heartbeat exactly as it was sent on the
Administration page, under Installation reporting.

## Update checks and downloads

DevGrail also asks the DevGrail site it was installed from for things it needs,
without sending a report: whether a newer release is available, official
scripts and skills, the current versions of the agreements and of this notice,
and, when an administrator installs or updates DevGrail, the release itself.

**Why.** So that administrators learn about new releases, and about releases
that need to be updated (for example after a security fix), even when nobody
has opened the dashboard; so that DevGrail can download what it needs; and so
that the provider can tell which releases still use a part of the site before
changing it, and tell an installation that is too old for a change what to do.

**Legal basis.** Where these requests are personal data, the DevGrail provider
processes them on the basis of its legitimate interests in keeping
installations up to date and secure and in changing the DevGrail site without
breaking installations that still use it (GDPR Article 6(1)(f)). You can object
to this processing; see Your rights.

**When.** The installation checks for updates by itself about every 6 hours
and shortly after the DevGrail server starts, and at once when an
administrator clicks Check for updates. It does this whether or not the
Operator Agreement has been accepted, because it is not a report. An
installation that has no DevGrail site configured makes no update checks.
Downloads happen when they are needed: the agreements and this notice after
each start, an official script or skill when someone installs it, a release
when an administrator installs or updates DevGrail.

**What these requests contain:**

- The address of what is asked for. An update check asks for the support
  status of the installed release, so its address names that release, such as
  v1.4.0. A download names what is downloaded.
- A `User-Agent` header naming the program that makes the request and its
  release: the DevGrail server (`devgrail-server/v1.4.0`), the installer
  (`devgrail-install/v1.5.0 (installed v1.4.0)`, naming the release installed
  on the server, or `none` on a new server), the dashboard's update helper
  (`devgrail-upgrade-helper/v1.4.0`) or the desktop add-on's installer
  (`devgrail-desktop-install/v1.5.0`).

They contain no installation ID, no reporting credential, and nothing about
users, workspaces or usage. Nothing in them links one request to another or to
an installation's reports.

**What is kept.** The DevGrail site counts the requests it answers by the
program and release named in the `User-Agent`, and for the installer also the
release installed, for each kind of request (for example, how many requests
from v1.4.0 asked for the list of releases on one day). These counts carry no
IP address, no installation ID and no time of day, only the date, and are kept
for 400 days, so that a change can be weighed against a full year of use.
What may be recorded of the IP address a request comes from is described under
IP addresses.

## The usage report (plans billed by usage only)

**Why.** Some plans are billed by usage, for example per enabled user account.
For an installation on such a plan, the usage report gives the DevGrail
provider the counts the charge is calculated from.

**Legal basis.** Where the counts are personal data, sending them is necessary
to perform the contract with the operator that chose a plan billed by usage
(GDPR Article 6(1)(b)), and keeping them is necessary to meet the provider's
accounting obligations (GDPR Article 6(1)(c)).

**When.** Only while the installation's plan is billed by usage. The
installation counts every hour and sends a usage report after each heartbeat,
with the completed days it has not sent yet. An installation on any other plan
sends no usage report and counts nothing for one.

**What a usage report contains**, and nothing else:

- `protocol_version`: the version of the report format.
- `installation_id`: the same random ID the heartbeat sends.
- `report_id`: a random ID for this report, so one sent twice counts once.
- `days`: for each completed day (UTC) not sent yet, the day, the meter
  (`users`) and that day's highest number of enabled user accounts.

It contains no user names, email addresses or other details of the accounts it
counts, and nothing about workspaces or what anyone does in them.

**What is kept.** The DevGrail site keeps the daily counts of the days on which
the installation's plan was billed by usage, for as long as accounting law
requires billing records to be kept. A count received for a day the plan did
not bill is not kept. Each report's random ID is kept for 31 days, so a report
sent twice counts once. The installation keeps its own daily counts for 62
days.

**Seeing it.** Administrators see whether the plan is billed by usage, and
exactly what is sent, under Settings -> Plan, and the last usage report exactly
as it was sent under Administration, Installation reporting.

## Your DevGrail website account

Anyone can create an account on the DevGrail website, with an email address
and a password, and link installations to it. An account is not needed to use
DevGrail, and it is not an account in any installation.

**Why.** So that you can sign in to the DevGrail website, and so that the
DevGrail provider knows which installations are yours. Nothing depends on that
yet; it is the basis for managing plans and installations from the website
later.

**Legal basis.** Keeping your account and the installations linked to it, and
emailing you to confirm your address, are necessary to provide the account you
asked for (GDPR Article 6(1)(b)). The history of who owned an installation, the
records of the emails sent, and the limits on sign-ins and emails described
below, rest on the provider's legitimate interests in being able to show who
owned an installation when, and in preventing misuse (GDPR Article 6(1)(f)).
You can object to this processing; see Your rights.

**Confirming your email address.** An account is created only once its email
address is confirmed. When you sign up, the DevGrail site emails the address a
link, and you finish by opening it and entering the password you chose. If
the link does not reach you, an operator can confirm the address instead, after
checking by other means that you read it: the account is then created with a
one-time password, which they send to that address, and you must replace it at
your first sign-in; the password you chose is not used. Until then, what you
entered is kept as a *pending sign-up*, which cannot sign in and owns nothing.
If the address already has an account, no pending sign-up is made, and the
email says so instead and suggests signing in. Accounts created before
addresses were confirmed are asked to confirm theirs in the same way, with
their own password. The emails contain the address they are sent to, the link
(for a confirmation), and a short explanation of why they were sent; they
contain no password, except the one-time password an operator sends.

**What the DevGrail site stores:**

- Your email address, as you typed it, and a lowercase copy to compare at
  sign-in, and when the address was confirmed and whether you confirmed it or
  an operator did after checking with you by other means.
- A hash of your password (bcrypt), never the password itself, and when it was
  last changed.
- For each device you are signed in on, a hash of its session token, when the
  session began, was last used and expires. The session token itself is kept
  only in a cookie in your browser.
- When you make a code to link an installation, a hash of the code, when it
  was made and when it expires, and the installation that used it.
- Which installations are linked to your account and since when, and the
  history of each installation's owners: when it was linked, moved to another
  account, released or removed by an operator, with the random IDs of the
  accounts involved and, for an operator, who acted.
- If you give one of your installations a name or a note, what you wrote. It
  is shown to you on your account page, is never sent to the installation, and
  is deleted when the installation is released, moved to another account or
  removed by an operator.
- When an account was created, and whether an operator has disabled it.
- For a pending sign-up: the email address, as you typed it and in lowercase,
  a hash of the chosen password (bcrypt), and when it was made and expires.
- For each confirmation link: a hash of the token in the link, never the token
  itself, the sign-up or account it confirms, when it was made, expires and was
  used, and how many wrong passwords were entered with it.
- For each email the site sends: what kind of email it is, which sign-up or
  account it is for, a hash of the address it went to, when it was queued and
  sent, how many attempts it took, whether it was delivered to the mail server,
  and the error the mail server gave, if any. The message itself is not kept.

**What an installation's administrators see.** An installation's
administrators see a shortened form of its owner's email address, such as
`al•••@example.com`, and when it was linked. When they enter a code to link
the installation, they see the full email address of the account the code
belongs to, so they can check it is the right one before linking. Nobody else
using an installation sees anything about its owner. The installation does not
store the owner; it asks the DevGrail site each time.

**How the emails are sent.** The DevGrail site hands each email to the email
service provider the DevGrail provider uses for sending mail, which processes
the address and the message to deliver it, and may keep its own delivery
records under its terms with the DevGrail provider.

**What DevGrail operators see.** The DevGrail provider's operators see each
account's email address, when it was created, whether its address is confirmed,
whether it is disabled, its installations and their history. They also see
pending sign-ups with their email addresses, and the emails sent to each
sign-up or account, with their delivery state and errors. They never see
passwords, session tokens, codes or the tokens in confirmation links. If you
forget your password, an operator can set a one-time password, after confirming
by other means that you are asking; you must replace it at your next sign-in.

**Limiting sign-ins.** The DevGrail website counts sign-ins, sign-ups, attempts
to confirm an address, and requests for a confirmation email from each IPv4
address, or from each IPv6 network of the size usually given to one customer (a
/56), and refuses more than 20 sign-ins in 15 minutes, more than five sign-ups
in an hour, more than 20 attempts to confirm in 15 minutes and more than five
confirmation emails in an hour. The counter keeps a keyed hash of the address
in memory, whose key is lost whenever the site restarts, and forgets it once the
time is over. The site also counts failed sign-ins for each account, and the codes
each installation enters that match no open code, for an hour at most. It sends
at most three emails an hour and ten a day to any one address, counted from the
hashes in its email records.

**What is kept.** Your account is kept until you delete it on your account
page, with your password, or ask the DevGrail provider to delete it. A session
ends when you sign out, or 7 days after you signed in, and is then deleted. A
code works once, for five minutes; it is deleted a day after it was made. A
pending sign-up is deleted 24 hours after it was made, as soon as any sign-up
for its address is confirmed, or when an operator deletes it. A confirmation
link works once, for 24 hours, and stops working after five wrong passwords; it
is deleted a day after it expires or is used. A record of an email is deleted 7
days after it was sent or failed, or 7 days after it was queued if it never
was. When an account is deleted, its email address, password hash, sessions,
codes and confirmation links, and the names and notes of its installations, are
deleted, and its installations are no longer
linked to anyone. The history of each installation's owners is kept with the
account's random ID only, without the email address, for as long as the
installation's acceptance records are kept.

## IP addresses

Every request to the DevGrail site comes from an IP address: an installation's
reports, its update checks and downloads, and visits to the website. The
DevGrail site, the web server and hosting provider in front of it, and the
network providers in between may record that address, for example in access
logs, together with the time, the address of what was asked for and the
`User-Agent`. It is used to deliver the request, to keep the site running and
secure, and to find faults, and is kept only as long as those purposes need.

**Legal basis.** Recording it is necessary for the DevGrail provider's
legitimate interest in running the site and keeping it secure (GDPR Article
6(1)(f)). You can object to this processing; see Your rights.

## Your rights

Where the reports above are personal data about you, you have the right to ask
the DevGrail provider for access to it, and to have it corrected, erased or
its processing restricted. You can object to processing based on legitimate
interests; the provider then stops unless it has compelling legitimate grounds
or needs the data for a legal claim. You can also complain to a data protection
supervisory authority.

The reports carry no names or contact details, so the provider can only find
the records of an installation when its installation ID is given. Administrators
can see that ID on the Administration page, under Installation reporting.

For your DevGrail website account, ask from the email address it uses. The
provider confirms that you control that address before it acts. Until the
website lets you do it yourself, this is also how you ask for a copy of your
account's data. You can delete the account yourself on your account page, or
ask the provider to delete it the same way.

## Changes to this notice

New versions of this notice are published to every installation and shown on
the Agreements & privacy page. Nobody is asked to accept this notice; it is
information.
