How can I help my 12 yo daughter

Hello I am trying to get some advice for helping our 12 yo.

A little back story my husband got full custody of her when she was 6. She came from a home of physical/sexual abuse and neglect. We’ve been in therapy with multiple agencies since day 1. Over the past couple years things have gotten worse she is always making up stories of people in her life now doing harmful things to her but once she has to talk to cys and gone through forensic interviews just to tell them she made it all up. Last year I had to go to jail over an incident of her saying I did something I didn’t do so she was home with her dad (my husband) and our 2 younger children. That’s when she started using an app called stranger chat sending inappropriate pictures/videos of herself to grown men. The police have been involved since we found the first phone. She has found 5 phones and also her school laptop to do said things. Now our safety plan is pretty strict right now but how can I help her not end up down a path like her bio mom? Bio mom is in prison has 12 or 13 children that she is never going to be able to see again because of her own mistakes.

Any advice is appreciated.

Oh man. This is so tough mama, what I suggest is therapy and lots of it. She has been through so much and she just needs someone there right now. Hugs!