Let me caveat by saying that it's hard to answer these things in the abstract without a concrete fact pattern. There are protections within the treaty, though, that do allow for Canada to protect its essential security interests, and there are exceptions to the obligations that Canada has undertaken when it needs to protect its essential security interests.
On November 7th, 2023. See this statement in context.