Skip to main content
Version: 2026.6

Security rules

An interpreted script runs inside the app of every user who opens the world, so the platform checks it before it accepts it. The check reads the compiled code, without running it, and compares every type and member it uses with a list of what is allowed.

What you can use​

  • The core of .NET: System (strings, maths, Action/Func, exceptions), System.Text, System.Globalization, System.Numerics, System.Collections and System.Collections.Generic, System.Linq, and System.Threading.Interlocked.
  • Unity: the core engine (GameObjects, components, transforms, maths, coroutines), physics (3D and 2D), animation, audio, particle systems, UI, the legacy Input Manager and text rendering.
  • TextMeshPro.
  • The scripting API (Virtuademy.ScriptingApi, Virtuademy.Environments.ScriptingApi).
  • The SPACS Tasks and Dialogs engines (SPACS.Tasks, SPACS.Dialogs).
  • Your own types, in any namespace.

What you cannot use​

Not allowedUse instead
System.Threading (except Interlocked), including Task, async and awaitCoroutines: StartCoroutine(IEnumerator), and the IEnumerator methods of the scripting API
Reflection: GetType(), Type.GetMethod and the like, Activator, Delegate.CreateDelegate, DynamicInvoke, System.Reflection.EmitDirect references to your own types
Files (System.IO), the network (System.Net, UnityWebRequest)SaveData in the scripting API to keep values
SendMessage, SendMessageUpwards, BroadcastMessage, Invoke, InvokeRepeating, CancelInvoke, IsInvokingDirect method calls, coroutines with WaitForSeconds
The overloads that take a name or a System.Type: GetComponent("Name"), AddComponent(type), StartCoroutine("Name"), FindObjectOfType(type)…The generic forms: GetComponent<T>(), AddComponent<T>(), StartCoroutine(IEnumerator), FindObjectsByType<T>(…)
PlayerPrefs, Resources, Application, SystemInfo, QualitySettings, SceneManager, AssetBundle, Microphone, WebCamTextureSaveData and Platform in the scripting API; scene changes through the Scene Changer
Native code: P/Invoke, unsafe pointers, interop—
Declaring a delegate type: public delegate void Handler(int value);System.Action and System.Func<…> (also as the type of a field, a parameter or an event), or an interface
The process and the runtime: System.Environment, Console, GC, AppDomain, System.Diagnostics.Process, Debugger, StackTrace; System.Security, serialization (System.Runtime.Serialization), System.Linq.Expressions—
Every other Virtuademy.* namespace (the placeholders, in Virtuademy.Environments.ScriptingApi.Placeholders, are allowed)The scripting API

The list is maintained by the platform and can change between releases, or be adjusted by the platform operators without a release. A script accepted once may be refused by a later build, and the reverse.

When the check runs​

The check runs when you build from the Addressables management window, in two steps. It is skipped when your scripts and the rules have not changed since the last publish, and when the project has no scripts.

  1. In the Editor, against the rules downloaded from the platform (or the last copy downloaded, if the platform cannot be reached).
  2. On the platform, which has the final say. It checks again when the scripts are uploaded to a world.

You need to be logged in for the second step, with permission to manage environments.

When a script is refused​

The build stops before anything is built or deployed. A dialog says so — Build blocked, or Build & Deploy blocked:

The Build &amp; Deploy blocked dialog: the interpreted script DLL did not pass the security checks

The Console lists the violations, tagged [HotUpdateSecurity]:

  • a first entry, VirtuademyEnvironmentScripts.dll — REJECTED: n policy violation(s) (see entries below);
  • one entry per violation. Some point at the file and the line of the script that uses the refused type or member: click the link to open the script there. Some show only where in the compiled code the use was found (→ typeref, → memberref) and repeat a violation already listed with its line;
  • a closing entry, LOCAL check FAILED — build blocked. (or SERVER check REJECTED the DLL — build blocked. when the platform refused it). With Build & Deploy it is followed by Interpreted script DLL failed the security checks. Build & deploy aborted (see Console). The closing entry is logged again after Unity reloads its scripts.

The Console after a refused build: the REJECTED header, DisallowedType for System.Threading.Tasks.Task and DynamicDispatch for GetComponent by name with links to ForbiddenExample.cs, and LOCAL check FAILED

Each entry starts with the kind of violation. Those marked [server] come from the platform's check.

KindMeaning
DisallowedTypeA type that is not allowed, or in a namespace that is not allowed
DisallowedMemberA method or property that is not allowed on an otherwise allowed type (SendMessage, Invoke, GetType…)
DynamicDispatchThe by-name or by-Type overload of a method whose generic form is allowed (GetComponent(string)…)
DisallowedAssemblyReferenceA reference to an assembly that is not allowed: remove it from the assembly definition (the allowed ones are already referenced: see Referenced assemblies)
PInvoke, UnmanagedCalli, UnsafePointerNative code or unsafe code. A delegate type declared in your scripts is reported as UnmanagedCalli (native method body), with several entries for one declaration: replace the declaration with Action or Func
VerifierLimitThe code is too deeply nested, or has too many violations, to check: simplify it
AssemblyIdentityMismatchRaised by the platform on import: the scripts were not compiled as VirtuademyEnvironmentScripts, because the archive comes from an earlier version of the SDK (for example in a manual upload). Update the SDK, click Fix in the setup window and build again

Other limits: each compiled assembly can be at most 5 MB, the archive of the scripts at most 32 MB, and the scripts must be compiled for all four platforms (Android, iOS, WebGL, Windows).