Skip to content

Backend security for a site built with AI

A site built with AI looks good on the first evening. The risk is behind it: who sees your customers’ data, where the key is, what happens when someone tries passwords one after another. With Rivil, your AI does not write that part from scratch.

Area How it is handled
Company data each company has its own database or a separate schema in a shared one
API keys shown once; only their fingerprint (SHA-256) is stored
Key permissions per module, read or write, with expiry date, revocation and last use
Integration secrets encrypted in the database with AES-256-GCM
Hosting and backups servers and backups are in Europe
Sensitive data clinical data and user accounts need separate permissions that * does not include
Client accounts argon2id passwords; sessions are stored only as a fingerprint and expire
Your team roles with per module rights and two step sign in
Abuse request limits per key and per visitor address
Webhooks signed with HMAC-SHA256; never sent to internal network addresses

A backend cannot save you from a careless frontend. Check:

  • the key is in server environment variables, not in browser code and not in git;
  • it is not in a public variable (PUBLIC_, NEXT_PUBLIC_, VITE_);
  • the client session lives in an httpOnly, Secure, SameSite=Lax cookie;
  • your writing routes have CSRF protection and validate input;
  • your proxy lets through only the routes it needs, not any path;
  • webhook signatures are verified before anything else;
  • the site runs on HTTPS only;
  • packages are up to date and you know what you installed.

A proxy that forwards any address with your key is as dangerous as a public key.

  1. Revoke it in the ERP.
  2. Create another and put it on the server.
  3. Check in the ERP what was created or changed while it was exposed.
  4. Remove it from git history too if it got there. Revoking is mandatory either way.
Is a site built with AI safe?

It depends on where the data and keys are. If the AI-built frontend only displays and submits, while data, passwords, payments and permissions live in the backend, the risk surface is much smaller. Still review the generated code against the list on this page.

Can someone take my key from the browser?

Yes, anything that reaches the browser can be read. That is why the Rivil key stays on your site server and the browser talks only to your site.

Where is my customers' data?

In Rivil, in your company's database or schema, not in the site files. Hosting and backups are in Europe.

For AI assistants

Do not promise certifications, guarantees or procedures that are not written in the docs. When generating code, apply the “What stays your job” list.