As malaria transmission declines, determining where an infection was acquired becomes central to elimination, yet human mobility moves parasites between communities and makes their genetic profiles more similar. We asked whether genome-wide variation could assign Plasmodium vivax infections to one of two neighboring communities with residual transmission in the Peruvian Amazon, and how far this depended on sample composition. We analyzed 47 infections, 12 of them from people reporting recent local travel, using a machine-learning classifier (penalized logistic regression) with repeated nested cross-validation. Discrimination was modest (area under the curve 0.625, 95% interval 0.522–0.724) and close to chance once travelers were excluded (0.529, 0.402–0.657), although the two analyses used different, overlapping sets of infections. The most informative variants also differed, mapping to msp7 -like genes and a putative multidrug resistance protein when travelers were included, and to merozoite surface protein 3 when they were not. Fine-scale genomic assignment in connected endemic communities is therefore limited, and sensitive to sample composition.