To set up your copilot agent you must first create a github app. This is found under "settings > developer settings > github apps > New GitHub App". After the app is created, you want to click on the "Copilot" tab, and fill out the URL and app description. It is recommended that you also set the pre-authorization URL to an endpoint where you can start the OAuth process. In the general tab, set the callback url to the location that the user should be sent after authorization is complete.