acme/web and its issue 412; replace them with yours.
You need the Developer or Admin role in the organization; see Organizations and roles. You also 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 run its tests on pull requests, for example in GitHub Actions, so you can see them pass on the agent’s pull request.
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. 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.
- Enable
issue_read,get_file_contents,create_branch,push_files, andcreate_pull_requestin the connection’s tool selection. New connections start with read-only tools selected. - Open the connection’s actions menu and click Test connection to confirm it can issue a token.
state is active.
Step 2: Create an environment
The agent works on GitHub through its GitHub tools, which run outside the sandbox, so the environment needs no GitHub network rules. New environments block all outbound traffic, which is fine for this task.- Console
- cURL
- In the sidebar, click Environments, then click Create environment.
- Enter a Name, such as
github-fixes. - Click Create environment.
Step 3: Create the agent with GitHub access
Give the agent the GitHub tools it needs and access to only the repository it needs. The selected tools determine its short-lived token permissions. GitHub’s MCP tools run outside the sandbox;git and gh in the sandbox are not authenticated for GitHub.
- Console
- cURL
- In the sidebar, click Agents, then click Create agent and choose Blank.
- Enter a Name, choose a model, and paste the
systemvalue from the cURL tab into System prompt. Click Create agent. - On the agent’s Configuration tab, under Integrations, click Add integration access and select the GitHub connection.
- Select
issue_read,get_file_contents,create_branch,push_files, andcreate_pull_requestunder Tools. - Clear All authorized repositories, then select
acme/web. - Click Use this access, then click Save new version.
Step 4: Start the session
The opening message names the issue. The system prompt already says how to work: find the cause, commit the fix and a test on a new branch, and open a pull request.- Console
- cURL
- In the sidebar, click Sessions, then click Launch session.
- Choose the Issue fixer agent and the github-fixes environment.
- In Opening message, enter
Fix https://github.com/acme/web/issues/412 and open a pull request. - Click Launch session.
202 Accepted.
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 session to finish
Watch the session in the console, or poll it until the agent’s turn ends.- Console
- cURL
- In the sidebar, click Sessions, then open the session.
- Follow the transcript as the agent reads the issue and code, commits, and opens the pull request.
- When the agent is done, its last message gives the pull request URL.
What success means
- The session’s
stop_reasonisend_turn, and the agent’s last message gives the pull request URL. - A pull request is open in
acme/webfrom a branch other thanmain, its description starts with “Fixes” and the issue URL, and it adds a test for the bug. - A finished session doesn’t prove the work is right. Check the pull request and its checks before you merge. See What success means for other session states.
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 and environment limits.
Next steps
GitHub
Permission presets, vault grants, and how GitHub tools work.
Automations
Start this agent when an issue is labeled.
Research team tutorial
Split a larger task across a team.
Environments
Network policy, setup scripts, and compute.