A Lovable agent implemented CipherStash end-to-end in a Lovable-hosted project and reported what it had to discover for itself. Most of it is documentation, and most of it applies to every managed AI app platform — Lovable, v0, Bolt, Replit — not just this one. The common shape: no shell the developer controls, an edge/Workers runtime, a database role that is not postgres, and database changes only through the platform's migration tool.
Its most costly discovery, in its own words:
I spent a full turn concluding CipherStash was impossible here before learning stash existed.
It knew @cipherstash/protect, inferred "native Rust addon, won't run on Workers" from the -ffi dependency name, and concluded the product was unusable — before finding @cipherstash/stack and the wasm-inline entry. That is a near-miss we should not rely on the next agent surviving.
What to add
A managed-platform section — either in skills/stash-supabase/SKILL.md or as a new skills/stash-lovable / skills/stash-managed-platforms — covering:
1. Edge runtime, up front and unmissable. Edge or Workers? Use @cipherstash/stack with the @cipherstash/stack/wasm-inline entry. @cipherstash/protect is the deprecated predecessor and its native FFI will not load there. This belongs high enough that an agent skimming the first screen cannot miss it — it is the difference between "CipherStash works here" and "CipherStash is impossible here".
2. Headless auth works. stash auth login --json --region <r> runs the device flow with the verification URL emitted as the first NDJSON event, no browser auto-open, and writes to ~/.cipherstash (packages/cli/src/cli/registry.ts:250-285). It works in an ephemeral sandbox. The reporter did not know this, and reached for a raw .sql release asset instead of the CLI on the assumption the CLI could not authenticate. Once it confirmed auth login --json worked, the CLI was the better path throughout.
3. Credentials. stash env --name <x> --write mints the four CS_* vars into a file (registry.ts:561-603); they go into the platform's backend secrets. The reporter: "that part worked flawlessly and is worth codifying." So this is a docs gap, not a product gap — worth recording, because we had it flagged internally as a suspected blocker and it is not one.
4. The database role is not postgres. State it, and route the install through the platform's migration tool via --print-sql (sibling issue) rather than a direct connection. Include what the CLI cannot do from inside these sandboxes and what to hand to the platform instead.
5. What is not available through PostgREST. eq/neq/in/gt/gte/lt/lte do work through the Data API — the adapter encrypts each filter value with the full storage path. Free-text matches() and encrypted-JSON containment/selector predicates do not, because they need eql_v3.query_* casts PostgREST cannot emit. Agents guess wrong in both directions on this; the existing note in skills/stash-supabase/SKILL.md is correct but too deep in the file to be found under time pressure.
6. Server-side client construction. encryptedSupabase needs a Postgres connection for introspection and so cannot be constructed in a Worker (#708). Say so where an agent building on one of these platforms will read it, and point at the supported shape.
Related
Per AGENTS.md, skills ship inside the stash tarball and get copied into customer repos, so this needs a stash patch changeset.
A Lovable agent implemented CipherStash end-to-end in a Lovable-hosted project and reported what it had to discover for itself. Most of it is documentation, and most of it applies to every managed AI app platform — Lovable, v0, Bolt, Replit — not just this one. The common shape: no shell the developer controls, an edge/Workers runtime, a database role that is not
postgres, and database changes only through the platform's migration tool.Its most costly discovery, in its own words:
It knew
@cipherstash/protect, inferred "native Rust addon, won't run on Workers" from the-ffidependency name, and concluded the product was unusable — before finding@cipherstash/stackand thewasm-inlineentry. That is a near-miss we should not rely on the next agent surviving.What to add
A managed-platform section — either in
skills/stash-supabase/SKILL.mdor as a newskills/stash-lovable/skills/stash-managed-platforms— covering:1. Edge runtime, up front and unmissable. Edge or Workers? Use
@cipherstash/stackwith the@cipherstash/stack/wasm-inlineentry.@cipherstash/protectis the deprecated predecessor and its native FFI will not load there. This belongs high enough that an agent skimming the first screen cannot miss it — it is the difference between "CipherStash works here" and "CipherStash is impossible here".2. Headless auth works.
stash auth login --json --region <r>runs the device flow with the verification URL emitted as the first NDJSON event, no browser auto-open, and writes to~/.cipherstash(packages/cli/src/cli/registry.ts:250-285). It works in an ephemeral sandbox. The reporter did not know this, and reached for a raw.sqlrelease asset instead of the CLI on the assumption the CLI could not authenticate. Once it confirmedauth login --jsonworked, the CLI was the better path throughout.3. Credentials.
stash env --name <x> --writemints the fourCS_*vars into a file (registry.ts:561-603); they go into the platform's backend secrets. The reporter: "that part worked flawlessly and is worth codifying." So this is a docs gap, not a product gap — worth recording, because we had it flagged internally as a suspected blocker and it is not one.4. The database role is not
postgres. State it, and route the install through the platform's migration tool via--print-sql(sibling issue) rather than a direct connection. Include what the CLI cannot do from inside these sandboxes and what to hand to the platform instead.5. What is not available through PostgREST.
eq/neq/in/gt/gte/lt/ltedo work through the Data API — the adapter encrypts each filter value with the full storage path. Free-textmatches()and encrypted-JSON containment/selector predicates do not, because they needeql_v3.query_*casts PostgREST cannot emit. Agents guess wrong in both directions on this; the existing note inskills/stash-supabase/SKILL.mdis correct but too deep in the file to be found under time pressure.6. Server-side client construction.
encryptedSupabaseneeds a Postgres connection for introspection and so cannot be constructed in a Worker (#708). Say so where an agent building on one of these platforms will read it, and point at the supported shape.Related
encryptedSupabaserequires a Postgres connection, so it cannot run in Workers or the browser. The product-side half of point 6.stash-supabaseskill lacks raw-pg / no-ORM guidance (only covers the encryptedSupabase JS wrapper) #601 —stash-supabaseskill lacks raw-pg / no-ORM guidance.--print-sql, owner-scoped grants, preflight, TLS.Per
AGENTS.md, skills ship inside thestashtarball and get copied into customer repos, so this needs astashpatch changeset.