We got the below error in one of our Sandboxed Plugins
“System.Security.SecurityException: That assembly does not allow partially trusted callers”.
We realised it was because of using System.Web.HttpUtility class
We replaced it with EscapeDataString method and this fixed the issue.
Hope it helps..