Herein, we demonstrated that AGR2 can modulate the IRE1α-XBP1 cascade to modulate ER homeostasis, switching HCC from the sorafenib-sensitive to the sorafenib-resistant type. Here, XBP1 is linked to hepatocellular carcinoma.