{"slug": "cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset", "title": "Cloudinary in an AI-built app: the API secret and the open upload preset", "summary": "A developer working on ProofForge described how AI-generated apps commonly leak Cloudinary API secrets into browser bundles by confusing the server-only API key and secret with the browser-safe cloud name and unsigned upload preset. The writeup recommends searching built JavaScript for the secret, avoiding public-prefixed environment variables, tightening upload presets with format, size and folder limits, signing uploads server-side, and rotating any leaked key. ProofForge's free scan checks public assets for exposed keys and tokens but cannot inspect preset configuration, so the developer notes that check must be done manually in the dashboard.", "body_md": "Profile photos, product images and file attachments are easy to add to an AI-built app. Cloudinary is a common pick, and the code the AI writes often mixes two very different kinds of credential. Mixing them up is how a stranger ends up with write access to your media library.\n\n## \n  \n  \n  Two things Cloudinary gives you\n\n- \n**Cloud name and unsigned upload preset.** These are meant for the browser. A preset is a saved set of rules for uploads: folder, allowed formats, size limits.\n- \n**API key and API secret.** The secret signs requests. It can upload, overwrite and delete anything in the account. It belongs on a server only.\n\nThe usual slip: the AI wants uploads to \"just work\", so it puts the API secret in a front-end file or in a variable that the build tool exposes to the browser. Anyone who opens the site can read it.\n\nA second, quieter problem is an unsigned preset with no limits. If the preset allows any file type, any size and any folder, a visitor can use your account as free storage, or overwrite assets with the same name.\n\n## \n  \n  \n  What to check\n\n1. \n**Search your built JavaScript for the API secret.** Open the live site, look through the bundle files, and search for the cloud name. See what sits next to it. Anything that looks like a secret should not be there.\n2. \n**Check your env variable names.** Variables with a public prefix in your framework are shipped to the browser. The secret must not use one.\n3. \n**Tighten the upload preset.** Set allowed formats, a maximum file size and a fixed folder. Turn off overwriting.\n4. \n**Sign uploads on the server where you can.** The browser asks your backend for a signature, then uploads. The secret never leaves the server.\n5. \n**Rotate after a leak.** Deleting the key from the code does not help once it was served. Regenerate the secret in the dashboard and update the server.\n6. \n**Review what is public.** Uploaded images are served from public URLs by default. If a file is private, use an authenticated or private delivery type.\n\n## \n  \n  \n  What an outside scan can tell you\n\nI work on ProofForge. The free scan checks the public side of a URL you own or have permission to test: browser bundle, public files, headers and supported backend signals. It never signs in. It looks for private keys and tokens sitting in your JavaScript. It cannot see how your Cloudinary preset is configured, so that check is yours to do in the dashboard. A clean result means nothing was found in the public assets checked, not that the app is secure.", "url": "https://wpnews.pro/news/cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset", "canonical_source": "https://dev.to/proofforge_live/cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset-3m6o", "published_at": "2026-12-04 20:52:55+00:00", "updated_at": "2026-12-04 21:14:34.836595+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Cloudinary", "ProofForge"], "also_reported_by": [], "takeaway": "AI-generated apps often ship the Cloudinary API secret to the browser via public-prefixed env variables; keep the secret server-side, sign uploads on the backend, and lock down the unsigned preset with format, size and folder limits plus overwrite disabled.", "recommendation": {"advice": "Search your built JavaScript for the Cloudinary API secret and rotate it if found, then move signing to the server and restrict the unsigned preset's formats, size and folder with overwriting off.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset", "markdown": "https://wpnews.pro/news/cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset.md", "text": "https://wpnews.pro/news/cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset.txt", "jsonld": "https://wpnews.pro/news/cloudinary-in-an-ai-built-app-the-api-secret-and-the-open-upload-preset.jsonld"}}