The clustered regularly interspaced short palindromic repeats and their associated proteins (CRISPR/Cas) constitute a recently identified prokaryotic defense mechanism against invading nucleic acids. Activity of the CRISPR/Cas system comprises of three steps: (i) insertion of alien DNA sequences into the CRISPR array to prevent future attacks, in a process called 'adaptation', (ii) expression of the relevant proteins, as well as expression and processing of the array, followed by (iii) RNA-mediated interference with the alien nucleic acid. Here we describe a robust assay in Escherichia coli to explore the hitherto least-studied process, adaptation. We identify essential genes and DNA elements in the leader sequence and in the array which are essential for the adaptation step. We also provide mechanistic insights on the insertion of the repeat-spacer unit by showing that the first repeat serves as the template for the newly inserted repeat. Taken together, our results elucidate fundamental steps in the adaptation process of the CRISPR/Cas system.