◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 22 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 22 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
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.

Rork613Supabase41Edge 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-10-27
Sending temperature to the Claude API Now Returns a 400 on the New Version. Finding Every Spot in Your App
Claude API version 2026-10-21 returns a 400 if you send temperature, top_p or top_k. When it hits you, a script to scan your app and SDK setup, and the order to fix things in.
◉ AI Models2026-10-25
Is Your Rork App Still Calling Sonnet 4.5? Finding Out Before November 30
Claude Sonnet 4.5 is scheduled to retire from the API on November 30, 2026. A small script to find leftover model IDs in your app, and the order to fix them in depending on where they live.
◉ AI Models2026-10-20
Before You Type "Connect Supabase": The Two Values to Copy, and the One You Must Not
Rork asks for just two things before you type Connect Supabase in chat: a Publishable key and your project link. Here is where to copy them from, how to avoid pasting the secret key that sits on the same screen, and a small script that checks the values locally first.