> For the complete documentation index, see [llms.txt](https://cde-inc.gitbook.io/cde-cad-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cde-inc.gitbook.io/cde-cad-documentation/fivem-developer-integration/security-best-practices.md). Agents can also search and read this documentation through its [MCP server](https://cde-inc.gitbook.io/cde-cad-documentation/~gitbook/mcp).

# Security Best Practices

{% hint style="danger" %}
Treat your API key like a database password.

* **Server-side only.** Never reference `Config.ApiKey` from a client script. All `PerformHttpRequest` calls to CDE CAD must be made from your resource's server-side files.
* **Validate before forwarding.** When a player triggers a server event (911, panic, deposit), validate inputs on your server before passing them to the CAD API. Never trust client-supplied numbers, plate strings, or SSNs verbatim.
* **Bound your retries.** The provided `SafeRequest` caps retries at 3 attempts. Do not write infinite retry loops; they will hit the rate limiter and may get your key flagged.
* **Rotate on suspicion.** If you see unfamiliar entries in the API key activity log, regenerate your key immediately.
* **HTTPS only.** Always use `https://` in `Config.CadUrl`. Plain HTTP exposes your key to anyone on the network path.
* **Keep keys out of git.** Add `config.lua` to your `.gitignore`, or split the key into a separate `secrets.lua` that you exclude from version control.
  {% endhint %}

***

{% hint style="info" %}
**Need More Help?**

If you are still experiencing issues after following this guide, join our [Discord server](https://discord.cdecad.com) and open a support ticket with:

* The endpoint you are calling
* The full HTTP status code and response body
* Your server's FiveM build version
* Any relevant Lua error output from the server console

**Never paste your API key into a support ticket.** Support staff will never ask for it.
{% endhint %}
