What it finds on a demo project

The audit looks for a rate limit, a concurrency cap, a spending guard, a timeout and an output cap around each model call. It also flags routes that let the caller choose the model or its settings, and model calls made from browser code.

SiteCMD CLI 2.0.0
Demo project: AI chat endpoint
npx sitecmd audit .
SiteCMD Code Scan - .
Checked: November 9, 2026
Framework: Express
Issues: 8 total | critical 0 | high 1 | medium 7 | low 0

High (1)
- [AI Safety · ai-safety] Direct AI provider call appears in client-side code - web/Chat.jsx:1

Medium (7)
- [AI Safety · ai-safety] No recognized AI output cap was found in this route - src/chat.js:2
- [AI Safety · ai-safety] No recognized application rate limit for AI route - src/chat.js:2
- [AI Safety · ai-safety] No recognized concurrency control for AI route - src/chat.js:2
- [AI Safety · ai-safety] No recognized spend guard or usage accounting for AI route - src/chat.js:2
- [AI Safety · ai-safety] No recognized timeout or cancellation for AI route - src/chat.js:2
- [AI Safety · ai-safety] Request-derived AI generation setting lacks recognized local bounds - src/chat.js:20
- [AI Safety · ai-safety] Request-derived model selector lacks a recognized local allowlist - src/chat.js:19

Your code passes? Now watch your site.

Join the waitlist

Put AI SDK rate limiting before model work starts

Limit the user or tenant starting the work, and account for overlapping calls across the app. A request-rate limit and a cap on simultaneous requests address different ways to use up capacity.

Limit the model choices and output your AI API accepts

Keep the list of approved models and the limits on answer size under server control.

Keep your OpenAI or Gemini API key out of browser code

Keep your provider key on the server and send model calls through your own backend. Google's Gemini key guidance warns that keys compiled into client-side code can be extracted by users.

Set AI API spending limits and timeouts together

Use the provider's spending limit if it has one, or billing alerts if it doesn't. Also limit how long an expensive request can run. OWASP's resource consumption guidance recommends both cost controls and execution limits.

Frequently asked questions

How do I rate limit OpenAI API calls from my app?

Enforce each caller's allowance on your server before starting the model call. OpenAI's own limits count tokens as well as requests, so cap how much text each call can send and receive, not only how often it runs.

How do I set a spending limit on the OpenAI API?

Set a spend limit on your OpenAI organization or project. OpenAI offers a spend alert that notifies you while requests keep working, and a hard spend limit that makes affected requests return a 429 error once reached.

  • Website security

    Catch leaked API keys and exposed files before someone uses them against you.

  • API rate limiting

    Put limits on sign-in, password reset, forms and other public endpoints.

  • Secrets in your code

    Find possible credentials in source and configuration before sharing the project.

Confirm you're a person