Skip to main content

All postsGuides

Connect GitHub repositories and receive pull requests from a Cloud Agent

By TOSEPublished Updated 3 min read

An agent reaching GitHub through the TOSE proxy

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.

Narration and captions are in Vietnamese.

After you delegate a task over 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

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
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

Recommended settings
SettingRecommendation
PushOn, only `tose/<slug>/…` branches
Issue and pull request managementOn when you want pull requests; off if branches are enough
RepositoriesAttach only what the agent needs
GitHub branch protectionKeep it as an extra safeguard

Frequently asked questions

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.