Riku-Ansem is the form that Riku takes to capture Roxas, a mission requested by DiZ to assist with Sora's awakening. During his battle with Roxas in Kingdom Hearts 358/2 Days, Riku unleashed the dark power of Ansem that he had been hiding within him to defeat the latter. From thereon, Riku remains 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.
On Day 354, Riku temporarily appears as Ansem when he meets up with Mickey Mouse in The Woods, before returning to his normal form. He warns Mickey that he might fall into darkness during his upcoming fight with a member of Organization XIII, and makes him promise to help Sora once he awakens and to not tell Sora of Riku's fate.
On Day 358, as he had anticipated, Riku is forced to draw on the power of darkness to subdue Roxas in The World That Never Was, and he takes the form of Ansem indefinitely. DiZ arrives to take custody of the unconscious Roxas, and from this time on, Riku deals with DiZ in the assumed persona of Ansem, although he keeps himself hooded.
Riku, still in the form of Ansem, helps DiZ with the process of merging Roxas with Sora. He occasionally appears before Roxas in the simulated Twilight Town, and, on separate occasions, steals the Munny Pouch and Crystal Orb, which he later gives to Mickey for Sora. He interrupts Naminé's conversation with Roxas, and holds off the Nobodies on the sixth day when Roxas enters the Old Mansion. After Sora awakens, he makes a move for them to leave as he, Naminé, and Axel meet up at Sunset Hill. After being asked by Axel about DiZ's orders to destroy them, he allows them to leave, much to their shock. He then gave them a word of thanks for their help during his and Sora's first encounter with the Organization in Castle Oblivion a year earlier. The three depart via a Corridor of Darkness opened by Axel.
At the end of the Battle of the 1000 Heartless, Sora, Donald, and Goofy are sent into a Corridor of Darkness by Maleficent. While they are there, Riku briefly appears, leaving a box containing sea-salt ice cream and a photo from the simulated Twilight Town, depicting Hayner, Pence, Olette, and Roxas.
He appears in The Land of Dragons, where Fa Mulan is investigating rumors of a spy in black. Sora, Donald, and Goofy accompany her to the summit, where they face a swarm of Rapid Thrusters. While Donald, Goofy, and Mulan go on ahead, the hooded Riku appears before Sora, and the two fight in the middle of the swarm. After a short battle, Riku runs off, but Sora begins to suspect who he really is. Riku travels to the Imperial Palace, where he subdues Li Shang before warning the Emperor of the Storm Rider. After snarkily commenting that "three wise guys" would take care of things, he leaves the world.
After Naminé helps Kairi escape her cell in the Castle That Never Was, they are confronted by Saïx and a pair of Berserkers. Riku appears and takes out the Berserkers with Way to the Dawn before driving off Saïx. Kairi realizes who he is when Naminé calls him by name, and she removes his hood to reveal Ansem's face. Riku takes Kairi to the upper level of the Hall of Empty Melodies, where Sora is facing a massive wave of Shadows. When Shadows attack Kairi, Riku dispatches them and hands Kairi the Destiny's Embrace Keyblade. He then summons his own Keyblade, and he and Kairi take on the Heartless. After Sora defeats Xigbar and makes his way to the upper level, he meets up with Kairi and Riku. At first, Sora believes that Riku is Ansem, but Kairi helps him realize who Riku really is. After an emotional reunion, Sora, Kairi, Riku, Donald, and Goofy continue on through the castle, encountering and defeating Luxord and Saïx. In Naught's Approach, Ansem the Wise's Kingdom Hearts Encoder explodes while attempting to turn Kingdom Hearts into data. The ensuing explosion causes Riku to return to his true form.
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 Corridor of Darkness. In this form, he is easily able to defeat Roxas and Li Shang and 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).