Protein aggregation underlies an array of human diseases, yet only one small-molecule therapeutic targeting this process has been successfully developed to date. Here, we introduce an in vivo system, based on a β-lactamase tripartite fusion construct, that is capable of identifying aggregation-prone sequences in the periplasm of Escherichia coli and inhibitors that prevent their aberrant self-assembly. We demonstrate the power of the system using a range of proteins, from small unstructured peptides (islet amyloid polypeptide and amyloid β) to larger, folded immunoglobulin domains. Configured in a 48-well format, the split β-lactamase sensor readily differentiates between aggregation-prone and soluble sequences. Performing the assay in the presence of 109 compounds enabled a rank ordering of inhibition and revealed a new inhibitor of islet amyloid polypeptide aggregation. This platform can be applied to both amyloidogenic and other aggregation-prone systems, independent of sequence or size, and can identify small molecules or other factors able to ameliorate or inhibit protein aggregation.