"Marge in Chains" was written by Bill Oakley and Josh Weinstein and was the first episode that they wrote as staff writers. The script was assigned to them after somebody else had come up with the idea. The first draft of the script was "slightly more realistic" than the final version of the episode because Oakley and Weinstein had done a lot of research about women in prison, much of which was later replaced. For Apu and Sanjay's brief lines of Indian dialogue, the writers called the Embassy of India in Washington to get them to translate. The Embassy was not "interested or happy" but still did it.