This is one of my ideas that didn’t get much development. I’ve never run a game with secret actions, and I like the idea in certain contexts. So in this context, one of the players is working toward a secret goal. The problem is, how do you act in secret through a DM? So instead of telling everyone that one person is working against the group, I’d give them all secret goals. They’d all be harmless or promoting teamwork, except the betrayer. To make this work, the DM should be periodically polling everyone for secret actions. It becomes pretty obvious who’s trying accomplish what if you just allow anyone to give the DM a secret action, but polling everyone reduces the chance of them figuring each other out.
The framework for this mission is that the group has been sent to a dungeon to retrieve an artifact. The artifact is useless to everyone except the betrayer. To the betrayer, it’s an item of ultimate power. The game isn’t over until the betrayer escapes with their artifact leaving no witnesses alive, or everyone is dead. The dungeon should be a slog to the artifact, so that the betrayer doesn’t out themselves immediately and has to rely upon the rest of the party to get to the artifact.
Even after the artifact is in the party’s control, the betrayer needs to get their hands on it and then get out of the dungeon. Ideally, the other players are completely in the dark that one of them ultimately wants to leave them dead in the dungeon. This gives the betrayer the option of either exploiting the artifact and fighting their way out on their own, or slyly using the party to help them get out of the dungeon and then sticking the knife in their backs.
So let’s say the betrayer decides to go it alone after getting the artifact. Does everyone else just watch as they walk out? Of course not! The dead players possess the remaining creatures of the dungeon. Maybe new monsters are summoned by the activation of the artifact. Maybe another party of adventurers was in pursuit of the betrayer and blocking the exit. Regardless, it should not be a cakewalk for the betrayer, even if they’re juiced on artifact power.
I have to admit, this isn’t a particularly great idea now that I spell it out, but it’d be interesting. Probably hard to pull off without giving it all away on accident, or pissing everyone off and turning friends against each other.