Agency, understood as the ability of an organism to control stimuli onset, modulates perceptual and attentional functions. Since stimulus encoding is an essential component of working memory (WM), we conjectured that the perceptual process's agency would positively modulate WM. To corroborate this proposition, we tested twenty-five healthy subjects in a modified-Sternberg WM task under three stimuli presentation conditions: an unpredictable presentation of encoding stimulus, a self-initiated presentation of the stimulus, and self-initiation presentation with random-delay stimulus onset. Concurrently, we recorded the subjects' electroencephalographic signals during WM encoding. We found that the self-initiated condition was associated with better WM accuracy, and earlier latencies of N100 and P200 evoked potential components representing visual and attentional processes, respectively. Our work demonstrates that agency enhances WM performance and accelerates early visual and attentional processes deployed during WM encoding. We also found that self-initiation presentation correlates with an increased attentional state compared to the other two conditions, suggesting a role for temporal stimuli predictability. Our study remarks on the relevance of agency in sensory and attentional processing for WM.