s&box
RustCounter-Strike 2s&boxDeadlock
Wiki
Get s&box on Steam
Browse
OverviewGetting StartedCreating GamesEngine & ToolsDocumentationCommunity GamesResources
s&boxDocumentationCodeCode BasicsApi Whitelist
SOURCE 2 · C#
Build and play games with s&box.

Facepunch's game engine and creation platform — make games in C#, or jump straight into community games.

Get s&box on Steam

s&box Wiki

  • Overview
  • Getting Started
  • Creating Games
  • Engine & Tools
  • Documentation
  • Community Games
  • Resources

Tools & Community

  • Getting Started
  • Creating Games
  • Engine & Tools
  • Resources

Platforms

  • RustBattle
  • CSBattle
  • Rust Game Wiki
  • CS2 Skins Wiki
  • Deadlock Wiki

About

  • Official Site
  • Developer Wiki
  • GitHub
  • Get on Steam
NOT AFFILIATED WITH FACEPUNCH STUDIOS · © 2026 s&box Wiki (community)
Docs/Code
Code

Api Whitelist

We prevent access to classes and functions that could be used maliciously by whitelisting what can be used.

When playing s&box, any code that doesn't pass these checks will not be loaded. In the editor, the compiler will generate an error: SB1000: 'x' is not allowed when whitelist is enabled.

Editor code, including libraries, doesn't have to follow these restrictions. If you are developing a standalone game, you can opt out, but you won't be able to publish to the platform while the whitelist is disabled.

Reporting a False Positive

If there's an API you need access to that isn't in the whitelist and you believe it's harmless, please report it on our issue tracker with your reasoning, and we'll review it. Please include the symbol as it appears in the error.

Reporting a Vulnerability

As bugs in this system represent serious security issues, please report discoveries as described here. Do not report them publicly.

Cheat Sheet

For many standard .NET APIs that are blocked, we provide similar functionality via a safe sandboxed API of our own.

Here are some of the common ones to help new devs. Check out our full API reference here.

❌ Not allowed✅ Allowed
Console.WriteLineUse Log.Info as a drop-in replacement.
System.IO*Most standard .NET IO isn't allowed, but you can use our Filesystem API for storage of user data.

Source: Facepunch/sbox-docs (CC-BY-4.0) · updated 2025-07-18. Read it rendered on the official docs.

More in Code

Advanced Topics
Cheat Sheet
Code
Code Basics
Code Generation
Console Variables
Hotloading
IsValid
← All documentation

Community wiki — not affiliated with Facepunch Studios. For the latest and most authoritative information, see the official developer wiki.