A loophole was a flaw in a legal document's wording or construction that allowed for creative interpretation. It had the potential to be exploited in one's favor.
In 2154, T'Pol tasked Hoshi Sato with finding a way to avoid Jonathan Archer's participation in the ushaan. Travis Mayweather believed it would be better to find a way for the captain to defeat Shran rather than relying on a technicality. (ENT: "United")
In 2367, Jean-Luc Picard believed that challenging the Contract of Ardra depended on his finding a loophole. Upon being told by Data that the contract had been carefully worded in such a way as to avoid such gaps, he told the android to look it over regardless. (TNG: "Devil's Due")
In 2374, William Ross, upon encountering Benjamin Sisko reading "ancient Bajoran texts", described the scene as "The Emissary looks for guidance on the eve of battle." Sisko agreed, adding that he would even accept loopholes. (DS9: "Favor the Bold")
In 2377, unsure how to deal with Valen's predatory actions, Kathryn Janeway searched the Federation Charter for loopholes that would allow them to break the rules. After length study, she believed they should uphold their principles regardless of their unique situation. (VOY: "The Void")