Riku-Ansem is the form that Riku takes to capture Roxas, a mission requested by DiZ to help with Sora's awakening and restore his power. Roxas was overpowering Riku during their battle, but Riku was determined not to lose to the Nobody, so he removed his blindfold and revealed the dark power of Ansem that he had been hiding within him. He then succeeds in defeating Roxas and takes him to DiZ, and ultimately the Simulated Twilight Town.
Riku takes this form at the end of Kingdom Hearts 358/2 Days and continues to remain in this form throughout most of Kingdom Hearts II. In this form, he appears identical to Ansem, other than his clothing, and even refers to himself as a pseudo-Ansem. However, those who truly know Riku can sense him behind the appearance, as witnessed when Sora recognizes him in The Land of Dragons. In The World That Never Was, Naminé reveals Riku's true identity to Kairi, who then tells it to Sora, Donald, and Goofy.
Riku takes this form at the end of Kingdom Hearts 358/2 Days when he is defeated by Roxas. Riku already knows that he will use this form, and Mickey made a promise to never tell Sora about what happened with Riku. In this form, he appears identical to Ansem, other than his clothing, and even refers to himself as a pseudo-Ansem. After Riku-Ansem defeats Roxas, DiZ appears and takes Roxas. DiZ then puts Roxas into a Simulated Twilight Town, to continue the progress of Sora's awakening.
Riku continues to remain in this form throughout most of Kingdom Hearts II. He helps DiZ awaken Sora and puts Naminé in line when she attempts to contact Roxas. When Roxas tries to enter the Old Mansion, several Nobodies appear, and Riku-Ansem hinders their progression.
He appears again in The Land of Dragons to alert them about the Storm Rider. Mulan is the first who saw Riku, and tries to catch him. Sora, Donald and Goofy arrive, and with Mulan, go to the Summit and find Riku. Sora confronts Riku but he escapes and goes to the Imperial Palace to talk with The Emperor. Riku-Ansem defeats Li Shang and talks about the Storm Rider. After relaying his message, he leaves the world.
Riku-Ansem appears again in The World That Never Was after Naminé helps Kairi to escape. Saïx appears and attempts to capture the two girls, but Riku arrives with his Keyblade and confronts Saïx, who then escapes. Kairi discovers the truth about Riku through Naminé, and they go see Sora. In the Hall of Empty Melodies several Shadows appear; Riku summons two Keyblades and hands one to Kairi.
After Sora defeats Xigbar, he meets Kairi and Riku-Ansem. At first Sora believes that Riku is Xehanort's Heartless, but he discovers that Riku has taken the form of Xehanort's Heartless. Sora, Kairi, Riku, Donald and Goofy go to confront Xemnas, but first they defeat Saïx and Luxord. In Naught's Approach, Ansem's Kingdom Hearts Encoder explodes while attempting to turn Kingdom Hearts into data. Riku is transformed back into his normal form due to this incident.
While in Riku-Ansem form, Riku gains complete control over the dark powers of Ansem, Seeker of Darkness. He can levitate, summon the Guardian, teleport, and expel bursts of dark energy (though this is only shown when he actually transforms).
He also gains his Dark Firaga ability from his Dark Mode, and a Dark Shield ability (which carries over to his normal form). He can also open and use Corridors of Darkness. In this form, he is easily able to defeat Roxas and Li Shang, as well as overpower Saïx, forcing the latter to flee.
However, when the Kingdom Hearts Encoder exploded and he was reverted out of this form, his heart was no longer tainted with darkness, so he could no longer use many of the abilities of his Riku-Ansem mode (as revealed when they attempted to leave the World That Never Was and Riku failed to open a Corridor of Darkness).