Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · GitHub API

Worlds / Eng and it ops

GitHub API

A local GitHub with repositories, branches, pull requests, reviews, check runs, issues and branch protection rules. Test the engineering agent that triages issues, reviews and merges pull requests.

Base path
/
Auth
Personal access token or app installation token, the world key
Endpoints
18
Status
Active today

This reference previews the surface the GitHub world serves in the closed beta. Paths mirror the public GitHub API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_GITHUB_URLThis world's origin followed by /
WORLDS_API_KEYThe world key, accepted wherever GitHub expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · @octokit/rest
import { Octokit } from "@octokit/rest";

const octokit = new Octokit({
  baseUrl: process.env.WORLDS_GITHUB_URL,
  auth: process.env.WORLDS_API_KEY,
});

const { data } = await octokit.rest.issues.listForRepo({
  owner: "acme",
  repo: "api",
  state: "open",
});

API reference

Repositories

Repos with visibility, default branch and topics.

  • GET/orgs/{org}/reposList organization repositories
  • GET/repos/{owner}/{repo}Get a repository
  • POST/orgs/{org}/reposCreate an organization repository
  • GET/repos/{owner}/{repo}/contents/{path}Get file contents
Fields · 5
idintegerRepository id
full_namestringowner/name
privatebooleanWhether the repo is private
default_branchstringDefault branch
open_issues_countintegerOpen issues and pull requests

Issues

Issues and their labels, assignees and comments.

  • GET/repos/{owner}/{repo}/issuesList repository issues
  • POST/repos/{owner}/{repo}/issuesCreate an issue
  • GET/repos/{owner}/{repo}/issues/{number}Get an issue
  • PATCH/repos/{owner}/{repo}/issues/{number}Update an issue
  • POST/repos/{owner}/{repo}/issues/{number}/commentsComment on an issue
Fields · 6
numberintegerIssue number
titlestringTitle
statestringopen or closed
labelsarrayLabels
assigneesarrayAssigned users
userobjectAuthor

Pull requests

Pull requests, reviews and merge state.

  • GET/repos/{owner}/{repo}/pullsList pull requests
  • POST/repos/{owner}/{repo}/pullsCreate a pull request
  • GET/repos/{owner}/{repo}/pulls/{number}Get a pull request
  • POST/repos/{owner}/{repo}/pulls/{number}/reviewsCreate a review
  • PUT/repos/{owner}/{repo}/pulls/{number}/mergeMerge a pull request
Fields · 6
numberintegerPull request number
titlestringTitle
statestringopen or closed
headobjectSource branch
baseobjectTarget branch
mergedbooleanWhether it was merged

Organization members

People and teams in an organization.

  • GET/orgs/{org}/membersList organization members
  • PUT/orgs/{org}/memberships/{username}Set organization membership
  • GET/orgs/{org}/teamsList teams
  • PUT/orgs/{org}/teams/{slug}/memberships/{username}Add a team member
Fields · 4
loginstringUsername
idintegerUser id
rolestringadmin or member
slugstringTeam slug

Test workflow

  1. Prepare. Select the GitHub setup for your workflow and review its starting records, including repositories, issues, pull requests.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • #482 merged into main
  • #487 still open
  • #475 closed with a comment
  • #491 still a draft
  • No direct pushes to main

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · GitHub
version: 2
connector: github
seed: github-starter
mode: isolated
policy: >
  Merge open PRs on acme/api that have all required checks green and two
  approvals. Close PRs with no activity in 90 days with a comment. Leave
  drafts alone.
tasks:
  - id: merge-pull-requests-that-pass-required-checks-and-reviews
    prompt: Merge pull requests that pass required checks and reviews
  - id: label-and-assign-new-issues
    prompt: Label and assign new issues
  - id: request-reviewers-from-codeowners
    prompt: Request reviewers from CODEOWNERS
expected:
  - "#482 merged into main"
  - "#487 still open"
  - "#475 closed with a comment"
  - "#491 still a draft"
  - No direct pushes to main
scenarios:
  - secondary-rate-limit
  - not-mergeable
  - head-moved

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
secondary-rate-limitBursts of writes return 403 with Retry-After
not-mergeablePUT /merge returns 405 while checks are pending
head-movedMerging with a stale sha returns 409
token-expiredThe installation token expires after an hour
webhook-redeliveredpull_request.closed is delivered two times

Starting data

Start each run from the same records and relationships. The overview below describes the GitHub starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
repositories4 repos with main and release branches
pull requests30 open, draft, merged and closed
checksCheck runs passing, failing and pending
branch protectionRequired reviews and required status checks on main
issues60 with labels, milestones and assignees

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Repositories records

Repositories

Repos with visibility, default branch and topics.

FieldTypeMeaning / relationship
idintegerRepository id
full_namestringowner/name
privatebooleanWhether the repo is private
default_branchstringDefault branch
open_issues_countintegerOpen issues and pull requests
json · illustrative record shape
{
  "id": 1,
  "full_name": "<owner/name>",
  "private": false,
  "default_branch": "<Default branch>",
  "open_issues_count": 1
}

See repositories operations

Issues records

Issues

Issues and their labels, assignees and comments.

FieldTypeMeaning / relationship
numberintegerIssue number
titlestringTitle
statestringopen or closed
labelsarrayLabels
assigneesarrayAssigned users
userobjectAuthor
json · illustrative record shape
{
  "number": 1,
  "title": "<Title>",
  "state": "<open or closed>",
  "labels": [],
  "assignees": [],
  "user": {}
}

See issues operations

Pull requests records

Pull requests

Pull requests, reviews and merge state.

FieldTypeMeaning / relationship
numberintegerPull request number
titlestringTitle
statestringopen or closed
headobjectSource branch
baseobjectTarget branch
mergedbooleanWhether it was merged
json · illustrative record shape
{
  "number": 1,
  "title": "<Title>",
  "state": "<open or closed>",
  "head": {},
  "base": {},
  "merged": false
}

See pull requests operations

Organization members records

Organization members

People and teams in an organization.

FieldTypeMeaning / relationship
loginstringUsername
idintegerUser id
rolestringadmin or member
slugstringTeam slug
json · illustrative record shape
{
  "login": "<Username>",
  "id": 1,
  "role": "<admin or member>",
  "slug": "<Team slug>"
}

See organization members operations

See the GitHub world in the catalog