The insect digestive system is the first line of defence protecting cells and tissues of the body from a broad spectrum of toxins and antinutritional factors in its food. To gain insight into the nature and breadth of genes involved in adaptation to dietary challenge, a collection of 20 352 cDNAs was prepared from the midgut tissue of cowpea bruchid larvae (Callosobruchus maculatus) fed on regular diet and diets containing antinutritional compounds. Transcript responses of the larvae to dietary soybean cystatin (scN) were analysed using cDNA microarrays, followed by quantitative real-time PCR (RT-PCR) confirmation with selected genes. The midgut transcript profile of insects fed a sustained sublethal scN dose over the larval life was compared with that of insects treated with an acute high dose of scN for 24 h. A total of 1756 scN-responsive cDNAs was sequenced; these clustered into 967 contigs, of which 653 were singletons. Many contigs (451) did not show homology with known genes, or had homology only with genes of unknown function in a Blast search. The identified differentially regulated sequences encoded proteins presumptively involved in metabolism, structure, development, signalling, defence and stress response. Expression patterns of some scN-responsive genes were consistent in each larval stage, whereas others exhibited developmental stage-specificity. Acute (24 h), high level exposure to dietary scN caused altered expression of a set of genes partially overlapping with the transcript profile seen under chronic lower level exposure. Protein and carbohydrate hydrolases were generally up-regulated by scN whereas structural, defence and stress-related genes were largely down-regulated. These results show that insects actively mobilize genomic resources in the alimentary tract to mitigate the impact of a digestive protease inhibitor. The enhanced or restored digestibility that may result is possibly crucial for insect survival, yet may be bought at the cost of weakened response to other stresses.