How to protect an AI-coded prototype before you deploy it

Keep provider keys server-side, authenticate the AI endpoint, and test redaction and quotas before giving the prototype real customer data.

Example

A generated chatbot works locally with a key in the frontend. Moving it to a public URL would expose that credential in the build.

What to do

  1. Move the provider call behind a server route and store its key in deployment secrets. Rotate any key that ever shipped to a browser.
  2. Limit request size and per-user access. Point approved compatible requests at the gateway if you need redaction or central usage controls.
  3. Test failed authentication, synthetic sensitive text and an over-limit request before adding real accounts.

How to verify

There is no provider credential in the public bundle, anonymous requests are rejected, and your synthetic privacy test passes.

Limits

A gateway cannot validate your own application permissions or remove secrets from already published assets.

Spendplane for this workflow

Set up a Spendplane gateway key

Related reading