Permissions say what a session can do on GitHub and with the Ellipsis API. Each of `github` and `ellipsis` is `all`, `read_only`, or a list of entries, and a request goes through only when an entry allows it. Leave one out and every request to it is refused. The [environment](/docs/environments) decides which repositories are checked out and which secrets are set, and a checkout needs no permission.

## Allow everything

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    github: all
    ellipsis: all
```

The agent can do everything the GitHub App installation allows and use every operation a session token can. A session you start from the dashboard, or with the CLI and no config file, asks for this.

## Read every repository

<span id="read-only-github-access" />
<span id="read-pull-request-checks" />

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    github: read_only
```

The agent can read code, pull requests, issues, checks, and Actions runs in every repository the GitHub App can see. It can't push, open pull requests, or comment, but it can still edit files in its environment.

## Read everything and push to one repository

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    github:
      - read_only
      - allow: contents.push
        repository: web-repo
```

The agent reads every repository and pushes only to `web-repo`. A list entry is an action name by itself, or a rule that names its actions in `allow` and narrows them with the fields under [Fields](#fields).

## Read code in one repository

<span id="allow-code-and-pull-request-changes" />

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    github:
      - allow: contents.read
        repository: api-repo
```

The agent can clone and read `api-repo`. It can't read its pull requests or issues, or any other repository.

## Open one pull request from its own branch

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    github:
      - allow: read_only
        repository: [api-repo, web-repo]
      - allow: contents.push
        repository: web-repo
        branch: ellipsis/{session_id}/*
      - allow: pull_requests.create
        repository: web-repo
        branch: ellipsis/{session_id}/*
        limit: 1
```

The agent reads both repositories, pushes only to branches that start with `ellipsis/` and the session's id, and opens at most one pull request in `web-repo`. `{session_id}` becomes the session's id, so two sessions never push to each other's branches.

## Push to one pull request

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    github:
      - allow: read_only
        repository: api-repo
      - allow: contents.push
        repository: api-repo
        pull_request: 12
        limit: 1
```

The agent can push once, and only to the branch of pull request 12. A push counts once however many commits it carries.

## Allow Ellipsis API operations

<span id="limit-ellipsis-access" />

```yaml fragment
session:
  claude_code:
    model: claude-opus-5-5
  permissions:
    ellipsis:
      - sessions.get
      - sessions.send_message
```

Entries are operation names as the SDKs call them. `read_only` allows every read operation, and `sessions.*` allows every sessions operation. Anything no entry allows fails with a 403 that names the operation. The token can always read its own identity, which the CLI uses to print links.

## What a refused request does

A refused request never reaches GitHub. `git push` prints the reason next to the branch, and other GitHub calls fail with a 403 that names the action and the repository. A request GitHub refuses doesn't count toward a `limit`.

Unless `permissions.github` is `all`, these are refused whatever the entries say.

- A GitHub write that isn't an action under [Fields](#fields), such as a commit status or a release asset.
- GitHub's GraphQL API, so `gh pr` and `gh issue` commands fail. Use the REST API instead, such as `gh api repos/your-org/api-repo/pulls`.
- A read that isn't under a repository, such as a code search.

## Secrets

The agent and its tools can read every secret the environment sets, and GitHub permissions don't limit what those credentials can do. Keep secret values out of prompts, committed YAML, and command output, because session logs record what tools print.

## Fields

A request passes when any entry allows it, and GitHub entries can't allow more than the GitHub App installation has.

| Field | Type | Meaning |
| --- | --- | --- |
| `github` | `string or list of object` | `all` for everything the GitHub App installation allows, `read_only` for every read in every repository, or a list. A list entry is an action name, or a rule with the fields below that limits what it allows. A request passes when any entry allows it. Default no GitHub access. |
| `github[].allow` | `string or list of string`, required | Actions the rule allows. `read_only` is every read action, and `contents.write`, `pull_requests.write`, `issues.write`, and `actions.write` are every action in that area, reads included. One of `read_only`, `contents.read`, `pull_requests.read`, `issues.read`, `checks.read`, `statuses.read`, `actions.read`, `contents.write`, `pull_requests.write`, `issues.write`, `actions.write`, `contents.push`, `contents.delete_branch`, `pull_requests.create`, `pull_requests.update`, `pull_requests.comment`, `pull_requests.review`, `pull_requests.merge`, `issues.create`, `issues.comment`, `issues.update`, `actions.run`. |
| `github[].repository` | `string or list of string` | Repository names or patterns such as `api-*`. Default every repository of the installation. |
| `github[].branch` | `string` | Pattern for the branch a push writes to or a pull request comes from. `{session_id}` becomes the session id. |
| `github[].base` | `string` | Pattern for the branch a pull request targets. |
| `github[].pull_request` | `integer or list of integer` | Pull request numbers. On `contents.push` it allows only pushes to those pull requests' branches. |
| `github[].issue` | `integer or list of integer` | Issue numbers. |
| `github[].limit` | `integer` | How many times one session may use the rule, from 1. A push counts once, and so does each pull request, comment, review, merge, or request. Default no limit. |
| `ellipsis` | `string or list of object` | `all` for every operation a session token can use, `read_only` for every read operation, or a list. A list entry is an operation name, `read_only`, or a resource with `.*`. A request passes when any entry allows it. Default no Ellipsis API access. |
| `ellipsis[].allow` | `string or list of string`, required | SDK operation names such as `sessions.get`, `read_only` for every read, or a resource with `.*`. |

| Action | Allows | Takes |
| --- | --- | --- |
| `read_only` | Every read action below | `repository` |
| `contents.write` | Every `contents` action, reads included | `repository` |
| `pull_requests.write` | Every `pull_requests` action, reads included | `repository` |
| `issues.write` | Every `issues` action, reads included | `repository` |
| `actions.write` | Every `actions` action, reads included | `repository` |
| `contents.read` | Cloning and reading code | `repository` |
| `pull_requests.read` | Reading pull requests | `repository` |
| `issues.read` | Reading issues | `repository` |
| `checks.read` | Reading check runs | `repository` |
| `statuses.read` | Reading commit statuses | `repository` |
| `actions.read` | Reading Actions runs and logs | `repository` |
| `contents.push` | Pushing commits and creating branches | `branch`, `pull_request` |
| `contents.delete_branch` | Deleting branches | `branch` |
| `pull_requests.create` | Opening pull requests | `branch`, `base` |
| `pull_requests.update` | Editing, closing, and reopening pull requests, labels, and reviewers | `pull_request` |
| `pull_requests.comment` | Commenting on pull requests | `pull_request` |
| `pull_requests.review` | Submitting reviews, approvals included | `pull_request` |
| `pull_requests.merge` | Merging pull requests | `base`, `pull_request` |
| `issues.create` | Opening issues | |
| `issues.comment` | Commenting on issues | `issue` |
| `issues.update` | Editing, closing, and labeling issues | `issue` |
| `actions.run` | Starting and rerunning workflows | |

Every action also takes `repository` and `limit`. A field an action doesn't take fails validation, so put actions that need different fields in separate rules. An action written by itself takes no fields. The names before the dot are GitHub's own permission names.
