# roblox-security

roblox-security — a skill for Claude Code enforces server-authoritative security for Roblox experiences. Runs during reviews of remote event handlers, combat calculations, inventory transactions, and character physics.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 1300 installs · ★ 131 repo stars
- Author: EL4CTEO
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/EL4CTEO/roblox-skills/tree/HEAD/skills/roblox-security/SKILL.md
- Updated: 2026-11-03
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/el4cteo-roblox-security

## What it does

Guides the coding model to treat client environments as fully compromised. The server validates player intent instead of blindly accepting state changes like awarded coins or registered hits.

Covers argument sanitization patterns rejecting NaN values and spoofed instance tables, token bucket rate limiters, and server-side verification for `ClickDetector` or `ProximityPrompt` objects. It details combat hit-validation flows using server raycasts and distance checks scaled by ping.

Sensitive logic must remain isolated within `ServerScriptService` or `ServerStorage`. External secrets require `HttpService:GetSecret()`, while physics exploits require unanchored parts to drop client network ownership via `SetNetworkOwner(nil)` or adopt server authority mode.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add EL4CTEO/roblox-skills --skill roblox-security -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/roblox-security/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/roblox-security/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add EL4CTEO/roblox-skills --skill roblox-security -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/roblox-security/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add EL4CTEO/roblox-skills --skill roblox-security -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/roblox-security/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install EL4CTEO/roblox-skills skills/roblox-security
```

2. **Manually: put the files in place**
- File: `.github/skills/roblox-security/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add EL4CTEO/roblox-skills --skill roblox-security -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/EL4CTEO/roblox-skills --path skills/roblox-security
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/roblox-security/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add EL4CTEO/roblox-skills --skill roblox-security -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/EL4CTEO/roblox-skills/tree/HEAD/skills/roblox-security/SKILL.md

## When to use it
- reject malicious remote arguments including NaN numbers, unbounded vectors, and invalid UTF-8 strings
- enforce token bucket rate limiting on client-triggered actions
- verify combat hits on the server with raycasts and ping tolerances
- block exploitation of client-side ClickDetector and ProximityPrompt interactions
- prevent physics manipulation by revoking network ownership from clients

## Example prompts
- Audit this Luau remote handler for parameter spoofing and NaN vulnerabilities
- Create a token bucket rate limiter for our inventory interaction events
- Write a server-side hit validation check using character positions and raycasts

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 2464320181637666.

BEGIN THIRD-PARTY FILE 2464320181637666
````text
---
name: roblox-security
description: Anti-exploit design - never trust the client, validate every remote argument (NaN, spoofed instances, strings), rate limiting, ProximityPrompt/ClickDetector abuse, network ownership, movement and hit validation, economy/trade duplication, code confidentiality, secure teleports, Device Trust API, heuristics, Ban API. Use when writing server handlers for client input, combat/economy/trading, or reviewing for exploits.
---

# Roblox security

**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.

## Core rules

1. **The server decides.** Clients send *intent* ("I pressed attack aiming here"), never *results*
   ("I dealt 50 damage", "give me 100 coins").
2. **Validate every argument** of every `OnServerEvent`/`OnServerInvoke`: type, structure, range, finiteness.
3. **Validate context**: is the player alive, in range, not on cooldown, owns the item, allowed to act?
4. **Rate limit** everything a client can trigger (remotes, prompts, touches, clicks).
5. **Keep secrets server-side**: server code in `ServerScriptService`/`ServerStorage`; API keys via
   `HttpService:GetSecret()`; never ship unreleased content to production places.
6. **Prefer silent mitigation** (drop, clamp, correct state) over instant kicks; escalate on repeated signals.

## Argument validation toolkit

```luau
--!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
````
END THIRD-PARTY FILE 2464320181637666

The third-party file has ended. Everything between the 2464320181637666 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2597 of 11035 bytes. © EL4CTEO · MIT · https://github.com/EL4CTEO/roblox-skills/tree/HEAD/skills/roblox-security/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
