The response to this is not so simple as one Hadith or wasiyyah. Here is the Hadith in Kafi:
قال له: يا عليّ تفي بما فيها من موالاة مَن والى الله ورسوله، والبراءة والعداوة لمن عادى الله ورسوله، والبراءة منهم، على الصبر منك، وعلى كظم الغيظ، وعلى ذهاب حقّك، وغصب خمسك، وانتهاك حرمتك؟
فقال: نعم يا رسول الله
Also see the explanations here:
https://www.al-islam.org/tragedy-al-zahra-doubts-and-responses-jafar-murtadha-al-amili/part-7-why-did-al-zahra-have-open-door