The shadow banking system played a major role in the recent financial crisis but remains largely unregulated. We propose principles for its regulation and describe a specific proposal to implement those principles. We document how the rise of shadow banking was helped by regulatory and legal changes that gave advantages to three main institutions: money-market mutual funds (MMMFs) to capture retail deposits from traditional banks, securitization to move assets of traditional banks off their balance sheets, and repurchase agreements (repos) that facilitated the use of securitized bonds as money. The evolution of a bankruptcy safe harbor for repos was crucial to the growth and efficiency of shadow banking; regulators can use access to this safe harbor as the lever to enforce new rules. History has demonstrated two successful methods for regulating privately created money: strict guidelines on collateral, and government-guaranteed insurance. We propose the use of insurance for MMMFs, combined with strict guidelines on collateral for both securitization and repos, with regulatory control established by chartering new forms of narrow banks for MMMFs and securitization, and using the bankruptcy safe harbor to incentivize compliance on repos.