In this paper, we prove that if a Banach space X has the hereditary approximation property, then X⊕2H has the hereditary approximation property for every Hilbert space H. This answers a question of Johnson and Szankowski. In addition, if X is also reflexive, then every closed subspace of X⊕2H has the metric approximation property. The proof uses Grothendieck's characterization of the approximation property, a factorization of nuclear operators through quotients of X, and a nuclear perturbation of the coordinate projection on a closed graph.