← all notes

Your Cell is public. Now that's a choice.

Cells now support gates: an access policy in front of a Cell's public URL, enforced at the edge, before your code runs. You declare who may enter. The platform handles the sign-in page, the emailed codes, the sessions, the revocation. Your Cell doesn't change at all.

[gate]
audience = "emails"
allow    = ["sam@example.com"]

Deploy that, and the URL stops being public. Anyone else gets a sign-in page. Sam gets a six-digit code by email, types it once, and is in for thirty days. Your code never sees any of it.

Every Cell is born public. That's right for a homepage and wrong for most other things you actually make: the admin panel, the dashboard for one client, the prototype you want three people to look at, the internal tool that's internal because it can drop tables.

The usual fix is to build auth into the app. A login route, a session cookie, somewhere to keep a password, a reset flow once someone forgets it. For a forty-line Cell, the auth outweighs the Cell. So it doesn't get built, and the URL stays public, "temporarily", guarded by being hard to guess.

A gate moves that entire problem out of your code and into a config block that deploys with it.

audiencewho may enter
linkholders of a capability link you mint
privateyou, signed in with your Tissue account
accountany member of the Cell's account
emailsthe addresses you list, verified by one-time code
domainanyone with an email under your domains
publiceveryone; a gate standing open

Two knobs apply everywhere: allow admits extra addresses alongside the main audience, and links = false turns capability links off when the list should be the only way in. Session lifetime is [gate.session] ttl, one hour to ninety days.

The policy is validated before anything is written. A typo in the gate block fails the deploy; it does not deploy the Cell open. And the ribo.toml block is authoritative: deploy with it and the stored policy is replaced, deploy without it and a previously deployed gate comes off. Policies set through the API instead are marked as such, and deploys leave them alone.

Sometimes there is no list of emails, there's just "I want Priya to see this until Friday." That's a capability link:

$ ribo gate link paper-review --ttl 12h --read-only

  token:  tal_ab12cd34ef56.…
  url:    https://paper-review.strand-9c.tissue.dev/?k=tal_ab12cd34ef56.…

  This is the only time the token is shown.

Opening the URL exchanges the token for a session and the ?k= disappears from the address bar. Links can be time-boxed, restricted to a path prefix, or made GET-only. The token itself is stored hashed; if you lose it, you revoke it and mint another. API clients skip the browser entirely and send it as a Bearer token.

$ ribo gate sessions paper-review
$ ribo gate sessions paper-review --revoke 9f3a1b2c
$ ribo gate sessions paper-review --revoke-all

--revoke-all is immediate and enforced by the platform, not by asking browsers nicely: the edge rejects any session issued before the revocation. That holds even for a cookie copied off a laptop you no longer control.

Verification happens at the edge by checking a signature against a public key, so a gated request costs no database lookup. You will not find the gate in your response times.

export default {
  async fetch(request) {
    const email = request.headers.get("x-tissue-gate-email");
    // "sam@example.com", verified, or null on an ungated Cell
  },
};

One header. The guarantee that makes it usable: the platform strips inbound x-tissue-gate-* headers from every request to every Cell, gated or not, before the gate injects its own. Nobody outside can put that header on a request to you. So reading it without verifying anything is correct, not lazy. There is no token to parse in your code, no key set to fetch, no auth library to vendor and keep patched.

Enter an email the policy doesn't allow, and you get the same "check your email" page as anyone else, with one difference you can't observe: nothing is sent and nothing is stored. The form points at a decoy. An outsider can't type addresses into the sign-in page to learn who's on the list.

Codes are hashed at rest, expire in fifteen minutes, and burn on use. The burn is a conditional write in the store, not a read followed by a write, so redeeming the same code through two different edges at the same moment still succeeds exactly once.

And one we got wrong first: the initial release gated everyone, including us. Pulse fires your schedules by calling the Cell, and a gated Cell asked our own scheduler to sign in. The scheduler does not have an email address. Schedules on gated Cells silently stopped, we caught it writing this documentation, and the fix shipped the same day with a regression test bolted over the hole. Platform invocations now pass; the public URL is exactly as closed as before.

curl -L https://tissue.systems/download/latest/ribo-macos-arm64 -o ribo
chmod +x ribo && sudo mv ribo /usr/local/bin/ribo

The simplest possible gate is two lines, [gate] and audience = "link": deploy, mint a link, hand it to someone. Everything above is also in the REST API under /v1/cells/…/gate and in the MCP server as gate_* tools, so an agent that deploys a Cell can lock it in the same breath. The full guide, including how gates interact with custom domains, lives at docs.tissue.systems/docs/cells/gate.