Codesign dialog does not allow "accept"
So, the cause of this problem seems to be a change in behaviour of El Capitan regarding virtual events (program-generated user input events), and not allowing them to generate keychain approval. I think the BetterTouchTool program is getting in the way here. The solution is either to disable BetterTouchTool or use the keyboard to click the button.

N.B. Apple have detailed this "fix" in the SecurityAgent section of https://support.apple.com/en-us/HT205375.