Exploiters in production: detect, log, ban, appeal

Handle exploiters in a live Roblox game the way studios do, with server heuristics, suspicion scores, a consequence ladder, analytics logging, Players:BanAsync with alt-account handling, an appeal process and an Open Cloud admin tool, all built on Beacon Yard.

Concept lesson, about 75 minutes, 12 steps

By the end you can

  • Turn the server checks Beacon Yard already has into weighted strikes and a suspicion score that decays over time
  • Choose a consequence from the ladder (log, mitigate, restrict, kick, ban) and explain why one signal is never proof
  • Build a Players:BanAsync request with escalating durations, alt-account handling and a DisplayReason that follows Roblox's messaging rules
  • Run an appeal and lift a ban from outside the game with the Open Cloud user restrictions API

Before this: LiveOps: updates, events, feature flags, migrations, Security: never trust the client, Analytics: funnels, economy events, retention, Ecosystem tools: Lune, darklua, roblox-ts

Step 1 of 12

A 4,000-coin match

The lobby leaderboard at m14-ship lists the best coin haul from a single match. MatchService records the difference between a player's coins before and after the round, and LeaderboardService.record keeps the best one. One morning the top row reads 4,000 coins.

Before you reach for a ban button, work out what a perfect player could earn. That is the rate of gain check from Roblox's guide to server-side detection: compare what a player got with the most the rules allow1. A round lasts 40 seconds (ROUND_SECONDS). The yard has 6 coin pads, each coin is worth 5 (COIN_VALUE), and a coin respawns 4 seconds after someone takes it (COIN_RESPAWN_SECONDS).

Work it out

Assume one player takes every coin the instant it appears, from second 0 to second 40, with the Scrap Rush event off. How many coins can pickups pay in one round?

coins

The haul is a very strong signal. It is still one signal. Roblox's own guidance is blunt: assume false positives can happen, prefer actions you can reverse, and act hard only when several different detections agree1.

Here a bug could explain it just as well as a cheat. A MatchService that read the coins before the profile loaded would record the player's whole balance as one match. So the first move is to find out, not to punish.

Choose one

The 4,000-coin row appears. What should the team do first?

The 4,000-coin row appears. What should the team do first?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 2 of 12

What the server already sees

Beacon Yard's server already refuses impossible requests. A swing from more than 8 studs away from the head is rejected, and so is a second swing within 0.4 seconds of the last one. A coin touch only pays if the character is within 12 studs. Today those refusals vanish without a trace.

	if (origin - head.Position).Magnitude > ORIGIN_MAX_STUDS then
		return "rejected"
	end
 
	local now = workspace:GetServerTimeNow()
	local previousSwing = lastSwing[player]
	if previousSwing ~= nil and now - previousSwing < SWING_GAP then
		return "rejected"
	end
	lastSwing[player] = now

Server sideRemember: Server validation is the clerk checks the scoreboard.

The clerk already refuses bad notes. In production you also want the clerk to keep a tally of who keeps sending them. Each refusal is evidence that costs nothing to collect, because the server ran the check anyway.

Roblox's detection guide names three heuristics that fit almost any game: the fastest completion time (a task done faster than the rules allow), the rate of gain (a resource earned faster than possible) and the action cadence (inputs spaced with machine-perfect timing)1. It adds a fourth signal that is almost certain: a honeypotHoneypotA remote that looks real but that no legitimate client script ever fires.Think of it as a door in the yard fence that leads nowhere, watched by a camera., a remote that no real client script ever fires.

Match the pairs

Match each Beacon Yard observation to the heuristic it is.

Link to this step · This confused me

Step 3 of 12

Strikes, weights and a score that fades

A strike is one failed check, with a weight for how sure you are. A move slightly too fast weighs 1, because a lag spike can do that. A teleport weighs 3. A swing from too far away weighs 2. A honeypot weighs 10, because only a meddling client can fire it. The suspicion scoreSuspicion scoreThe weighted sum of a player's recent failed server checks, used to decide between logging, a kick and a ban.Think of it as a referee's notebook where old fouls fade after ten minutes. is the sum of the weights from the last 10 minutes. Older strikes stop counting, so an honest player with one bad connection drifts back to zero.

The score then picks a rung: below 6 the server only logs, from 6 it kicks, from 10 it bans. Run the arithmetic for one player whose strikes arrive over twelve minutes.

Luau
Ctrl Enter runs the cell. Checked against the expected output

Notice one limit of this single-server ExploitWatch: the strikes list lives in memory on one server, so it resets when the player switches servers or the server restarts. In Module 13, Security at scale: one validation layer, shared bans, device trust persists strikes in a DataStore and syncs them across servers over MessagingService.

Predict the output

Same strikes, same rules. What does the cell print for t=1001?

print(string.format("t=%d score=%d %s", 1001, score(1001), verdict(score(1001))))
Same strikes, same rules. What does the cell print for t=1001?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 4 of 12

The consequence ladder

A score is not a punishment. Roblox's guide describes a ladder, and most games climb it one rung at a time1:

  1. Silent logging. Record the evidence. The player notices nothing.
  2. Quiet mitigation. Undo the effect: pull a speeder back to the last valid position, drop the swing, refuse the coins.
  3. Temporary restrictions. Keep the player off the leaderboard or out of matchmaking for a while.
  4. Visible enforcement. A kick, a temporary ban, then a permanent one.

Two habits make the ladder work. Mitigate on every strike, because blocking the effect costs a legitimate player almost nothing. And delay visible consequences, so an exploiter cannot test which action tripped which check.

Where does it break?“The clerk checks the scoreboard” is a good picture of server validation. Where does it stop being true?

It breaks here. A clerk checks only what they remember to check, so every field of every note is a place a check can be missing; one unchecked note is the exploit. Some claims, such as a position the client simulated itself, cannot be checked against anything, only judged as plausible.

The true model. Validation is a function per entry point: shape, permission, distance, rate, then the server's own numbers. Anything the client can both send and have believed is a hole. Where the client owns the state, as with its own movement, the server can only apply heuristics.

The swing check works like the clerk: the server compares a note with its own numbers. Movement is different. The client simulates its own character, so the server cannot check a position against anything. It can only judge whether the move was plausible.

Choose one

Why does a movement strike weigh 1 while a honeypot strike weighs 10?

Why does a movement strike weigh 1 while a honeypot strike weighs 10?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 5 of 12

Log every strike as an analytics event

You cannot tune what you cannot see. Beacon Yard's Analytics.log already wraps AnalyticsService:LogCustomEvent. Use one event name, exploit_strike, with the weight as the value and the kind in a custom field. The docs ask for custom fields instead of many event names, because event names have a much tighter limit (up to 100 custom events per game), while the three custom fields allow 8,000 value combinations23.

luau
AnalyticsService:LogCustomEvent(player, "exploit_strike", weight, {
	[Enum.AnalyticsCustomFieldKeys.CustomField01.Name] = "Kind - " .. kind,
})

The event is already tied to the player, so the fields never need a name or an id. Events send only from a published game's server, and the Explore page can take up to 24 hours to fill2. After an update, watch the chart: if Kind - speed triples overnight, the new map probably has a fast slope, not a wave of cheaters.

Choose all that apply

Which of these belong in the exploit_strike event?

Which of these belong in the exploit_strike event?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 6 of 12

Players:BanAsync, done properly

player:Kick only removes someone from one server. For a lasting ban, the server calls Players:BanAsync(config). It needs Players.BanningEnabled, which you can only turn on in Studio's Players properties4. The config table:

FieldRequiredMeaning
UserIdsyesUp to 50 user ids
DurationyesSeconds, or -1 for permanent; 0 and other negatives are invalid
DisplayReasonyesShown to the player, at most 400 characters, text-filtered
PrivateReasonyesYour notes, at most 1000 characters, never sent to the client
ApplyToUniverseno, default trueEvery place in the experience, or only this place
ExcludeAltAccountsno, default falsefalse means the ban also reaches suspected alt accounts
ApplyDeviceBlockno, default falseBlocks the device from rejoining for 24 hours (desktop only)

A banned player is evicted from every server at once. The call is an HTTP request that can throttle or fail, so wrap it in pcall. In Studio it checks your input but bans nobody in production45. The docs suggest scaling the duration with Players:GetBanHistoryAsync(userId), which only works on a live server: a day, then a week, then permanent.

An admin command must check authority on the server first. Test that half in plain Luau before it touches the real call:

Luau
Ctrl Enter runs the cell. Checked against the expected output

Beside BanAsync, Roblox also offers the Device Trust API (IntegrityService.EvaluatePlayerDeviceTrust and Player.DeviceTrustLevel: Pending, Unknown, None, Standard, Full)6. It checks hardware and OS integrity as a player joins and leaves every decision to you: Roblox takes no action on its own. Today it checks Android, Chromebook and Meta Quest (Web reports None; iOS, macOS, Windows, Xbox and PlayStation currently report Unknown), and Unknown does not mean untrusted. Use it to gate sensitive features like trading or ranked play rather than banning legitimate players on unsupported or older devices. You wire it into Beacon Yard in Security at scale: one validation layer, shared bans, device trust.

Choose one

ExploitWatch reaches a ban for a player whose GetBanHistoryAsync shows one earlier one-day ban. Which Duration fits Beacon Yard's ladder?

ExploitWatch reaches a ban for a player whose GetBanHistoryAsync shows one earlier one-day ban. Which Duration fits Beacon Yard's ladder?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 7 of 12

Rules, messages and appeals

Roblox puts conditions on every ban you give5. Your game rules must not contradict the Community Standards, they must be written down where every player can read them, and you must apply them fairly. Players can appeal to you directly, and Roblox does not mediate those appeals unless your rules or how you enforce them break the Community Standards.

The ban message has its own rules. The player sees your DisplayReason, filtered, with the time left. You may name a brand or platform ("Visit the Discord in my group or game page"). You may not include a direct link, a username, a handle or any personal information5. A case id is perfect: it means nothing to anyone else, and it leads your moderator straight to the evidence in PrivateReason.

Creator Hub (illustration)
Illustration with sample data, not a live Creator Hub capture: the Moderation, Bans page for Beacon Yard listing one banned test account with its public reason (case BY-7Q2), private ExploitWatch evidence, one-day expiry and the open More menu showing See ban history.

Select a numbered pin, or a row below, to read what it marks.

The Bans page: both reasons, the expiry, and each user's history. Illustration with sample data, not a live Creator Hub capture.

The Bans page in Creator Hub (your game, then Moderation, then Bans) shows current bans with both reasons, the expiry and each user's history. You can add or lift bans there. Lifting a ban never deletes the history7. Two unban rules catch people out. An unban only clears a ban with the same ApplyToUniverse scope. And only Players:UnbanAsync lifts a device block, not the dashboard or Open Cloud4.

Choose one

Which DisplayReason follows Roblox's ban messaging rules?

Which DisplayReason follows Roblox's ban messaging rules?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 8 of 12

Lift a ban from outside the game

An appeal comes in on a Saturday. Your moderator should not need Studio to fix a mistake. The user restrictions Open Cloud API is the same system BanAsync uses, and it is in beta89.

CallPath under https://apis.roblox.com/cloud/v2/universes/{universe}/Scope
List the change logGET user-restrictions:listLogsuniverse.user-restriction:read
Read one restrictionGET user-restrictions/{id}universe.user-restriction:read
Ban or liftPATCH user-restrictions/{id} with a gameJoinRestriction bodyuniverse.user-restriction:write

The body is one object: active, duration (a string such as "86400s", permanent when left out), displayReason, privateReason and excludeAltAccounts. It must be updated as a whole, so the update mask is gameJoinRestriction, never one of its fields. The same user can be updated at most twice a minute per experience9. The reference only calls the path id the user-restriction id. Community tools pass the user's numeric id, so the tool below reads it back with get before anyone lifts anything.

luau
-- tools/bans.luau
--   lune run tools/bans logs
--   lune run tools/bans get 12345
--   lune run tools/bans lift 12345
local net = require("@lune/net")
local process = require("@lune/process")
local serde = require("@lune/serde")
 
local apiKey = process.env.ROBLOX_API_KEY
local universeId = process.env.ROBLOX_UNIVERSE_ID
assert(apiKey and universeId, "Set ROBLOX_API_KEY and ROBLOX_UNIVERSE_ID first.")
 
local base = "https://apis.roblox.com/cloud/v2/universes/" .. universeId .. "/user-restrictions"
local headers = { ["x-api-key"] = apiKey, ["content-type"] = "application/json" }
 
local function call(method: string, url: string, body: any?)
	local response = net.request({
		url = url,
		method = method,
		headers = headers,
		body = if body then serde.encode("json", body) else nil,
	})
	assert(response.ok, "HTTP " .. response.statusCode .. ": " .. response.body)
	return serde.decode("json", response.body)
end
 
local command, userId = process.args[1], process.args[2]
if command == "logs" then
	for _, log in call("GET", base .. ":listLogs?maxPageSize=20").logs or {} do
		print(log.createTime, log.user, if log.active then "ban" else "lift", log.duration or "permanent")
	end
elseif command == "get" and tonumber(userId) then
	print(serde.encode("json", call("GET", base .. "/" .. userId), true))
elseif command == "lift" and tonumber(userId) then
	call("PATCH", base .. "/" .. userId .. "?updateMask=gameJoinRestriction", {
		gameJoinRestriction = { active = false },
	})
	print("Lifted the experience-wide ban for user " .. userId)
else
	print("Usage: lune run tools/bans logs | get <userId> | lift <userId>")
end

Give the key only the read scope for a moderator who reviews, and the write scope only to the person who lifts. The key lives in the environment, never in the file, as in Deploying with Open Cloud: staging and production.

Choose one

A player was banned by ExploitWatch with ApplyDeviceBlock = true, and the appeal shows a false positive. The moderator runs lune run tools/bans lift. What is still in the way?

A player was banned by ExploitWatch with ApplyDeviceBlock = true, and the appeal shows a false positive. The moderator runs lune run tools/bans lift. What is still in the way?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 9 of 12

Which tool, when

Other ways pros do this

OptionWhat it isWhen pros pick itTrade-offs
Creator Hub Bans pageBan, lift and read history by user id in the browser.Small teams, one-off decisions, reviewing an appeal.Manual, and it cannot lift a device block.
Players:BanAsync in server codeBans from your own logic, such as ExploitWatch or an admin command.Automatic consequences and in-game moderator tools.Runs only on a live server; you must check authority and wrap it in pcall.
Open Cloud user restrictionsThe same bans over HTTPS with an API key.Support tools, appeal queues, a moderation dashboard outside Roblox.Beta; two updates per user per minute; does not lift device blocks.
Device Trust APIIntegrityService.EvaluatePlayerDeviceTrust and Player.DeviceTrustLevel report device integrity as players join.Gating sensitive features (trading, ranked) or matching players by trust level alongside server checks.Optional; Roblox takes no action; desktop, iOS and consoles currently report Unknown, and some legitimate devices cannot reach Full.
Kick onlyplayer:Kick removes someone from one server.A first, uncertain strike, or a honeypot hit while you collect evidence.They can rejoin at once; there is no record unless you log one.
Choose one

After a map update, exploit_strike events with Kind - speed jump from 40 a day to 900. What does a professional team do first?

After a map update, exploit_strike events with Kind - speed jump from 40 a day to 900. What does a professional team do first?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 10 of 12

Build along: ExploitWatch in your copy

This is an extension of the finished game. Work on a branch of your own copy; the course's src/ does not ship it. The pure half is the challenge file, so you can test it before wiring anything.

Build along

m14-ship

  • challenges/work/exploit_watch.luau
  • src/server/CombatService.luau
  • src/server/init.server.luau
  1. Make challenges/work/exploit_watch.luau pass first: play, then run game.ServerScriptService.RunGameTests:Invoke("exploit-ops", "exploit-ops-watch") in the server command bar. The challenge below lists what the stock file gets wrong.

    You should see The exploit-ops test prints TEST PASS for all 22 checks and a pass code.

  2. Copy the passing module to src/server/ExploitWatch.luau. In init.server.luau, create one record per player on PlayerAdded and drop it on PlayerRemoving.

    You should see src/server/ExploitWatch.luau exists and init.server.luau requires it without errors in Output.

  3. In CombatService.trySwing, call a small onStrike(player, kind) where the far-origin and too-early checks return "rejected". onStrike adds the strike, logs exploit_strike with Analytics.log, prints the score in Studio, and acts on verdict.

    You should see Swinging twice as fast as allowed with a command-bar loop logs a swing_rate strike in Output, and the swing is still refused.

  4. Add a Heartbeat sampler that stores each HumanoidRootPart.Position every 0.5 seconds, calls classifyMove with the speed DataService.applySpeed set, and on a strike puts the player back at the last good position. Test it by cheating on purpose: in Play, switch to the client and run game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 80 in the command bar. The client owns its character, so the server sees the fast moves.

    You should see Setting your WalkSpeed to 80 in the client command bar pulls you back to your last position and logs speed or teleport strikes; at score 6 you are kicked.

  5. Turn on BanningEnabled in the Players properties. On "ban", read the history count (use 0 in Studio, where GetBanHistoryAsync does not work), then call Players:BanAsync(ExploitWatch.banConfig(...)) inside pcall.

    You should see With BanningEnabled on, a ban verdict prints the BanAsync config in Output and the pcall returns without error; nobody is banned from production in Studio.

Link to this step · This confused me

Step 11 of 12

Challenges

Level 3, Professional

Challenge

Fix challenges/work/exploit_watch.luau so ExploitWatch follows the ladder in this lesson. The test is challenges/exploit-ops.luau and the written solution is challenges/solutions/exploit-ops.md. It bans nobody and runs from the command bar in Edit or Play.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("exploit-ops", "exploit-ops-watch") in the server command bar. Copy the pass code from Output.

Done means

  • classifyMove ignores vertical distance, allows walkSpeed * dt * 1.25 + 2 studs, and returns speed or teleport (teleport beyond four times the allowance, or for a NaN position)
  • score counts only strikes from the last WINDOW_SECONDS (600), and verdict logs below 6, kicks from 6 and bans from 10
  • banDuration gives 86400, then 604800, then -1
  • banConfig keeps alt accounts in, puts a case id but no link or handle in DisplayReason, and the score and strike kinds in PrivateReason
  • challenges/exploit-ops.luau prints TEST PASS for every check

The Course Runner prints this code when the test passes.

Level 2, Builder

Challenge

Write Beacon Yard's game rules and its appeal process. Keep the documents in your copy's docs/ folder. This is a self-check; no test grades it.

Start from
The game at milestone m14 (download)

Done means

  • A rules page of at most ten lines that a twelve-year-old can follow, with nothing that contradicts the Community Standards
  • An appeal form that asks only for the case id, the user id and what happened, and states a response time
  • A moderator checklist: read PrivateReason and the strike log, check for an update the same day, decide, lift with tools/bans if wrong, record the outcome
  • The rules and form are reachable from the game page's community link, and no link or handle appears in any DisplayReason

Meet the criteria above, then record your own result. No test grades this check.

Choose one

You add a RemoteEvent named GiveCoins to ReplicatedStorage.Remotes, and no script in Beacon Yard ever fires it. It is fired by one player. What does ExploitWatch do?

You add a RemoteEvent named GiveCoins to ReplicatedStorage.Remotes, and no script in Beacon Yard ever fires it. It is fired by one player. What does ExploitWatch do?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 12 of 12

Recap

Recap

  1. Every failed server check is a weighted strike. The suspicion score adds the strikes of the last ten minutes, so honest lag fades and repeated, varied signals build up.
  2. Climb the ladder: log, quietly undo the effect, restrict, then kick or ban. Delay visible consequences, and treat one signal as a lead, not proof (a honeypot is the exception).
  3. Players:BanAsync needs BanningEnabled, a duration that escalates with history, alt accounts included by default, a DisplayReason with a case id but no link or handle, and the evidence in PrivateReason.
  4. Publish your rules, offer appeals, and lift mistakes with the Creator Hub Bans page or the Open Cloud user restrictions API; only UnbanAsync lifts a device block.

Server validation is the clerk checks the scoreboard, until a clerk checks only what they remember to check, so every field of every note is a place a check can be missing; one unchecked note is the exploit. Some claims, such as a position the client simulated itself, cannot be checked against anything, only judged as plausible.

Next Social growth: invites, referrals, notifications and events

Link to this step · This confused me