Secure links, calendar files and privacy engineering

How a link can safely stand in for an account - random tokens, purpose binding, expiry, hashing and revocation - how magic links work and where they fail, how an iCalendar invitation is written so an update replaces it and a cancellation removes it, and the privacy-engineering techniques behind it all: data minimization, retention and scheduled erasure, anonymization versus deletion, personal-data markers, an audit trail without values, and fairness filters for AI text about people.

In short

Some people need to reach one record without ever creating an account: a candidate checking an application, an interviewer from another company leaving feedback, a client approving a design. {{brand}} gives them a secure link - an address that carries a long random secret, works for one purpose, expires and can be revoked. Interviews reach their calendars as iCalendar files that a later email can move or remove. Underneath sits privacy engineering: deciding what is kept about people, for how long, who may see it and what the audit trail may remember.

After this lesson you can Design a no-password link that survives logs, mail scanners and forwarded emails; explain magic links and their traps; write an .ics invitation that updates and cancels correctly; apply minimization, retention, anonymization and audit without values.

Words you need

Secure links: how a link becomes a key

An account answers the question who are you? with a password, a passkey or a company sign-in. A capability URL asks a different question: what do you hold? If the secret in the link is real, live and meant for this page, the server lets you in. That is exactly right for a person who will open one record a few times and should never need to sign up - and exactly dangerous if the link leaks.

Every failure must look the same If an expired link answers link expired and an unknown one not found, an attacker learns which guesses were once real. Give every failure the same status and body, and offer one way forward for everyone: ask for a new link by email.

Two kinds of link token: stored or self-contained

A link token can be a random key the server looks up, or a self-contained token that carries its own data and a signature - a JWT, an HMAC over the fields, or ASP.NET Core's Data Protection. Both are used in real systems; they fail in different ways.

Products often use both: stored tokens for links to records, signed tokens for one-shot mailbox proofs. A reset link is usually single-use because the reset changes a per-account value the token carries - the security stamp.

Magic links: proving a mailbox

A magic link is a capability URL whose use proves something about the person: that they can read mail at this address. Many products use it to sign people in without a password. The token rules above all apply, and three traps are added: mail scanners, account enumeration and inbox flooding.

Typical uses: confirming an address, resetting a password, letting an outside reviewer find their link again.

The options in the market

What {{brand}} chose, and why

Hiring and sharing bring in people who are not members of a workspace: candidates, interviewers from outside, clients, reviewers. Asking each of them for an account would collect personal data the task does not need and lose many of them at the door. So {{brand}} uses stored random links - one shared design for every module - and follows the data minimization principle further: a person without an account is known only by what the hiring team or the share needs.

The trade-off accepted A link is a bearer credential: anyone who receives the email can use it until it ends. {{brand}} keeps that window small with purpose, audience and lifetime, and makes a fresh link one request away. Links read by other programs, such as calendar feeds, cannot use headers; for those the right controls are a hashed token, revocation and a short list of live links - a trade-off worth knowing when you design your own.

Another choice would be right elsewhere. People who come back every day deserve accounts with two-step sign-in. A link that moves money or signs a contract needs a second factor. A huge public service checking millions of links at the edge may prefer self-contained tokens and accept weaker revocation.

iCalendar invitations: one event, many updates

An .ics file is plain text in the format of RFC 5545. Sent by email - the iMIP binding of RFC 6047 - it becomes an invitation the mail client offers to add. What makes it powerful is not the first email but the later ones: the same UID with a higher SEQUENCE replaces the copy in the calendar, and METHOD:CANCEL removes it.

Send one invitation per recipient, naming only them, so no address reaches another person. Write times in UTC, so an interviewer in Baku and a candidate in Berlin each see their local time. If the organizer address cannot receive mail, set RSVP=FALSE so the calendar does not offer a reply nobody will read.

Privacy engineering: principles turned into code

GDPR Article 5 lists the principles for personal data, and Article 25 asks for data protection by design and by default. They are easy to agree with and hard to build. Privacy engineering is the craft of turning each one into a schema decision, a default or a scheduled job, so a busy developer cannot forget it.

Retention and scheduled erasure

A retention policy is a rule for how long data is kept, and a policy that nobody enforces is a sentence in a document. Enforcing it takes a scheduled job that finds what ran out, erases it the same way a person's request would, and is safe to run again and again. A typical design lets each workspace choose from a few fixed periods, counted from when the record finished or its parent closed, whichever came first.

Consent is retention too Consent-based data (a talent pool, a newsletter) needs a retention rule too: when consent ends, the data goes.

Delete, anonymize or pseudonymize?

When personal data must go, there are four tools, and they are not interchangeable. The question is always: what does the rest of the system still need, and can what is left be tied back to the person?

Anonymous is harder than it looks Removing the name is not enough. Latanya Sweeney showed that ZIP code, birth date and sex alone single out most Americans. Free-text fields, file names, an id that maps back and exact timestamps combined all re-identify. Clear every free-text field, give the row a new random id with no table that maps it back, and keep only what the numbers need.

A typical design keeps the row a pipeline needs, with its stage and dates, clears every field that describes the person, replaces the link to any account with a new random id (or clears it when there was none), and removes files and copies elsewhere. The row-by-row techniques are in the Data lesson.

Personal-data markers and an audit trail without values

An audit trail that copies every old and new value is a second database of personal data - and the erasure job usually forgets it. The fix is to mark personal fields in the model once. The logging code reads the marker: it records that the field changed and who changed it, never what it held.

Fairness filters for AI text about people

The EU AI Act lists AI used to recruit or select people as high-risk. A model's bias is hard to measure and impossible to explain to the person it rejected. {{brand}}'s rule is short: AI may summarize and quote, labelled and editable, and it never scores, ranks, recommends or rejects a person. Fairness filters are the code that holds the model to that rule.

Fail closed A language nobody measured shows nothing, not a weaker filter. A check that cannot finish counts as a fail. The same idea runs through the AI-safety lesson: /help/technology/ai-safety.

Try it yourself: a secure link and a calendar invitation

The exercises need only Node.js, any calendar app and a database such as PostgreSQL or SQLite. Run the server on localhost and watch what reaches its log.

Common mistakes

Interview questions

Related