/roblox-skills:roblox-securityfrom roblox-skills
Anti-exploit design patterns for Roblox: validates remote arguments (NaN, spoofed instances, strings), rate limits, handles ProximityPrompt/ClickDetector abuse, network ownership, movement/hit validation, economy/trade duplication, secure teleports, Device Trust API, and Ban API.
Ships in roblox-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Exploiters fully control their client: they can run any Luau, read every replicated script
(decompiled), fire any remote with any arguments at any rate, edit any local property (WalkSpeed,
prompt Enabled, MaxActivationDistance), and move anything they have network ownership of.
Client-side anti-cheat is at best a speed bump. Security comes from server design.
OnServerEvent/OnServerInvoke: type, structure, range, finiteness.ServerScriptService/ServerStorage; API keys via
HttpService:GetSecret(); never ship unreleased content to production places.--!strict
-- ServerScriptService/Server/Validate.luau
local Validate = {}
function Validate.number(value: unknown, min: number, max: number): number?
if typeof(value) ~= "number" or not math.isfinite(value) then
return nil -- rejects NaN and ±inf (NaN fails every comparison, so range checks alone don't catch it)
end
if value < min or value > max then
return nil
end
return value
end
function Validate.integer(value: unknown, min: number, max: number): number?
local n = Validate.number(value, min, max)
return if n and n == math.floor(n) then n else nil
end
function Validate.string(value: unknown, maxLength: number): string?
if typeof(value) ~= "string" or #value > maxLength or utf8.len(value) == nil then
return nil -- also rejects invalid UTF-8 (which DataStores refuse)
end
return value
end
function Validate.vector3(value: unknown, maxMagnitude: number): Vector3?
if typeof(value) ~= "Vector3" then
return nil
end
if not (math.isfinite(value.X) and math.isfinite(value.Y) and math.isfinite(value.Z)) then
return nil
end
return if value.Magnitude <= maxMagnitude then value else nil
end
-- Accept only a real instance of the expected class that lives under a trusted container.
-- Exploiters can send tables shaped like instances ({ ClassName = "Part", ... }).
function Validate.instanceIn(value: unknown, className: string, container: Instance): Instance?
if typeof(value) ~= "Instance" or not value:IsA(className) or not value:IsDescendantOf(container) then
return nil
end
return value
end
function Validate.enum<T>(value: unknown, allowed: { [T]: boolean }): T?
if allowed[value :: any] then
return value :: any
end
return nil
end
return Validate
player as unknown and narrow it with these helpers.ITEMS[itemId]); never read prices/stats from client data
or from replicated NumberValues the client could reference.--!strict
local Players = game:GetService("Players")
type Bucket = { tokens: number, last: number }
local function newLimiter(capacity: number, windowSeconds: number)
local refillRate = capacity / windowSeconds
local buckets: { [Player]: Bucket } = {}
Players.PlayerRemoving:Connect(function(player)
buckets[player] = nil
end)
return function(player: Player): boolean
local now = os.clock()
local bucket = buckets[player]
if not bucket then
bucket = { tokens = capacity, last = now }
buckets[player] = bucket
else
bucket.tokens = math.min(capacity, bucket.tokens + (now - bucket.last) * refillRate)
bucket.last = now
end
if bucket.tokens >= 1 then
bucket.tokens -= 1
return true
end
return false
end
end
local allowAttack = newLimiter(5, 1) -- bursts of 5, refills 5/second
print(allowAttack)
Rate-limit expensive or exploitable operations especially: DataStore/Badge/HTTP calls (they have their own budgets), cloning large models, teleports, currency grants, anything broadcast to all clients.
| Object | What exploiters can do | Server must |
|---|---|---|
ProximityPrompt | Fire events while disabled; change distance/line-of-sight/HoldDuration locally. Only Triggered gets a distance check. | Re-check enabled state, distance from character, alive, cooldown. |
ClickDetector | Fire from any distance even when disabled. No server checks at all. | Same as above. |
DragDetector | Inherited click events unchecked; drag respects only Enabled and PermissionPolicy. | Validate drag results on the server. |
Touched on client-owned parts | Fake or suppress touches. | Validate with server-side distance/overlap queries. |
If these objects sit in unanchored parts the client can own, an exploiter can pull the part to
themselves: anchor them, or part:SetNetworkOwner(nil) for server ownership.
Clients own their character's physics, so they can teleport, fly, noclip, speed hack, fling other
players (NaN/huge velocities), and suppress Touched. Options, strongest first:
AuthorityMode = Server; fully released, opt-in): the
server simulates movement with client prediction and rollback, eliminating movement exploits.
See roblox-physics.part:SetNetworkOwner(nil).Client sends origin, direction/target part, and timestamp. Server checks:
player:GetNetworkPing()).MarketplaceService.ProcessReceipt (developer products) or after a server
ownership check (passes). Never trust PromptProductPurchaseFinished from the client. See roblox-monetization.LocalScript, client Script, or ModuleScript that replicates can be decompiled — even if
disabled or never required. Don't mix server-only branches into shared modules.HttpService:GetSecret).Player.DeviceTrustLevel (server-read) reports Pending → Unknown / None / Standard / Full. Supported
today on Android, Chromebook, and Meta Quest; web reports None; iOS, desktop, and consoles report Unknown
until supported (Unknown ≠ untrusted). Studio is always Pending. It describes the device, not the
player — it complements server validation, never replaces it.
Standard/Full) or gating features (trading) over rejecting players;
check the impact first in Creator Hub → Safety → Anti-cheat.Pending as untrusted for sensitive features. Decide on the server; tell the client via a remote.--!strict
local IntegrityService = game:GetService("IntegrityService")
type Decision = { Action: Enum.PlayerDeviceTrustDecision, Message: string? }
IntegrityService.EvaluatePlayerDeviceTrust = function(player: Player, _measures): Decision
if player.DeviceTrustLevel == Enum.PlayerDeviceTrustLevel.None then
return { Action = Enum.PlayerDeviceTrustDecision.Reject, Message = "This game can't verify your device." }
end
return { Action = Enum.PlayerDeviceTrustDecision.Accept }
end
Layer server-side heuristics on top of validation: fastest-possible completion time, rate of resource gain, inhumanly regular action cadence, honeypot remotes no legit client fires. Accumulate a suspicion score; act on multiple signals. Ladder: silent logging → quiet mitigation → restrict features → kick/ban. Delay visible consequences so exploiters can't bisect your checks.
--!strict
local Players = game:GetService("Players")
local function banForExploiting(player: Player, evidence: string)
local ok, err = pcall(function()
Players:BanAsync({
UserIds = { player.UserId },
Duration = 7 * 24 * 60 * 60, -- seconds; -1 = permanent
DisplayReason = "Exploiting detected.", -- shown to the user (max 400 chars, filtered)
PrivateReason = evidence, -- visible to you only
ExcludeAltAccounts = false, -- also ban detected alt accounts
ApplyToUniverse = true,
})
end)
if not ok then
warn("BanAsync failed:", err)
player:Kick("Exploiting detected.")
end
end
return banForExploiting
Enable Players.BanningEnabled for the Ban API. Prefer reversible, time-limited bans (check
Players:GetBanHistoryAsync to escalate); version detection rules and monitor false-positive rates.
From January 29, 2027, Ban Lists (Creator Dashboard) let you ban across several of your games and share
lists with other creators.
Security review checklist and common vulnerable-code patterns: references/checklist.md.
roblox-networking, roblox-physics (ownership, server authority), roblox-data-stores,
roblox-monetization, roblox-code-review.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub el4cteo/roblox-skills --plugin roblox-skills23 skills in this plugin
/roblox-analytics-liveopsAnalytics and live ops - AnalyticsService economy/funnel/onboarding/progression/custom events, player segments, experience configs via ConfigService, A/B experiments, badges, experience notifications, timed events, daily rewards, season passes. Use when instrumenting a game, tuning economy or onboarding, running A/B tests or feature flags, or planning live events and re-engagement./roblox-architectureRoblox project structure and client/server model - replication, where code and assets belong (ServerScriptService, ReplicatedStorage, StarterPlayer), RunContext, service/controller bootstrapping, player/character lifecycle, CollectionService components, attributes, streaming-safe client code, library choices. Use when starting a project, deciding where code goes, or fixing replication/streaming bugs./roblox-Other plugins' skills for the same job