Brain-machine interfaces (BMI) allows individuals to control an external device by controlling their own brain activity, without requiring bodily or muscle movements. Performing voluntary movements is associated with the experience of agency ("sense of agency") over those movements and their outcomes. When people voluntarily control a BMI, they should likewise experience a sense of agency. However, using a BMI to act presents several differences compared to normal movements. In particular, BMIs lack sensorimotor feedback, afford lower controllability and are associated with increased cognitive fatigue. Here, we explored how these different factors influence the sense of agency across two studies in which participants learned to control a robotic hand through motor imagery decoded online through electroencephalography. We observed that the lack of sensorimotor information when using a BMI did not appear to influence the sense of agency. We further observed that experiencing lower control over the BMI reduced the sense of agency. Finally, we observed that the better participants controlled the BMI, the greater was the appropriation of the robotic hand, as measured by body-ownership and agency scores. Results are discussed based on existing theories on the sense of agency in light of the importance of BMI technology for patients using prosthetic limbs.