Neglected invertebrates, marine flatworms, have attracted global research interest due to their biological and chemical potential properties. The marine flatworms (Turbellaria), Phylum Platyhelminthes, belong to the Polycladida group. There are about 3000 species of free-living flatworms that make a living by hunting and eating other animals. A marine flatworm Acanthozoon sp. was used in this study due to its abundant presence in the site location. Staphylococcus epidermidis is an opportunistic pathogenic bacterium that was previously considered a harmless skin disease bacterium. This species is now considered to be in the first rank among the causative agents of nosocomial infection, specifically in the form of infections of the urinary tract, respiratory tract, and surgical site wounds. The aims of this study were to explore the biological diversity of marine flatworm-associated bacteria with antipathogenic properties and to detect the presence of polyketide synthase (PKS) and nonribosomal peptide synthetase NRPS gene clusters through a molecular approach. Recent studies have shown that S. epidermidis undergoes functional changes in the pro-inflammatory peptide family so that it has functions in immune evasion and biofilm development. Therefore, the search for new antimicrobial compounds is urgently needed due to the limited choice of antibiotic use. In the preliminary screening by overlay test, 7 out of 17 (41.2%) isolates showed antibacterial activities. These isolates were reselected and their activity confirmed by using plug agar and disk-diffusion methods. The FA02, FA03, FA05, FA07, FA13, FA16, and FA17 isolates demonstrated their inhibitory activities consistently against the causative agent of nosocomial infection S. epidermidis. Based on the morphological and 16S rRNA partial sequencing analysis, these isolates were closely related to the genus Virgibacillus, Brevibacterium, Alcanivorax, and Vibrio. None of these seven antibacterial strains possesses PKS-I and PKS-II, except NRPS genes for Virgibacillus salarius strain FA02, V. salarius strain FA16, and V. salarius strain FA17. The results of this study showed that bacteria associated with marine flatworms have future potential as a source of promising natural products for the development of antibiotics.