Those aren't related. Those aren't proper legal safeguards. For the definition you mentioned, “undermine the security of Canada”, that concept would be the legal safeguard, effectively.
The preamble and guiding principles aren't legal safeguards, as it were. They are not legally enforceable in the same way as the definition “undermine the security of Canada” concept would be.