What is Code Access Security? Describe the purpose of CAS.Code access security is a mechanism to help protect computer systems from malicious code, to run code from unknown origins with protection. It allows code to be trusted to different levels based on where its coming from and its identity. It reduces the chances of your code being misused for performing malicious tasks or operations. It reduces the security vulnerabilities that a piece of code may have as well. CAS defines the permissions and access rights the code has.