dnd 5th – How can the Truth Zone spell be defeated without the knowledge of the caster?

Mechanically, Truth zone can be defeated only by high-level features

As you say, any attempt to resist or avoid the effects of Truth zone alert the launcher. And in the context of a loyalty test, avoiding the effect is synonymous with admitting disloyalty. The only exceptions to this rule are some high-level features: Mastermind Rogue's Soul of Deceit feature (as mentioned in Louis Wasserman's answer) destroys the truth-detection system and the level-8 spell. glibness provides a similar ability:

[…] No matter what you say, the magic that determines if you tell the truth indicates that you are truthful.

Note that while glibness causes Truth zone read what you say true, do not you necessarily protect against the obligation to tell the truth. If you intend to use it, you should first ask your deputy minister how it will work. Truth zone to avoid arguments when this actually happens. (On the other hand, Soul of Deceit says explicitly that you can not be forced to tell the truth by magic, so there is no ambiguity there.)

In any case, unless you have access to available features or spells around level 15-17, you will need to pass your Loyalty Test by saying what your character thinks is the truth.

Believe your lies

However, there is at least one small, hard-to-exploit loophole that requires no powerful capacity: Truth zone only prevents a creature from speaking a deliberate lie. If you manage to believe your lies, you will be able to say them while having the effect of Truth zone. For example, if the question of loyalty is something like "Are you loyal to the Empire?", Then you will be able to answer with a simple "yes," even if you plan to murder the person. Emperor, as long as you wish. really and honestly believed it would help the Empire. Obviously, it's a very circumventing the situation, but I want to emphasize that this is materially different from being evasive or "lying with the truth". This is a case where you give exactly the truthful answer expected of you, but for a completely different reason (praying that you will never be asked to specify this reason).

In practice, when you try to use this, you should probably expect reactions from your DM, asking you if your character really believe that. This "loophole" has a concentration on character rather than mechanics. Therefore, if you plan to do so, be prepared with a solid story to justify your honesty. And of course, be prepared to accept the fact that a slightly different question might reveal that your interpretation of loyalty differs from that of your interrogators. In the example above, you would not go well if you were asked instead "Are you loyal to the emperor?"

Unfortunately, I have no experience to share about using this "loophole" in a real game. I simply emphasize that this is the only loophole I can think of.