IMPORTANCE: Brain imaging studies have identified robust changes in brain structure and function during the development of psychosis, but the contribution of abnormal brain connectivity to the onset of psychosis is unclear. Furthermore, antipsychotic treatment can modulate brain activity and functional connectivity during cognitive tasks. OBJECTIVES: To investigate whether dysfunctional brain connectivity during working memory (WM) predates the onset of psychosis and whether connectivity parameters are related to antipsychotic treatment. DESIGN: Dynamic causal modeling study of functional magnetic resonance imaging data. SETTING: Participants were recruited from the specialized clinic for the early detection of psychosis at the Department of Psychiatry, University of Basel, Basel, Switzerland. PARTICIPANTS: Seventeen participants with an at-risk mental state (mean [SD] age, 25.24 [6.3] years), 21 individuals with first-episode psychosis (mean [SD] age, 28.57 [7.2] years), and 20 healthy controls (mean [SD] age, 26.5  years). MAIN OUTCOME AND MEASURE: Functional magnetic resonance imaging data were recorded while participants performed an N-back WM task. Functional interactions among brain regions involved in WM, in particular between frontal and parietal brain regions, were characterized using dynamic causal modeling. Bayesian model selection was performed to evaluate the likelihood of alternative WM network architectures across groups, whereas bayesian model averaging was used to examine group differences in connection strengths. RESULTS: We observed a progressive reduction in WM-induced modulation of connectivity from the middle frontal gyrus to the superior parietal lobule in the right hemisphere in healthy controls, at-risk mental state participants, and first-episode psychosis patients. Notably, the abnormal modulation of connectivity in first-episode psychosis patients was normalized by treatment with antipsychotics. CONCLUSIONS AND RELEVANCE: Our findings suggest that the vulnerability to psychosis is associated with a progressive failure of functional integration of brain regions involved in WM processes, including visual encoding and rule updating, and that treatment with antipsychoticsmay have the potential to counteract this.