Are applications required to be installed to the /Applications folder in order to be sandboxed?

Solution 1:

No, it is not really so. Being or not being stored in /Applications is not the determining factor in deciding whether or not an app is sandboxed.

No, other folders are not "less secure" than /Applications.

You haven't described which application in particular you're dealing with, but I would guess that you're running into a specific limitation on sandboxed applications - namely helpers:

An application can include a helper that is run in background using LaunchService - i.e. it runs even though you haven't started the main application.

However, a sandboxed application can only automatically start a helper if the application is stored in /Applications!

Note that there are other requirements that must be fulfilled also, but this is the one with relevance to sandboxing and the /Applications folder. The other requirements are for example that the helper must be signed (similar to the main application) and that the user must have manually started the helper before it can be automatically started.

You can read about macOS sandboxing in more detail here:

https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html