---
title: "Connect GitHub repositories and receive pull requests from a Cloud Agent"
description: "Attach GitHub repositories to a Cloud Agent on TOSE, limit pushes to tose/<slug>/ branches, allow pull requests through the proxy and keep merging for humans."
url: https://tose.sh/en/blog/cloud-agents-github-pull-requests
lang: en
category: "Guides"
tags: ["cloud-agents", "github", "pull-requests", "security"]
author: "TOSE"
published: 2026-11-13T12:49:46.862439Z
updated: 2026-11-13T12:49:46.862516Z
---

# Connect GitHub repositories and receive pull requests from a Cloud Agent

**TL;DR:** The agent uses the workspace's GitHub App through the TOSE proxy and never holds a GitHub token. Up to 10 repositories per agent, read-only by default; push and issue and pull request management are switched on per repository. Pushes can be limited to tose/<slug>/… branches; the agent cannot merge.

> **info**
> **Cloud Agents on TOSE series** · Part 4 of 5
> 1. [Introduction](/en/blog/introducing-cloud-agents-on-tose) · 2. [Create your first Cloud Agent](/en/blog/create-your-first-cloud-agent) · 3. [Delegate tasks via MCP](/en/blog/delegate-tasks-to-cloud-agents-via-mcp) · 4. **GitHub and pull requests** (this article) · 5. [Pricing and auto-sleep](/en/blog/cloud-agent-pricing-and-auto-sleep)

[Video: GitHub repos, pull requests and auto-sleep](https://cdn.tose.sh/blog/0bd75b7bfc1c2e8ea47e408db3e9ef2d.mp4)

After you [delegate a task over MCP](/en/blog/delegate-tasks-to-cloud-agents-via-mcp), the most useful result is a branch or a pull request you can review. This guide shows how to set that up safely.

## The agent never holds a GitHub token

The agent uses the **workspace's GitHub App**, but the token never enters the agent's environment:

• **Pushes** go through the TOSE Git proxy.

• **Issues and pull requests** go through the GitHub API proxy; the agent calls it with `$TOSE_GITHUB_API` and `$TOSE_GIT_TOKEN`, which are proxy credentials, not a GitHub token.

![An agent reaching GitHub through the TOSE proxy](https://cdn.tose.sh/blog/452f657a6cc9763d09bf92ac9d810609.webp)

Permissions are therefore scoped per repository, and even if the agent prints its environment variables, no GitHub token leaks.

## Attach repositories

Attach repositories during configuration, or later in the agent's **Repositories** tab:

• Up to **10 repositories** per agent.

• Each repository lives in its own `/workspace/<name>` folder.

• Access is **read-only** by default.

• Saving changes in the Repositories tab **restarts the agent**, so avoid it while a task is running.

![The agent's Repositories tab](https://cdn.tose.sh/blog/32cf9888782d0cb1ef3f8f44347fd590.webp)

*Mockup of the Repositories tab with sample data.*

## Enable push and limit branches

Push is switched on per repository, with two choices:

• **All branches**; or

• **Only `tose/<slug>/…` branches**.

We recommend the second. A push to any other branch is rejected by git with `only tose/<slug>/* branches may be pushed`, so your main branches stay out of the agent's reach.

## Allow issue and pull request management

Pushing does not open a pull request. To let the agent open pull requests, comment or add labels, turn on **"Let the agent manage issues and pull requests"** for the repository on the agent page.

• This switch exists only on the agent page; a deploy plan cannot request it. An AI that creates an agent over MCP therefore cannot grant itself this access.

• The agent **cannot merge**: merge requests are refused with `GITHUB_API_ENDPOINT_NOT_ALLOWED`.

• The proxy allows **4 concurrent requests and 60 requests per minute** per repository.

## An end-to-end workflow

1. **Settle the brief with your AI: context, scope, definition of done.**
2. **The AI assigns the task, asking the agent to work on `tose/<slug>/fix-refresh-token`, push and open a pull request into `main`.**
3. **The agent changes the code, runs the tests, pushes and opens the pull request.**
4. **You review the diff, check CI and merge it yourself.**

The end result is a pull request, the review format every development team already knows.

## Recommended settings

| Setting | Recommendation |
| --- | --- |
| Push | On, only `tose/<slug>/…` branches |
| Issue and pull request management | On when you want pull requests; off if branches are enough |
| Repositories | Attach only what the agent needs |
| GitHub branch protection | Keep it as an extra safeguard |

*Recommended settings*

**Previous:** [← Delegate tasks to Cloud Agents via MCP](/en/blog/delegate-tasks-to-cloud-agents-via-mcp) **Next:** [Cloud Agent pricing and auto-sleep →](/en/blog/cloud-agent-pricing-and-auto-sleep)

## FAQ

### Does a Cloud Agent hold a GitHub token?

No. Pushes go through the TOSE Git proxy and issue and pull request calls go through the GitHub API proxy; the agent only holds proxy credentials.

### Can a Cloud Agent merge pull requests?

No. Merge requests are refused with GITHUB_API_ENDPOINT_NOT_ALLOWED. Merging is always done by a person.

### How many repositories can one agent use?

Up to 10, each in its own /workspace/<name> folder.
