Security,and what you still have to trust.

Who holds which key for your replica, what each check stops and what you still have to trust. Then the vault on Phala as it stands today, and how to report a flaw.

Who holds which key

None of your app keys are on the replica’s machine, and its memory key is there only while you have it unlocked.

Where each key sits today

  • The key to your memory: Made in your browser when you set up: 32 random bytes. It is kept only as the recovery key you write down and as a copy that your passkey alone can open; the machine holds that locked copy and cannot open it. While your memory is unlocked the key sits in the machine’s RAM, and it is wiped when you lock, when the time you chose runs out, or when the machine restarts
  • Your passkey: On your device. The machine keeps only its public half, asks a new question at each sign-in, and refuses an answer made for another site
  • Your recovery key: Yours to keep where you keep passwords. It opens the memory as your passkey does, so whoever has it can too
  • Your app keys: Never on the machine. Each outside call goes through the gateway, outside the machine, which adds the key on the way out. The code sends a call to no address but the gateway’s
  • The setup code: Written on the machine while it has no owner, so only someone who can open the machine itself can read it. The first person to give it becomes the owner. It works once and is then deleted, and ten wrong tries make a new one
  • Your sign-in: Good for twelve hours at most. Sessions live in the machine’s memory, so a restart signs you out and locks the memory
  • The model service: Receives what each answer needs: the words being answered and the facts picked for them

Making a new recovery key is in build. Everything is encrypted again and the old key opens nothing; it is tested on a laptop, not run live yet.

What each check stops

Plain code outside the model. Nothing the model reads can change it.

What you still trust

Locked, the disk alone gives nothing away. Some things still rest on trust.

Locked with your key

  • What it knows of you, and every draft that answers a mail, is encrypted with AES-256-GCM under your key
  • A wrong key opens nothing and changes nothing
  • A line someone changed or moved will not open
  • Your talks with it are not written down
  • When you forget a fact, the rest is written again under a new key

You still trust

  • Whoever runs the machine, while your memory is unlocked. The key is in the machine’s RAM then, so they could read it. You choose how long it stays open, a week at most
  • The model service, which receives what each answer needs
  • The gateway, which holds your app keys and adds them to each call
  • Google, which holds your mail whatever the replica does, and once Gmail is connected, the service that holds your Google sign-in for it
  • Anyone with the disk, who can delete the memory or put back an older copy of it, though not read it, change a line or move one
  • Drafts that do not answer a mail, such as a reply on GitHub, stay readable on the disk until you decide, so they can wait while the memory is locked
  • Receipts are not signed. A changed line shows, but whoever runs the machine could write all of them again
  • The model to propose well. Rules and limits contain its mistakes, they do not prevent them

The vault on Phala

It belongs to the Playdeck app, the earlier product. The replica does not use it. The home page shows it part by part.

The app keeps the key to its memory in a vault that runs in a confidential machine on Phala Cloud. The chip, Intel TDX, keeps the machine’s memory closed to the host it runs on, and the hardware signs which code is inside. The replica’s memory is locked another way: with your own key, made in your browser.

To save machine time the vault is off between demos until 8 December. While it is off, nothing sealed in it can be opened.

Sealed hardware moves trust. It does not remove it: someone with physical access to the machine can attack it, and the published code can have bugs.

  • The key to your memory

    Made on the app’s server, then locked with a key derived inside the machine, so only the vault can open it. The app’s server can ask the vault to open it when it is needed.

    Live
  • The replica’s own account key

    It never leaves the vault.

    Live
  • What runs inside

    Published code on dstack, over a base image pinned by its digest. The packages it installs at start are not pinned by hash yet.

    Live
  • App tokens

    Encrypted on the app’s server, with a key the server holds. The vault side of moving them in is written; the server asking it for each call is left.

    In build
  • Rules, with the signing key

    On the app’s server today. Sealed from us is the goal once they move in.

    In build
  • Notice before new code

    A check that decides which code may receive the keys, behind a timelock, so the code cannot be swapped without days of public notice.

    Designed

Report a flaw

Write to sahil@playdeck.co. Say what you found, how to reproduce it and what it puts at risk. Please give us the chance to fix it before you publish it.

What is public today: this website; the first replica’s public page and its demo; the replica’s code on GitHub; and the Playdeck app and its vault at their public addresses. A flaw in the design itself is just as welcome as a flaw in the code.

Read the codethat does all of this.

Read the code on GitHub