What Relay protects, and what not

One small, fixed pipeline sits between private data and every app or agent.

Where it stands. The code is open and the limits are enforced in code. This is a first version: no outside security review, and Relay itself can technically read tokens and data.

What Relay does today

Six steps, always in this order

1. Check
The grant, the request and its definitions must all be valid.
2. Budget
The most the answer could reveal must fit the limits.
3. Fetch
Only what the question needs is read.
4. Compute
Fixed rules, or one AI call without tools or memory.
5. Release
The result must match the contract, or nothing leaves.
6. Record
The release joins a sealed log. The caller gets a receipt.
The six steps in full
1. Check
The grant must belong to the calling app, must not be revoked or expired, and must cover this operation. The request must match the contract's input schema, and any definition it names must be one the grant covers, unchanged.
2. Budget
Relay works out the most this answer could reveal, in bits. If that is above the contract's limit, or the grant's 30-day budget cannot cover it, the request stops here, before any data is read.
3. Fetch
Only what the operation needs is read: busy times for a slot search, the fields of one record for a check, one number for a total.
4. Compute
Fixed rules, or one call to an AI model that has no tools and no memory. Whatever the model returns is treated as untrusted.
5. Release
The result must match the contract's output schema and the operation's own checks, such as "every ID is a registered option". If it does not, nothing is released and the block is logged.
6. Record
The release is appended to a hash-chained log. The caller gets the result with a receipt ID.

Requests from the REST API and from agents over MCP use the same code path.

Between steps 1 and 2 Relay looks for a stored answer to the same question. If there is one, it is returned and nothing else runs. The budget is charged before the data is read, so a request that fails during fetch or compute still counts.

Five limits on what apps learn

A fixed shape
Each answer has one schema, with no free text field.
Shaped questions
Inputs are short lists of allowed values, never a query.
Same question, same answer
Asking again inside the time window reveals nothing new.
A budget
Every answer is charged in bits to a 30-day budget.
Pinned definitions
Change a definition and old grants stop until a new approval.
The five limits in full
A fixed shape
Each operation has one output schema. A result is up to three time slots, a few option IDs, a yes/no with a reason code, a range, or ticked facts. There is no free text field for data to leave through.
Shaped questions
Inputs are short lists of allowed values: a window of 3, 7 or 14 days, a registered ID, a parameter that must match a registered pattern. An app cannot write its own query.
Same question, same answer
Similar requests are brought to one canonical form. Inside one time window the same question returns the stored answer, so asking again reveals nothing new.
A budget
Each answer is charged in bits to a 30-day budget, per person, per app and per operation (per policy grant in company mode). When the budget or the call count is used up, new questions are refused until the period ends. The budget follows the person for one app, so approving the same app again does not reset it. In company mode it belongs to the policy grant, so it limits the agent as a whole, across all records.
Pinned definitions
Option lists, totals, profile forms and checks are hashed when the grant is created. If the app changes a definition afterwards, requests under the old grant are refused until there is a new approval.

The numbers are in the contracts: bits per answer, 30-day budget and time window.

A sealed log and receipts

Sealed log
One chain per person. An edit, removal or reorder breaks it.
Receipts
Every result carries a receipt ID the app's server can fetch.
Receipts page
The person sees every answer, and can end access and remove sources.
Log and receipts in full

Each person has their own chain of entries. Company-mode apps have one chain per app. Every entry is sealed together with the entry before it, using a key that is not in the database. The newest position is kept in a separately sealed record. An edited, removed, reordered or re-sealed entry breaks the chain, and so does cutting entries off the end.

Recorded: approvals, declined requests, source changes, releases, refused requests on a grant, blocked results, revocations and issued agent tokens.

A receipt holds the operation, contract version and hash, hash of the output, bits charged, and its position in the chain.

In personal mode the person gets a private receipts page. It lists every operation with what was released, re-checks the chain each time it loads, and has buttons to revoke access and remove sources. The page is private to whoever has its link.

Limit: the log is stored in Relay's own database. Someone who can write to the database and saved an earlier copy could put the whole log and its head back to that earlier state, and this would not show until the latest seal is published somewhere outside Relay. Someone who also holds the key can re-seal anything.

Attack tests

16 of 16 attack tests passed. Results generated 2026-11-10 19:13 UTC.

All 16 tests
TestGroupWhat it triesResult
01Injectiona model that obeys instructions hidden in a person's documents still cannot release anything but registered idspass
02Injectioncanary strings planted in every source never reach a result, an API response or the logpass
03Leakagemapping a person's day by binary search on find_slots stops at the budget, before any source is readpass
04Leakagechanging the registered candidates after consent is refused, not computed and not chargedpass
05Leakagerepeats and requests that differ only in form return one cached answer and are charged oncepass
06Leakagean exhausted budget fails closed for every operation, and no single answer can exceed its contractpass
07Widgetforged, replayed, expired and cross-app link tokens are rejectedpass
08Widgetconsent, receipt and console pages forbid framing and send no referrerpass
09Widgetthe browser SDK ignores spoofed postMessage eventspass
10Agents (MCP)the MCP endpoint accepts only a live agent token, and that token reaches only its own grantpass
11Agents (MCP)consent cannot be completed by someone holding only the API key or a grantpass
12Agents (MCP)calendar addresses and company connectors cannot be pointed at private hostspass
13Isolation and auditone app cannot use another app's grant, link token, receipt or config, and cannot tell that they existpass
14Isolation and auditediting, deleting or reordering any log entry is detectedpass
15Isolation and auditexpired and revoked grants are refused at the first step, for every operation and over MCPpass
16Buildthe source fingerprint is deterministic and changes when one byte of any source file changespass

Each test tries to get something past the boundary. Run them with npm run redteam; a version is meant to ship only when all pass. Passing shows that these attacks failed, not that no attack can succeed.

Which code was published

Fingerprint
5ac8ef090ca4a6df980838d27cc8d18fcd5994fd8163ac9cad7142b243bd2804
Files hashed
122
Generated
2026-11-10 19:13 UTC

A hash of the source tree. Recompute it from the repository with node scripts/fingerprint.mjs and compare.

What is not built yet

Attested servers
Planned. Until then Relay itself can technically read tokens and data.
Reproducible container builds
You cannot yet rebuild the deployed image and compare it bit for bit.
Outside security review
Not done. This deployment is a first version.
Email receipts
People reach their receipts through the private link shown after approval.
OAuth sign-in for MCP
Agents use a bearer token bound to one grant.
Published log heads
The log's latest hash is not yet published outside Relay's database.

What Relay never claims

Zero disclosure
Every answer reveals a little. The budget limits how much.
Immunity to hidden instructions
Text in a person's data can still nudge a ranking inside the allowed outputs.
Protection across apps
The budget does not span apps. Two apps that pool results learn more.
Control after release
What an app does with a result afterwards is outside Relay.
A legal shield
Data protection law still applies, and your responsibility does not move to Relay.
A log nobody can roll back
Someone with database access and an old copy could restore it unnoticed.
Proof of what the server runs
The source fingerprint covers the published code, not the running server.

What is stored

Calendar file (.ics)
Event timing only, encrypted. Titles, attendees and locations are never stored.
Live calendar address
The address only, encrypted. The feed is not kept.
Google Calendar sign-in
A refresh token limited to free/busy, encrypted.
Documents and notes
The full text, encrypted.
Bank export (CSV)
Date, amount and category per row, encrypted.
Company connectors
Connection details, encrypted. Records are not copied into Relay.
The browser a person used
A random cookie ID that ties sources to one browser.
Keys and tokens
SHA-256 hashes. Console passwords as scrypt hashes.
Audit log
Every event, with requests and released results. Not encrypted by Relay.
Stored answers
Each released result, so repeats match.
The person's ID
Exactly as your app sends it. Send an opaque ID.
Encryption
AES-256-GCM, one data key per source. Whoever operates Relay can decrypt.
AI model calls
Document text goes to the model provider. Without a model key, nothing does.
Never
User data is never sold and never used for training by Relay.
Storage in full
WhatHow it is kept
Calendar file (.ics)Reduced while parsing to start, duration, time zone, repeat rule and skipped dates. Titles, attendees, locations and descriptions are dropped and never stored. The reduced list is stored encrypted.
Live calendar addressOnly the address is stored, encrypted. The feed is fetched when an operation runs, reduced to timing in memory, and not kept.
Google Calendar sign-inA refresh token limited to Google's free/busy permission, stored encrypted. Relay asks Google for busy times only.
Documents and notesThe text is stored encrypted, up to 400,000 characters per file. Ranking and profile suggestions need the text itself, so it is not reduced further. At most 24,000 characters are used in one computation.
Bank export (CSV)Each row is reduced to date, signed amount and a category. The description and merchant text are dropped after categorising. Up to 20,000 rows are stored, encrypted.
Company connectorsThe database connection string, or the API base address and one header, stored encrypted. Records are read when an operation runs and are not copied into Relay.
The browser a person usedA random id in a cookie on Relay's own address. Sources are tied to it, and an approval can only use sources connected from the same browser. An app that holds a consent link but not the person's browser sees none of their sources and cannot approve on their behalf. On a new browser the person connects their sources again.
Keys and tokensAPI keys, link tokens, agent tokens and receipt links are stored as SHA-256 hashes. Console passwords are stored as scrypt hashes.
Audit logEvery approval, source change, release, refusal and block. A release entry holds the request, the released result and its hash, the bits charged, and how it was computed. Log entries are not encrypted by Relay.
Stored answersThe released result of each question, so the same question returns the same answer.
The person's IDThe ID your app uses for the person, exactly as you send it. Send an opaque ID, not an email address.
Encryption and AI calls

Each source is encrypted with AES-256-GCM under its own data key. The data key is wrapped by a master key from the server's environment, and each record is bound to its owner.

The master key sits on the server. Whoever operates Relay can decrypt what is stored. This is the limit that attested servers are meant to remove.

Ranking and profile suggestions call the configured model provider. The person's document text and the registered options are sent in that call. The model gets no tools.

Without a model key these operations run on rules, and nothing is sent to a model provider.

How to report a problem

Where
Privately, to the address in SECURITY.md of the repository. No public issue.
What to send
What you found, how to reproduce it, what an attacker could gain.
In scope
Getting data past the boundary, bypassing a grant or budget, breaking the log.
Please
Do not test against other people's data.

Developer documentation