We present a novel fragment-based approach that tackles some of the challenges for chemical biology of predicting protein function. The general approach, which we have termed biofragments, comprises two key stages. First, a biologically relevant fragment library (biofragment library) can be designed and constructed from known sets of substrate-like ligands for a protein class of interest. Second, the library can be screened for binding to a novel putative ligand-binding protein from the same or similar class, and the characterization of hits provides insight into the basis of ligand recognition, selectivity, and function at the substrate level. As a proof-of-concept, we applied the biofragments approach to the functionally uncharacterized Mycobacterium tuberculosis (Mtb) cytochrome P450 isoform, CYP126. This led to the development of a tailored CYP biofragment library with notable 3D characteristics and a significantly higher screening hit rate (14 %) than standard drug-like fragment libraries screened previously against Mtb CYP121 and 125 (4 % and 1 %, respectively). Biofragment hits were identified that make both substrate-like type-I and inhibitor-like type-II interactions with CYP126. A chemical-fingerprint-based substrate model was built from the hits and used to search a virtual TB metabolome, which led to the discovery that CYP126 has a strong preference for the recognition of aromatics and substrate-like type-I binding of chlorophenol moieties within the active site near the heme. Future catalytic analyses will be focused on assessing CYP126 for potential substrate oxidative dehalogenation.