Contracts

The public rules of each question: what goes in, what comes out, how much it reveals.

How to read a contract

Relay refuses any request that does not fit the contract and blocks any result that does not match it.

OperationModeMax per answerNew answers / 30 daysTotal / 30 daysSame answer for
find_slots
Find options
personal23 bits12140 bits24 hours
rank_options
Rank candidates
personal13 bits20130 bits24 hours
check
Check
company4 bits5,00020,000 bits1 hour
aggregate
Bounded totals
personal, company4 bits3060 bits24 hours
profile
Profile facts
personal30 bits660 bits24 hours
Bits
How much an answer can tell the app. 10 bits is one choice among about a thousand.
Budget
What a grant can collect in 30 days. Charged before any data is read.
Gets, never sees
The exact wording a person reads in the approval window.
Hash
Returned with every result and stored in every receipt.
How limits are counted
  • One bit is one yes/no question's worth of information. Fewer bits means the app learns less from one answer.
  • Relay charges the upper bound for each request, whatever the answer turns out to be.
  • Personal mode: counted per person, per app and per operation. Approving the same app again does not reset it. The 30-day period starts when the person first appears for the app.
  • Company mode: counted per policy grant, from the day it is created.
  • When the budget or the call count is used up, new questions are refused until the period ends.
  • The same question inside the same time window returns the stored answer at no cost. Windows follow the UTC clock.
  • Two apps that pool their results can learn more than either alone.

Machine-readable, no key needed: GET /api/v1/contracts. How to call an operation.

Find options

find_slotsPersonal modeRules

Returns up to three free time slots from a person's calendar. Only busy and free times are read; nothing else leaves.

The app getsUp to 3 free time slots
The app never seesEvent titles, who you meet, locations
Inputdate_from, window_days, slot_minutes, days, timezone
Outputslots
ReadsThe person's calendar, as busy and free times only.
One answerAt most 23 bits, one choice among about 8.4 million
New answers per 30 days12
Total per 30 days140 bits
Same question, same answer24 hours
Fixed: grid minutes30
Fixed: day start08:00
Fixed: day end20:00
Fixed: max slots3
Version1.0.0
Contract hash0f4f066a1aa279e6

Never released

  • event titles
  • attendees
  • locations
  • descriptions
  • why a time is busy
How it is computed

Fixed rules compute the result. No AI model is involved.

The cost is the number of bits needed to name any choice of up to 3 slots on the grid. A 7-day window with 60-minute slots has 161 possible start times and costs 19.41 bits. A 14-day window with 30-minute slots costs 22.6 bits.

Input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "date_from",
    "window_days",
    "slot_minutes"
  ],
  "properties": {
    "date_from": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "window_days": {
      "enum": [
        3,
        7,
        14
      ]
    },
    "slot_minutes": {
      "enum": [
        30,
        45,
        60
      ]
    },
    "days": {
      "enum": [
        "weekdays",
        "all"
      ]
    },
    "timezone": {
      "type": "string",
      "maxLength": 40,
      "pattern": "^[A-Za-z_]+(/[A-Za-z0-9_+-]+){0,2}$"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "slots"
  ],
  "properties": {
    "slots": {
      "type": "array",
      "maxItems": 3,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end"
        ],
        "properties": {
          "start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:00\\.000Z$"
          },
          "end": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:00\\.000Z$"
          }
        }
      }
    }
  }
}

Rank candidates

rank_optionsPersonal modeAI model, then a check

Orders a list of options the app registered in advance by how well they fit the person. Only the top option IDs are released, without scores or reasons.

The app getsIts own options, ordered by how well they suit you (top 3 only)
The app never seesYour documents, history, or why an option ranked high
Inputcandidate_set, top_k
Outputranking
ReadsDocuments and notes the person shared.
One answerAt most 13 bits, one choice among about 8 thousand
New answers per 30 days20
Total per 30 days130 bits
Same question, same answer24 hours
Fixed: min candidates3
Fixed: max candidates20
Version1.0.0
Contract hash2dea2fe2ca8df6e4

Never released

  • the documents and history used
  • scores
  • reasons
  • any free text
How it is computed

An isolated AI model with no tools reads the person's documents and returns an ordering. Relay accepts it only if it is a valid selection of the registered options. If no model is configured, or its reply is not valid, word-matching rules do the ranking.

The cost is the number of bits needed to name an ordered pick of top_k options out of the registered set. The top 3 of 8 options cost 8.4 bits. The top 3 of 20 cost 12.74 bits.

Input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "candidate_set",
    "top_k"
  ],
  "properties": {
    "candidate_set": {
      "type": "string",
      "pattern": "^[a-z0-9_-]{1,40}$"
    },
    "top_k": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "ranking"
  ],
  "properties": {
    "ranking": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9_-]{1,40}$"
      }
    }
  }
}

Check

checkCompany modeRules

Answers one registered yes/no question about a record the company holds, with a reason code. The record itself never reaches the agent.

The app getsYes or no, plus a reason code
The app never seesThe record behind the answer
Inputcheck, params
Outputanswer, reason
ReadsOne record the company holds, through its database or API connector.
One answerAt most 4 bits, one choice among 16
New answers per 30 days5,000
Total per 30 days20,000 bits
Same question, same answer1 hour
Fixed: max reason codes15
Version1.0.0
Contract hash40e00c031d8044de

Never released

  • the customer record
  • names, emails, addresses
  • free-text notes
How it is computed

Fixed rules compute the result. No AI model is involved.

The cost depends on how many different answers the check can give: ok, not_found, and one code per registered failure. A check with three failure codes has five possible answers and costs 2.33 bits.

Input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "check",
    "params"
  ],
  "properties": {
    "check": {
      "type": "string",
      "pattern": "^[a-z0-9_-]{1,40}$"
    },
    "params": {
      "type": "object",
      "maxProperties": 4,
      "additionalProperties": {
        "type": "string",
        "maxLength": 64
      }
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "answer",
    "reason"
  ],
  "properties": {
    "answer": {
      "type": "boolean"
    },
    "reason": {
      "type": "string",
      "pattern": "^[a-z0-9_]{1,40}$"
    }
  }
}

Bounded totals

aggregatePersonal modeCompany modeRules

Returns one registered total as a coarse range, for example monthly spend on groceries between 200 and 400. Individual rows never leave.

The app getsA few totals as rough ranges
The app never seesYour transactions, merchants or exact amounts
Inputaggregate
Outputbucket, from, to
ReadsPersonal mode: the person's bank export, reduced to date, amount and category. Company mode: one number from a registered query.
One answerAt most 4 bits, one choice among 16
New answers per 30 days30
Total per 30 days60 bits
Same question, same answer24 hours
Fixed: min buckets3
Fixed: max buckets8
Fixed: company min group10
Version1.0.0
Contract hashc9b7561fbe405ce7

Never released

  • individual transactions
  • merchants
  • exact amounts
  • dates
How it is computed

Fixed rules compute the result. No AI model is involved.

The cost depends on how many ranges the total has. Four boundaries make five ranges, which cost 2.33 bits. In company mode the extra answer "too few to show" counts as one more possibility.

Input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "aggregate"
  ],
  "properties": {
    "aggregate": {
      "type": "string",
      "pattern": "^[a-z0-9_-]{1,40}$"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "bucket",
    "from",
    "to"
  ],
  "properties": {
    "bucket": {
      "type": "integer",
      "minimum": -1,
      "maximum": 8
    },
    "from": {
      "type": [
        "number",
        "null"
      ]
    },
    "to": {
      "type": [
        "number",
        "null"
      ]
    }
  }
}

Profile facts

profilePersonal modeSuggestion, then the person decides

Releases a small set of facts the person reviewed and approved one by one. Each fact is one choice from a list the app registered in advance.

The app getsOnly the facts you tick, exactly as shown
The app never seesThe documents behind them, or anything you leave unticked
Inputprofile
Outputfacts
ReadsDocuments and notes the person shared.
One answerAt most 30 bits, one choice among about 1.1 billion
New answers per 30 days6
Total per 30 days60 bits
Same question, same answer24 hours
Fixed: max attributes8
Fixed: max options12
Version1.0.0
Contract hash6d7a428420e45d87

Never released

  • the documents the facts came from
  • anything the person did not approve
How it is computed

In the approval window an AI model (or rules, when no model is configured) suggests a value for each question. The person sees every suggestion and ticks what to share. Later calls release exactly the ticked facts. Nothing is computed again.

The cost adds up every question on the form, counting each option plus "not shared". The cost is charged for the whole form, whatever the person ticked.

Input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "profile"
  ],
  "properties": {
    "profile": {
      "type": "string",
      "pattern": "^[a-z0-9_-]{1,40}$"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "facts"
  ],
  "properties": {
    "facts": {
      "type": "object",
      "maxProperties": 8,
      "additionalProperties": {
        "type": "string",
        "pattern": "^[a-z0-9_-]{1,40}$"
      }
    }
  }
}