Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
SecurityCapabilities
An immutable set of SecurityCapability values that controls which engine APIs and actions a script inside a sandboxed container can access. Assign a SecurityCapabilities value to an instance's Capabilities property to restrict the scripts beneath it.
Capability enforcement takes effect when Workspace.SandboxedInstanceMode is set to SandboxedInstanceMode.Experimental.
Constructors
| Name | Type / Returns | Description |
|---|---|---|
| SecurityCapabilities.new | Returns a new set of capabilities from zero or more SecurityCapability items. | |
| SecurityCapabilities.fromCurrent | Returns a new set of capabilities from the capabilities of the calling function. |
SecurityCapabilities.new
Returns a new set of capabilities from zero or more SecurityCapability items.
local capabilities = SecurityCapabilities.new(Enum.SecurityCapability.Players,
Enum.SecurityCapability.Animation,
Enum.SecurityCapability.Basic)
local newScript = Instance.new("Script")
newScript.Capabilities = capabilities Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| ... | SecurityCapability | Zero or more SecurityCapability values to include in the new set. |
SecurityCapabilities.fromCurrent
Returns a new set of capabilities from the capabilities of the calling function.
Methods
| Name | Type / Returns | Description |
|---|---|---|
| SecurityCapabilities:Add | SecurityCapabilities | Returns a new set of capabilities with zero or more additions. |
| SecurityCapabilities:Add | SecurityCapabilities | Returns a new set of capabilities with the provided set added. |
| SecurityCapabilities:Remove | SecurityCapabilities | Returns a new set of capabilities with zero or more deletions. |
| SecurityCapabilities:Remove | SecurityCapabilities | Returns a new set of capabilities with the provided set deleted. |
| SecurityCapabilities:Contains | boolean | Returns whether a set of capabilities contains the specified SecurityCapability items. |
| SecurityCapabilities:Contains | boolean | Returns whether a set of capabilities contains another set of capabilities. |
SecurityCapabilities:Add
Returns a new set of capabilities with zero or more additions. If you add SecurityCapability items that are already present, they are not duplicated.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| ... | SecurityCapability | Zero or more SecurityCapability values to add to the set. |
Returns
| Type | Description |
|---|---|
| SecurityCapabilities | A new set containing the union of the original capabilities and the specified additions. |
SecurityCapabilities:Add
Returns a new set of capabilities with the provided set added. If you add SecurityCapability items that are already present, they are not duplicated.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| capabilities | SecurityCapabilities | A SecurityCapabilities set whose items are added to the original. |
Returns
| Type | Description |
|---|---|
| SecurityCapabilities | A new set containing the union of both sets. |
SecurityCapabilities:Remove
Returns a new set of capabilities with zero or more deletions. SecurityCapability items not present in the original set are ignored.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| ... | SecurityCapability | Zero or more SecurityCapability values to remove from the set. |
Returns
| Type | Description |
|---|---|
| SecurityCapabilities | A new set with the specified capabilities removed. |
SecurityCapabilities:Remove
Returns a new set of capabilities with the provided set deleted. SecurityCapability items not present in the original set are ignored.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| capabilities | SecurityCapabilities | A SecurityCapabilities set whose items are removed from the original. |
Returns
| Type | Description |
|---|---|
| SecurityCapabilities |
SecurityCapabilities:Contains
Returns whether a set of capabilities contains the specified SecurityCapability items. The set must contain all provided items to return true.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| ... | SecurityCapability | Zero or more SecurityCapability values to check for membership in the set. |
Returns
| Type | Description |
|---|---|
| boolean |
SecurityCapabilities:Contains
Returns whether a set of capabilities contains another set of capabilities. The set must contain all items in the provided set to return true.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| capabilities | SecurityCapabilities | A SecurityCapabilities set to check for membership in the original set. |
Returns
| Type | Description |
|---|---|
| boolean |