rl client from Client setup. The examples use the repository acme/web and its issue 412; replace them with yours.
Before you begin
- You need the Developer or Admin role in the organization. See Organizations and roles.
- You need permission to install a GitHub App on the GitHub account that owns the repository, or an existing GitHub connection in Recursion.
- The repository should have a test command that runs in a clean checkout, such as
npm test.
Step 1: Connect GitHub
Connecting is an interactive authorization in GitHub, so do it in the console. It creates a connection for your organization but gives no agent access yet. The SDKs don’t wrap integration operations; use the console or cURL.- Console
- cURL
- In the sidebar, click Integrations, then click Add integration.
- Choose GitHub, then click Continue.
- On GitHub, choose the account and select the repositories the connection may reach, including
acme/web. - Back in Recursion, choose the account if asked. The connection appears under Integration connections.
- Open the connection’s actions menu and click Check to confirm it can issue a token.
state is active.
Step 2: Create an environment that can reach GitHub
New environments block all outbound traffic. A GitHub grant supplies credentials, not network access, so the environment must allow GitHub’s hosts. This example also allows the npm registry so the agent can install dependencies and run the tests.- Console
- TypeScript
- cURL
- In the sidebar, click Environments, then click Create environment.
- Enter a Name, such as
github-fixes. - Set Internet access to Enabled.
- Click Create environment.
Step 3: Create the agent with GitHub access
Give the agent Read and write access (write) to only the repository it needs. That preset can push commits and open pull requests. The agent gets authenticated git and gh commands in its sandbox through a short-lived token. The token isn’t put in the prompt, but commands in the sandbox can read it, so grant only the repositories the task needs.
- Console
- TypeScript
- cURL
- In the sidebar, click Agents, then click Create agent and choose Blank.
- Enter a Name, choose a model, and paste the system prompt from the TypeScript tab into System prompt. Click Create agent.
- On the agent’s Configuration tab, under Integrations, click Add integration access and select the GitHub connection.
- Set Access level to Read and write.
- Clear All authorized repositories, then select
acme/web. - Click Use this access, then click Save new version.
Step 4: Start a graded session
The outcome states what done means. The grader checks the work in the same sandbox with the same tools, so write criteria it can verify, such as a pull request it can open withgh pr view and tests it can run. max_iterations caps how many times the grader can send the work back.
- Console
- TypeScript
- cURL
- In the sidebar, click Sessions, then click Launch session.
- Choose the Issue fixer agent and the github-fixes environment.
- Under Task, select Grade this session against a rubric, and paste the rubric from the TypeScript tab into Rubric.
- In Opening message, enter
Fix https://github.com/acme/web/issues/412 and open a pull request. - Click Launch session.
202 Accepted. With no message, the outcome’s description opens the session.
Idempotency-Key makes the start safe to retry: sending the same key again returns the same session instead of starting a second one.
Step 5: Wait for the grade
Watch the session in the console, or poll the outcome until itsstatus is terminal.
- Console
- TypeScript
- cURL
- In the sidebar, click Sessions, then open the session.
- Follow the transcript as the agent clones, tests, and pushes. The grader’s verdicts appear as each attempt is graded.
- When the session completes, the last message gives the pull request URL.
What success means
- The outcome’s
terminal_resultissatisfied, the session’sexecution_stateiscompleted, and itsstop_reasonisoutcome_satisfied. - A pull request is open in
acme/weband every rubric criterion passed. - Other terminal results need a look:
max_iterations_reachedmeans the grader still found a failing criterion after 3 attempts, andfailedmeans the rubric couldn’t be graded. See Outcomes.
Step 6: Review the pull request
Open the URL from the agent’s last message, or list the repository’s open pull requests through the connection.What can go wrong
Limits
- A grant can list up to 500 repositories.
- An agent can hold up to 25 integration connections.
- See Limits for session, outcome, and environment limits.
Next steps
GitHub
Permission presets, vault grants, and GitHub MCP tools.
Outcomes
Write rubrics that grade reliably.
Research team tutorial
Split a larger task across a team.
Environments
Network policy, setup scripts, and compute.