You face the "heart" of the Foundry with Karlach in your group. Whatever if you have the Wulbren's bomb or the help of the blind gondian, Karlach feels her engine vibrating/reacting to the foundry and tells you that she feels like this place can be a solution to her heart and ask you to not destroy the foundry yet.
Here you already have a choice : Choice 1 : You find this possibility too dangerous, as the Steel Watchers are a really bad things and you destroy the Foundry anyway. =>Consequence : After the boom, Karlach yells at you, considering you betrayed her and condemn her to die. She wants to explode with you but doesn't have the energy to do this. After a monologue where she's devastated to have been betrayed again by someone she trusts, she leaves your group. Later when you face Gortasch, he let you understand that Karlach faced him in order to avenge herself of him, and tried to kill him by booming her heart. But he was too smart to fall into a so obvious trap and she have exploded for nothing. Quest ends here. (Bad end for her)
Choice 2 : You listen to her and don't do anything to the Foundry. You quit the place. =>Consequence : As the Foundry still exists, Steel Watchers are not destroyed, so the fight against Gortsach will be way harder. Quest continues with Step 2.
One thing I would change there is
make it so if you have enough goodwill with Karlach, she doesn't want to kill you even if you do betray her because at that point she cares too much about you, rather than not having the energy to do it. However, if she doesn't hold you in high regard, she should get angry enough to actually try to do it then and there.