(a) A monkey performs a BMI grid task by controlling the cursor using a kinematic decoder (black pathway). We built an error detector (red path) that was integrated into the BMI to perform closed-loop error prevention before (‘Error prevention’, green timeline dot) or auto-deletion during (‘Error auto-deletion’, purple timeline dot) the waiting period. (i) His goal was to move the cursor (white disk) to the cued green target amongst the potential yellow targets. The target selection areas were non-overlapping and collectively spanned a 24×24 cm2 workspace. Therefore, the cursor was always in the acquisition window of a possible target when it was in the grid workspace. The monkey can nominally identify task errors through continuous visual feedback. (ii) When the correct target (green) was being held, the target’s color changed to blue. It reverted to green if the cursor left the target before selection. Holding the cursor over any target (start time indicated by the orange timeline dot) for 300 – 400 ms selected that target. (iii) After selection (green timeline dot), the cued target disappeared (iv) and the monkey waited 600 ms for an auditory feedback tone that matched the outcome and, in successful trials, a liquid reward. A new trial started after an additional 400 ms. (b) Microelectrode array location(s) in motor cortex, as estimated visually during surgery from local anatomical landmarks (A = anterior, P = posterior, L = lateral, M = medial).