Red flags are literally used to signal a problem and it can also be used as a metaphor to convey that the is a particular problem required attention or something that needs to be taken into account, or signals something problematic that needs attention.
For example (from a quick search on the Internet):
Controlling behavior is a red flag in a relationship. "[...] these people or simply feel the need to control where you go and who you associate with, limiting your world to allow in only what is important to them". From 10 Relationship Red Flags
Rudeness in a job interview is a red flag. "Rudeness is a pretty simple red flag to spot. It can come in a couple of different guises though...". From The 8 Biggest Interview Red Flags
If you are trying to hire a contractor and they ask for too much money upfront, that is a red flag. "[...] a contractor who asks for more than 15% upfront should elicit an uh-oh feeling." From Beware of These 8 Red Flags When Hiring a Contractor
I doubt that the literal translation, "bandera roja" is used in Spanish (never heard of it), but it could be the case.
Si un contratista te pide demasiado dinero por adelantado, eso es una bandera roja.
Si tu pareja te controla los mensajes del teléfono y el email, eso es una bandera roja en la relación.
How do you translate the idiom "red flag" into Spanish?