API keys in AI-built apps are the credentials for other services that an app keeps outside the code an AI writes for it. In Insulin Apps they go in the app’s Secrets, which only the app’s Owner or an Admin can set, and one line in Fours’ documentation decides who can read them: “sharing Editor access to an app shares its credentials.”
“If an AI builds our app and it needs an API key, where does the key go, and who can read it?” An IT or security lead approving Insulin Apps tends to ask both halves at once, and an app’s Owner answers the second half every time they share the app. The first half has a short answer: in the app’s Secrets, never in the builder’s chat or the code. The second half is where reviews get surprised, because the people who can set a key and the people who can read it aren’t the same list.
This post stays in the builder, where an app is built, previewed and saved. It covers the rule that decides who can read a key, where a key should go, what an organization-wide share does to it, what to do when a key lands in the code, and a five-step checklist.
Who can read the API keys in an AI-built app?
Anyone who previews the app as an organization ADMIN or EDITOR while holding Editor or higher on it. Fours’ Custom Apps documentation states the rule in two sentences: the app’s secrets “are injected into the preview as environment variables when the person previewing it is an organization ADMIN or EDITOR with Editor or higher on the app. Preview code and browser DevTools can read them, so sharing Editor access to an app shares its credentials.”
Two kinds of role meet in that rule. An organization role is the role a person holds across the workspace, such as ADMIN, EDITOR or VIEWER. An app role is the role they hold on one app: Owner, Admin, Editor, User or Viewer. “Editor or higher” means Editor, Admin or the Owner.
The reason is where the preview runs. The builder “mounts the app’s npm project in the browser” and starts it there, so a value the preview receives sits in the previewing person’s browser, where DevTools can read it. Setting a key takes a narrower role than reading one:
| An app’s key | Who | How |
|---|---|---|
| Set or replace it | The app’s Owner, or an Admin on the app | Typed into a form in Settings → Secrets |
| Remove it | The app’s Owner, or an Admin on the app | In Settings → Secrets |
| Use it and read its value in the preview | An organization ADMIN or EDITOR with Editor or higher on the app | Injected as environment variables, which preview code and browser DevTools can read |
| Ask for a change | The builder’s assistant | It asks and never makes the change; an Owner or Admin types the value in Settings → Secrets |
| Keep it | The app’s Secrets, outside its code | Encrypted per organization: KMS · AES-256-GCM |
The narrow list controls the wide one. In the documentation’s roles table, only the Owner and Admins can manage sharing, so the people who set a key are also the people who decide who holds Editor, and with it who can read the key. Three cases follow from the rule:
- An org admin title alone doesn’t reach the keys. An organization ADMIN with no role on the app doesn’t hold Editor on it. Insulin Apps puts it plainly: “An org admin title on its own grants nothing.”
- Users and Viewers on the app don’t meet the rule. Both roles sit below Editor.
- A personal app’s keys stay with its creator. A personal app is “private to the creator,” and only organization apps can be shared.
Reading follows from using, in any system. AWS’s guide to moving hardcoded secrets splits the work between a role that manages a secret and “a role that can use the secret at runtime,” and grants that second role “the permission to retrieve one secret value.” What’s particular to the builder is where that runtime is: a person’s browser.
Where should an API key go in an AI-built app?
In the app’s Secrets, entered by the app’s Owner or an Admin: never in the builder’s chat, and never in the code. An app secret is a named value kept in the app’s Settings, which holds “everything about the app that is not its code,” and handed to the preview as an environment variable. The code refers to the key by that name, and the value stays out of the source.
The builder works that way. “The builder’s assistant can ask for a secret change, but it cannot make one.” If you’re the app’s Owner or an Admin on it, the request opens Settings at Secrets with the add form ready for the secret it named, and “you enter the value yourself”; nothing changes until you save the form. An Editor building the app needs the Owner or an Admin to add the key. With publishing, an app can call outside services with keys kept in Secrets.
Not in the chat. Fours’ documentation is direct about the chat: “every message you send goes to the builder as a request it can act on.” A key pasted into a message becomes part of a request to the model building the app, which may act on it by writing the value into a file. Your builder conversation is your own, and “nobody else sees what you asked,” but that only keeps the message from teammates: the value has still gone into a request instead of the Settings form built to hold it.
Not in the code. AWS’s case for moving a key out of code is that doing so “solves the problem of the secret being visible to anyone who sees the code.” In the builder, code is seen widely and kept long: the working draft “is shared by everyone editing the app,” every save that changes the code becomes a version, and the Code surface can download the complete npm project, which takes a copy outside the app’s roles.
What Secrets changes, and what it doesn’t. Moving a key into Secrets doesn’t hide it from the app’s editors, since the preview hands it to them. It changes everything around them. The value isn’t part of the code, so the versions History keeps don’t hold it; only the Owner or an Admin can change it; and Insulin Apps lists its secrets as “Encrypted per organization,” with KMS · AES-256-GCM.
Which keys this covers. These are the app’s own keys. The keys the builder’s AI model runs on are a separate matter: an organization app’s model picker lists Your key rows built from the organization’s own connected provider keys, and “a personal app never reads your organization’s keys.” Agents keep their credentials somewhere else again, and who can read your AI agent’s system prompt covers where an agent’s belong.
What does an organization-wide share do to an app’s keys?
If the organization-wide role is Editor, it gives the keys to every organization ADMIN and EDITOR in the workspace. Sharing with the entire organization sets “a default role for every member,” and org-wide sharing offers Editor, User or Viewer. A member’s effective access is the higher of that default and any individual share, so an org-wide Editor default gives every member at least Editor, and each one who is an organization ADMIN or EDITOR meets the preview rule.
The documentation’s own pattern avoids that: “you can share an app org-wide as Viewer and grant Editor or Admin to the few people who maintain it.” It’s the default-plus-exception pattern for workspace roles: a low default for everyone, and named grants for the few who need more. For an app that holds a key, two named lists matter:
- Editors whose organization role is ADMIN or EDITOR can read every key the app holds, in the preview.
- Admins can also add and remove keys, and manage sharing. Only an organization ADMIN can grant Admin on an app; for anyone else, “the role picker leaves it out, and the server refuses the grant.”
An ownership transfer adds to the second list. The new Owner has to be an organization ADMIN, and the previous owner keeps Admin: “You keep Admin on the app, so you can still edit it, manage its sharing, and delete it.” Check the share list after a transfer.
What if a key was pasted into the code or the chat?
Rotate it: revoke the key at the service that issued it, issue a new one, and put the new value in Secrets. AWS’s guidance for plaintext secrets in code is “we recommend that you rotate them,” because “rotating the secret revokes the current hardcoded secret so that it is no longer valid.” Deleting the line from the code isn’t enough, for reasons in the builder’s History:
- The key stays in a saved version. “Every save that changes the app’s code is snapshotted,” and “the newest 50 versions per app are kept.” Deleting the line and saving creates a new version without the key; the one before it still holds it.
- A restore brings that code back. “Restore rolls forward; it never deletes”: restoring makes a new version from the snapshot’s source, key included, and removes nothing in between.
- Copies don’t follow your fix. A downloaded project, or a value someone copied from the shared draft, keeps the old key whatever you change in the app.
A key pasted into the chat needs the same treatment. Sending /clear “deletes your builder conversation for this app and opens a fresh one,” but the message already went to the builder as a request, and only revoking the key makes the old value invalid.
Two more occasions call for rotation. When someone who held Editor loses it, they can’t read the key in the preview again, but they keep anything they copied. And Microsoft’s guidance for Key Vault secrets recommends rotating on a schedule, noting that “shorter rotation intervals (for example, 60-90 days) reduce exposure risk from compromised secrets.” Replacing a value in Settings → Secrets is a job for the Owner or an Admin, and it doesn’t touch the code.
What should you check before an app gets an API key?
Five things, in order: who holds Editor, whether they should, what the key can do, where it goes, and whether an old copy is still out there.
- Check who holds Editor before you add a key. Open the app’s sharing dialog, which its Owner and Admins manage, and read the organization-wide role as well as the named shares. Microsoft’s advice for any secret applies: “Periodically audit who has access to secrets and remove unnecessary permissions.”
- Give Editor only to people you would trust with the key. Share org-wide as Viewer or User, and grant Editor by name. Insulin Apps’ own answer to “Where do API keys go?” ends the same way: “give Editor to the people you would trust with it.”
- Use a key that can do only what the app needs. Whoever can read a key can use it outside the app, so the key’s own permissions at the issuing service are the last limit on it. Where the service offers a narrower key, use that one.
- Put the key in Secrets, never in the chat or the code. Let the builder ask for it by name, and have the Owner or an Admin type the value into Settings → Secrets.
- Rotate any key that was pasted into the code or the chat. Revoke it at the source, issue a new one and replace the value in Secrets, and do the same when an Editor who could read it leaves the app.
Frequently asked questions
Can Editors read an app’s API keys in Insulin Apps?
Yes, in the builder’s preview. An organization ADMIN or EDITOR with Editor or higher on the app gets its secrets as environment variables, and preview code and browser DevTools can read them. As Fours’ documentation puts it, sharing Editor access to an app shares its credentials.
Who can add, replace or remove an app’s API key?
Only the app’s Owner or an Admin on it, in Settings → Secrets, where Insulin Apps keeps secrets encrypted per organization with KMS and AES-256-GCM. Editors can use a key and read it in the preview, but they can’t set or remove one.
Can the AI builder add an API key for me?
No. The builder’s assistant can ask for a secret change, but it can’t make one. If you’re the app’s Owner or an Admin, its request opens Settings at Secrets with the form ready, and you type the value yourself. Nothing changes until you save.
Does sharing an app with the whole organization share its keys?
It does if the organization-wide role is Editor. Every member then holds at least Editor, and each organization ADMIN or EDITOR among them can read the keys in the preview. Share org-wide as Viewer or User, and grant Editor by name.
Is deleting a pasted API key from the code enough?
No. History keeps the newest 50 saved versions, and the one before your fix still holds the key; restoring it brings that code back. Revoke the key at the service that issued it, issue a new one, and put the new value in Secrets.
Are app secrets the same as the AI model keys the builder uses?
No. The model picker’s Your key rows come from AI provider keys connected for your organization or for you, and a personal app never reads your organization’s keys. App secrets belong to the app, and only its Owner or an Admin sets them.
Takeaways
- Setting a key takes the Owner or an Admin; reading one takes Editor. In the builder’s preview, an organization ADMIN or EDITOR with Editor or higher on the app can read its keys through preview code and DevTools.
- Keys go in Settings → Secrets, encrypted per organization and entered by the Owner or an Admin. The builder’s assistant can ask for a key but never sets one.
- An org-wide Editor share gives the keys to every organization ADMIN and EDITOR. Share org-wide as Viewer or User, and name your Editors.
- A key pasted into the code outlives the delete. History keeps the newest 50 versions and a restore brings the code back, so rotate the key at its source.
- A key’s own permissions are the last limit. Whoever can read it can use it anywhere, so choose one that can do only what the app needs.
To see roles, encrypted secrets and version history side by side, start with Insulin Apps, the AI app builder for business apps.
Sources
Primary sources for the platform rules cited above. Last verified October 19, 2026. Providers change their products, prices and terms without notice — check the source before relying on a detail.
- Insulin Custom Apps — Fours Doc — The Live Preview: an app's secrets injected into the preview as environment variables when the person previewing it is an organization ADMIN or EDITOR with Editor or higher on the app, preview code and browser DevTools able to read them, so that sharing Editor access shares the app's credentials, and the app's npm project mounted in the browser; Studio surfaces: Settings holding everything about the app that is not its code, Secrets among its sections, and the Code surface downloading the complete npm project; only the app's Owner or an Admin on it adding or removing a secret; the builder's assistant able to ask for a secret change but not make one, its request opening Settings at Secrets for an Owner or Admin, who enters the value; every message a request the builder can act on; a private builder conversation per person, deleted by /clear; the working draft shared by everyone editing the app; every save that changes the code snapshotted, the newest 50 versions kept, and restore rolling forward and never deleting; Ownership and Sharing: personal apps private to the creator, only organization apps shareable, org-wide sharing as Editor, User or Viewer, Admin granted only by an organization ADMIN, the higher of two roles applying, and only the Owner and Admins managing sharing; the previous owner keeping Admin after a transfer to an organization ADMIN; the model picker's Your key rows and a personal app never reading the organization's keys
- AWS Secrets Manager: Move hardcoded secrets to AWS Secrets Manager — Plaintext secrets in code: the recommendation to rotate them and store them in Secrets Manager, moving them solving the problem of a secret visible to anyone who sees the code, and rotation revoking the hardcoded secret so that it is no longer valid; one role that manages a secret and another that can use it at runtime, granted only the permission to retrieve one secret value
- Microsoft Learn: Secure your Azure Key Vault secrets — API keys among the application credentials to store as secrets; regular rotation, with shorter intervals (for example, 60-90 days) reducing exposure risk from compromised secrets; periodically auditing who has access to secrets and removing unnecessary permissions. Page last updated July 10, 2026
Keep reading
Stay Updated
New posts, product updates and marketplace strategy are shared on LinkedIn as they publish.
Follow Fours on LinkedIn