A computational framework for institutional agency