Add agnostic keys middleware