> ## Documentation Index
> Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# Pull requests

> How Langy changes your code: bot-authored pull requests through a GitHub App, credited to you, reviewed by a human before merge, with the Scenario tests it wrote running in your CI.

Langy changes code in exactly one way: it opens a pull request. It pushes only to the branch it creates for that PR, never to your default or existing branches, and it never merges its own PR.

> [!NOTE]
>
> **Also check:**[Local development](https://langwatch.ai/docs/langy/local-development.md) (the same result from a folder on your machine), [GitHub access](https://langwatch.ai/docs/langy/security/github-access.md) (the scopes and the boundary), [GitHub App setup](https://langwatch.ai/docs/self-hosting/langy/github-app.md) (registering the app when self-hosting), [Scenario tests and evals](https://langwatch.ai/docs/langy/scenario-tests-and-evals.md) (what runs in CI on the PR).

## Two ways to reach your code

The first time a request needs a code change, Langy asks how to reach the code.

| | GitHub App | Shared local folder |
| - | - | - |
| Where the work runs | In Langy's sandbox, on a fresh clone | On your machine, in the folder you share |
| Checks | Your CI, on the pull request | Your own toolchain, before the push |
| Commits | The bot, with you as co-author | Your git identity |
| Setup | Install the GitHub App once | Run one command per conversation |
| Remembered | Yes, with "Remember this choice" | No, one conversation at a time |

This page covers the GitHub App path. The shared folder is described in [Local development](https://langwatch.ai/docs/langy/local-development.md). Both end in a pull request that a person reviews.

## How a Langy PR is made

**1. Langy drafts the change**

After it [reads your traces and writes a failing test](https://langwatch.ai/docs/langy/chat.md), Langy drafts a fix on a
branch.

**2. It opens a bot-authored PR**

The GitHub App opens the pull request on the installed repo. The commits are authored by the
bot; you are credited with a `Co-authored-by` trailer and a "Requested by @\<your-login>
via LangWatch" note on the PR.

**3. Your CI runs the tests it wrote**

The Scenario simulation tests Langy wrote run in your CI on the PR, so the PR carries its own
proof.

**4. A human reviews and merges**

You review the PR like any other. Langy never merges; a person does.

> [!NOTE]
>
> Langy contributes to your codebase exclusively through pull requests. Your code changes only when a human approves the merge.

## The install is the access boundary

Langy can only open PRs on repositories the GitHub App is installed on. The install is the boundary: there is no per-user OAuth and no stored personal token.

If the app is not installed on a repo, Langy stops the turn the moment it reaches for `git` or `gh`. It shows an Install card in chat, then re-runs the turn once you install it.

For the exact GitHub App permissions (Contents read/write, Pull requests read/write, Metadata read) and the token model, see [GitHub access](https://langwatch.ai/docs/langy/security/github-access.md).

## Limits

> [!WARNING]
>
> Langy opens at most **20 pull requests per day**. This limit is fixed.

To register the GitHub App on a self-hosted install, see [GitHub App setup](https://langwatch.ai/docs/self-hosting/langy/github-app.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.