Hafetz Haim Halachot
Halacha 153 / 215

Hilchos Rechilus, chapter 1, section 6

You may not speak rechilus even if keeping quiet will cost you.

For example: the people you work for realize you know something, and order you to tell them. If you refuse, they will suspect you were part of what happened, and fire you, leaving you without a job. Even then, you must stay silent.

This is like other negative commandments: you must give up everything you have rather than break them, as explained in Yoreh De'ah (157:1) in the gloss.

It is only allowed if telling will bring a benefit, prevent harm, or stop a fight. But this last leniency has many details, as we will explain later in chapter 9.