◉RORK LABJP
●EXPO — EAS Observe now records native crashes (Oct 7). On SDK 57, check for 57.0.21 or later●RORK — GPT-6.1 Sol (09-29) and Claude Sonnet 5.5 (09-28) are in the model menu●SDK 58 — Still in beta (since Sep 15). What to check on an SDK 57 app before the stable release●Q&A — Jest never finishes on a 2-core CPU. A write-up traces the cause in CI●WIDGET — A write-up traces why an iOS widget goes black only in production builds●NEW — Moving an iOS app from a personal account to an organization: five things to clear before App Transfer●EXPO — EAS Observe now records native crashes (Oct 7). On SDK 57, check for 57.0.21 or later●RORK — GPT-6.1 Sol (09-29) and Claude Sonnet 5.5 (09-28) are in the model menu●SDK 58 — Still in beta (since Sep 15). What to check on an SDK 57 app before the stable release●Q&A — Jest never finishes on a 2-core CPU. A write-up traces the cause in CI●WIDGET — A write-up traces why an iOS widget goes black only in production builds●NEW — Moving an iOS app from a personal account to an organization: five things to clear before App Transfer
Articles/AI Models
◉ AI Models/2026-10-14Advanced

Take the Prompt Out of the App: An Edge Function Gateway With the Guard on the Output Side

A system prompt shipped inside your app is readable from the day it ships. This walkthrough moves the prompt into a Supabase Edge Function, lets the client name only a task, and puts the guard on an output allowlist, with tested code.

Rork581Supabase36Edge Functionprompt designAI security

✦ Premium Article

"What instructions is this app giving its AI?" Anyone can ask that of a shipped app, because strings inside a JavaScript bundle are readable if someone decides to read them.

When you add an AI feature to an app built with Rork, the system prompt tends to land next to the screen code. You can tweak it while the app runs, and that is the fastest loop on your own machine. The catch is that this placement turns the prompt into a public document the day you ship.

I wrote about where to put API keys earlier (Is that API key inside your app?). This is the follow-up, and it is about the instructions themselves, not the key.

What stays inside the app

Compiling to Hermes bytecode keeps string literals intact. Obfuscation makes them harder to read, not unreadable. Assume everything below sits on every user's device once it is in the app.

Placed in the appWhat a reader learnsCost of changing it
System promptYour phrasing, including its weak spotsRebuild and store review for every edit
Allowed labels and thresholdsWhat input is likely to passSame
Model name, max_tokensA back-of-envelope cost estimateSame
API keyThe bill lands on you (the other article)Cannot be revoked until old builds age out

The right-hand column weighs most for me. As an indie developer I have rewritten classification instructions for wallpaper images many times, and I now treat a prompt as a document I keep editing, not a finished artifact. Lock it inside the app and one small rewording becomes a store-review wait.

Three promises I settled on first

  1. The client may say only a task name and an input. No prompt text, no model name
  2. Input is checked for type and length only. No hunting for "bad words"
  3. The guard lives on the output. Whatever the model returns, only values on an allowlist reach the screen

The second one made me nervous at first. Skipping input inspection felt reckless. I ended up not relying on it because some inputs cannot be filtered at all; the test section below shows why.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You can now find, before you ship, where instructions and decision rules are buried inside your app
✦You'll be able to copy a gateway where the client sends only a task name and an input, and have it running
✦You can change a prompt's wording on the server without waiting for store review each time
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◉ AI Models2026-09-13
Is That API Key Sitting Inside Your App? Rork Environment Variables vs. Supabase Edge Functions
Rork gives you two places to put an API key: its own environment variables, or a secret inside a Supabase Edge Function. Here is how I decide between them based on what I can revoke and who gets the bill, plus three checks to run after the key is in place.
◉ AI Models2026-04-30
Building an AI-Powered Photo Organizer App with Rork — A Complete Implementation Guide Using Vision, CLIP, and pgvector
A complete implementation guide for building an AI-powered photo organizer app with Rork. Extract faces, objects, and text with the Vision framework, generate semantic embeddings with CLIP, and run similarity search at scale using Supabase pgvector — designed as a production pipeline from day one.
◉ AI Models2026-10-05
Sonnet 5.5, GPT-6.1 Sol, or Opus 5.5? I Decide by the Kind of Fix Before I Pick the Model. A Week of Logging Where My Rork Credits Went
After Rork's model menu settled into Sonnet 5.5, GPT-6.1 Sol, and Opus 5.5, I sorted my fixes into three kinds and assigned a model and effort level to each. Here is how I read the changelog, the tiny ledger that tracks where each credit goes, and the rule I drew from a week of entries.