Safeguard
Supply Chain•

Source code or precompiled plugin: which is easier to trust in a game?

Unity supports native plug-ins as precompiled libraries or source. What you can review in each form, and what to ask for when you only get binaries.

Safeguard Security Team
4 min read

Source form is easier to trust because you can read it and build it yourself. Precompiled form is common and often fine, but you are trusting the publisher's build, so you need provenance checks instead of code review. Unity supports both for native plug-ins, so the choice is usually yours to ask for.

What Unity says about plug-in forms

Unity's native plug-ins page says native plug-ins are libraries of unmanaged code written in languages such as C, C++ and Objective-C, which let managed C# code call functions from them. It says you can use both precompiled libraries and source code files as plug-ins, and that when you use source code, Unity compiles and links the plug-in code statically.

So the same functionality can arrive as a binary file you place in the project, or as source your project builds. The page also describes DllImport as the way to tell the scripting runtime where to find an unmanaged function, which is a useful search term when you audit a project.

Comparison

QuestionSource formPrecompiled form
Can you read what it doesYesNot directly
Can you rebuild and compareYes, with the toolchainOnly if the publisher documents the build
Who controls the buildYouThe publisher
Effort to updateMerge a diff, review changesReplace a file, trust the new one
Typical useSmall helper libraries, open sourceCommercial SDKs, platform middleware
Review methodCode review and testsProvenance, hashes, runtime behavior testing

When binaries are your only option

Many commercial SDKs ship only as binaries. That is normal. It changes the checks:

  1. Get the file from the publisher's official channel and record the version and a hash of the file.
  2. Ask the publisher what the library does on the network, what data it collects, and what permissions it needs on each platform.
  3. Ask whether they publish a software bill of materials or a list of bundled third party libraries.
  4. Test it in a scratch build with network capture on, and note which hosts it contacts.
  5. Ask how they handle security reports and how fast they ship fixes.
  6. Record all of the above in your plugin register with an owner.

If a publisher cannot answer basic questions, that is information too. The post on what to do when a vendor goes quiet covers the follow up.

When to push for source

Push for source, or an escrow arrangement, when the plugin touches payment, accounts, user data or anything you could not replace in a week. For low stakes visual helpers, a binary from a reputable publisher with a clear update history is a reasonable risk.

Keeping it manageable

You do not need to read every library. You need to know which ones you have, where they came from, and who updates them. Our guide to inventorying native plugins in a Unity project gives a way to find the binaries first.

Safeguard's SBOM and dependency scanning covers declared packages and libraries, and you can try a free scan at gold.safeguard.sh/scan. Binaries dropped into a Plugins folder need the manual register entries above.

Quick check

Does Unity compile source plug-ins into the game?

Unity's page says that when you use source code as a plug-in, Unity compiles and links it statically.

Is a precompiled plugin automatically unsafe?

No. It means you rely on provenance and testing instead of reading the code.

What is DllImport for?

Unity says it tells the scripting runtime where to find an unmanaged function in a native plug-in.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.