The Keep on the Borderlands (B2) is a Dungeons & Dragons module by Gary Gygax, first printed in December 1979. It is designed for use with the Dungeons & Dragons Basic Set. Although also available for separate sale, it was included in the 6th to 11th printings (1979-1982) of the Basic Set. The cover of the first printing included the notation, With minor modifications, it is also suitable for use with ADVANCED DUNGEONS & DRAGONS; this was removed from later printings. A novelized version of the adventure was published in 1999.
The module's cover features artwork by Jim Roslof and notes it is especially designed to help beginning players and Dungeon Masters (DMs). Tips for running encounters appear throughout the text to assist beginning DMs. The module also provides rudimentary rules for wilderness adventures as these were not included in the Basic D&D set. The structure of the "dungeon" as a series of separate caves allows for segmented playing sessions for beginners.
The Keep on the Borderlands was ranked the 7th greatest Dungeons & Dragons adventure of all time by Dungeon magazine in 2004, on the 30th anniversary of the Dungeons & Dragons game.
Player characters are expected to arrive at the titular Keep and base themselves there before investigating the nearby Caves of Chaos, a series of closely-placed caverns teeming with multiple species of vicious humanoids. Plot twists include a treacherous priest within the Keep, hungry lizardmen in a nearby swamp, and a mad hermit in the wilderness. It typifies the dungeon crawls associated with beginning D&D players, while permitting some limited outdoor adventures.
When the Grand Duchy of Karameikos edition of the Gazetteer series was published, the Keep was given a specific location in the Known World of Mystara, in the Atlan Tepe Mountain region in northern Karameikos.
A sequel, the Return to the Keep on the Borderlands (1999) for 2nd Edition AD&D, was set twenty years after the events of the original module, and featured a fully re-stocked Caves of Chaos. Although the original B2 publication was generic in terms of setting, the 1999 "Return" located the Keep in the World of Greyhawk. However, the placement of the Keep in Greyhawk was in tension with many details in the sequel, such as several non-Greyhawk deities, nations, and peoples. Indeed, at least two of the NPC descriptions refer to details from the Mystara setting rather than Greyhawk. Andrew Byers, in his review of the adventure, stated "If you're not nostalgic about the early days of D&D ... don't buy this book. But if you're interested in reliving (or experiencing for the first time) those first few roleplaying adventures ... I don't think you'll be disappointed." A "hacked" version of the module was published for the HackMaster RPG and entitled Little Keep on the Borderlands in 2005.