Implementing security contexts