Behave in a way that is on the verge of being illegal or improper.
Examples:
- She was sailing pretty close to the wind when she called him a liar.
Origin: First half of 1800s, from the danger of sailing literally into the wind
Synonyms: push the envelope, skirt the rules