FFORGE

Guide · 8 min read · Updated November 2026

Roblox RemoteEvent security with AI: the checks every handler needs

Every exploiter can fire any RemoteEvent with any arguments, read every LocalScript and change any client-side value. That is not a worst case; it is the baseline, because the client is their computer. Good remote security is boring: a handful of checks on every server handler, applied without exception. This guide lists them, shows the prompt that gets an AI agent to apply them across your whole place, and explains how to read the result.

Layout first

The checks, on every server handler

remote.OnServerEvent:Connect(function(player: Player, itemId: unknown)
	if typeof(itemId) ~= "string" then return end
	local item = Items[itemId]; if not item then return end            -- whitelist; never trust prices from the client
	if not RateLimit.Allow(player, "BuyItem", 5) then return end          -- 5 per second per player
	local data = PlayerData.Get(player); if not data then return end
	if data.Coins < item.Price then Notify(player, "Not enough coins"); return end
	Economy.AddCoins(player, -item.Price, "buy:" .. itemId)
	data.Unlocks[itemId] = true
	remote:FireClient(player, "ok", itemId)
end)
  1. Types. typeof on every argument. For numbers: type(n) == "number", n == n (rejects NaN), n == math.floor(n) where an integer is expected, then clamp the range.
  2. Whitelists. Item ids, upgrade ids, map names and ability names are looked up in server config. The price, damage or reward is read from that config, never from the argument.
  3. Distance. Anything positional (a pickup, a buy prompt, a hit) checks the distance from the player's character, and line of sight if it matters.
  4. Rate limits. One small module with a table of timestamps per player per remote. Extras are dropped, not punished.
  5. The sender is the first parameter. A player id in the arguments is ignored.
  6. Silent drops. Invalid input gets no reply. Kick only for the impossible, never for lag.
  7. Data readiness. Handlers call PlayerData.Get or WaitFor and return if the data is not loaded, so a remote fired during join cannot act on an empty table.

Where secrets live

Everything in ReplicatedStorage and every LocalScript is readable by an exploiter. Drop tables, egg odds used for the roll, admin lists, redeem codes and product grant logic belong in ServerStorage or ServerScriptService. Shared config in ReplicatedStorage should hold what the UI needs to display (names, prices, icons) and nothing that would help someone cheat. Also remove any require(assetId) loaders and loadstring from free models; those are backdoors.

Weapons, movement and income

The common bugs

The security-pass prompt

Review every RemoteEvent and RemoteFunction handler on the server in my place. For each:
validate argument types (reject NaN and non-integers where integers are expected), whitelist
ids against the config tables, clamp ranges, check distance from the player's character for
anything positional, add a per-player rate limit through one RateLimit module, never trust a
price, amount or player id from the client, and drop invalid input silently. Replace any
RemoteFunction InvokeClient. Fix what you find and summarise each change with the script
path and line.

This is the anti-exploit prompt; the movement and income checks are the speed and income sanity prompt. Forge applies its remotes playbook, playtests, and returns a list of changes by path and line. The same instructions work with Claude Code or Cursor on Studio's MCP server; you run the playtest.

Reading the result

  1. Every OnServerEvent and OnServerInvoke in the summary has a type check as its first lines.
  2. No handler reads a price, amount or reward from its arguments.
  3. InvokeClient appears nowhere in the place.
  4. The RateLimit module exists once and is required by every handler.
  5. Legitimate play still works: buy, click, hit, teleport, in a playtest.

What it costs

A security pass is a system-sized job, 100 to 500 credits ($1 to $5) on Sonnet 5.5 depending on how many handlers the place has. Ranges and packs are on the pricing page.

Questions

What is the single most important rule?

The first parameter of OnServerEvent is always the real sender. Never trust a player, a price, an amount or a target passed as an argument. The server decides; the client requests.

Should invalid input kick or ban?

Neither, by default. Drop it silently; an error reply is information for the exploiter. Kick only for input that is impossible rather than merely wrong, and never auto-ban on movement checks, because lag looks like speed.

Why is RemoteFunction:InvokeClient banned?

The server waits for the client to answer, and a client can simply never answer, hanging that server thread forever. Use FireClient for one-way messages and OnServerInvoke for the client asking the server.

Does a security pass break legitimate play?

It can, if a range or rate is set too tight. Forge playtests after the pass and lists every change by script and line; if a check is too strict, name it and it loosens that one.

Related guides

Let Forge run the pass on your place. Pair your Studio, press Build on the prompt, read the change list. Trial credits, no card. Build it in Forge →