God prepares His prophet for an anticipated encounter, neutralizing an attempted deception before it even takes place. Even before the wife of Jeroboam arrives, God appears to Ahijah and informs him that she is on her way to ask about the fate of her sick son [ביאור שטיינזלץ]. During this revelation, God instructs the prophet exactly what words He expects him to speak [מצודת דוד, רד״ק].
God also warns Ahijah that upon her arrival [ביאור שטיינזלץ], the woman will try to disguise herself. The primary approach among commentators is that she will pretend to be a stranger, acting as though she is just an ordinary woman rather than the wife of Jeroboam [רש״י, רד״ק, מצודת דוד, ביאור שטיינזלץ].
Armed with this prior knowledge, the prophet is ready to confront her the moment she enters. Because God has already revealed her true identity and placed the exact message in his mouth, Ahijah can call her by name right at the doorway and question her disguise. The harsh prophecy he is sent to deliver is intended specifically for her, making her attempt to hide who she is completely pointless [אברבנאל].