kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

HTTP API / Integrations

Integrations

19 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.

GitHub Actions runners: linked installations and the link to install the kosa8 GitHub App#

GET/v1/integrations/githubscope admin

Jobs whose runs-on includes the kosa8 label then run on an ephemeral self-hosted runner in a persistent sandbox of this org; a kosa8-4x8 (2x4, 8x16, 16x32) label picks the size.

Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/integrations/github \
  -H "Authorization: Bearer $KOSA8_API_KEY"

GitHub Actions runners: the repositories the linked installations can see, and which run on kosa8#

GET/v1/integrations/github/reposscope admin

Runners are opt-in per repository: a workflow_job from a repository not turned on is ignored.

Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/integrations/github/repos \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Turn kosa8 runners on or off for a repository#

POST/v1/integrations/github/reposscope admin
JSON body
reporequiredstring
owner/name, of an account with a linked installation
enabledrequiredboolean
—
Responses
200400401403404
curl -s -X POST https://api.kosa8.com/v1/integrations/github/repos \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
DELETE/v1/integrations/github/{installation_id}scope admin
Parameters
installation_idrequiredpath · integer
—
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/integrations/github/$INSTALLATION_ID \
  -H "Authorization: Bearer $KOSA8_API_KEY"

GitHub Actions jobs that ran on kosa8 runners, newest first, with this month's CI minutes#

GET/v1/ci/jobsscope sandboxes:read
Parameters
statequery · "queued" | "booting" | "launched" | "busy" | "done" | "failed" | "cancelled"
Only jobs in this state
repoquery · string
owner/name
limitquery · integer
How many, 1 to 200 (50)
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/ci/jobs \
  -H "Authorization: Bearer $KOSA8_API_KEY"

GitHub: is it connected, its installations, and what permissions they lack#

GET/v1/githubscope sandboxes:read

install_url (admins only) installs the kosa8 GitHub App and links it to this organization. missing_permissions lists which of contents:write, pull_requests:write, metadata:read, checks:write and statuses:write an installation lacks: open its manage_url to accept them (checks and statuses only show results on commits; without them kosa8 still works). An installation limited to picked repositories (repository_selection selected) carries add_repos_url and a hint: choose "All repositories" there (recommended) or add the ones you want. Errors (error field): 409 github_not_connected {connect_url}, 404 repo_not_found (not visible to this organization's installations), 409 github_permissions {missing, settings_url}, 409 no_changes, 502 github_unavailable (retry_after_s when GitHub rate-limits).

Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/github \
  -H "Authorization: Bearer $KOSA8_API_KEY"

GitHub: the repositories this organization's installations can see, most recently pushed first#

GET/v1/github/reposscope sandboxes:write

Every repository of every linked installation, all pages (up to 2000 per installation; past that truncated: true), cached 60 s. Errors (error field): 409 github_not_connected {connect_url}, 404 repo_not_found (not visible to this organization's installations), 409 github_permissions {missing, settings_url}, 409 no_changes, 502 github_unavailable (retry_after_s when GitHub rate-limits).

Parameters
qquery · string
Only names or descriptions containing this
pagequery · integer
Page, from next_page
per_pagequery · integer
Repositories a page (30)
freshquery · "1"
1: ask GitHub now, not the 60 s cache
Responses
200401403409502
curl -s -X GET https://api.kosa8.com/v1/github/repos \
  -H "Authorization: Bearer $KOSA8_API_KEY"

GitHub: a repository's branches (first 100, the default first)#

GET/v1/github/repos/{owner}/{repo}/branchesscope sandboxes:write

Errors (error field): 409 github_not_connected {connect_url}, 404 repo_not_found (not visible to this organization's installations), 409 github_permissions {missing, settings_url}, 409 no_changes, 502 github_unavailable (retry_after_s when GitHub rate-limits).

Parameters
ownerrequiredpath · string
Owner
reporequiredpath · string
Repository name
Responses
200401403404409502
curl -s -X GET https://api.kosa8.com/v1/github/repos/$OWNER/$REPO/branches \
  -H "Authorization: Bearer $KOSA8_API_KEY"

The sandbox's GitHub repo and its changes since the clone#

GET/v1/sandboxes/{id}/reposcope sandboxes:read

A pending clone is tried again here. changes (while the sandbox runs, with sandboxes:write): files_changed, insertions, deletions, commits_ahead; null otherwise. The block's fields are also under repo. Errors (error field): 409 github_not_connected {connect_url}, 404 repo_not_found (not visible to this organization's installations), 409 github_permissions {missing, settings_url}, 409 no_changes, 502 github_unavailable (retry_after_s when GitHub rate-limits).

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/sandboxes/$SBX/repo \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Commit every change in the sandbox's repo and push it to a branch#

POST/v1/sandboxes/{id}/github/pushscope sandboxes:write

Commits as kosa8 <bot@kosa8.com> (Co-authored-by the member, when known) in a command with no token, then pushes with a contents:write token for that one repository, revoked right after. Audited as github.push. Errors (error field): 409 github_not_connected {connect_url}, 404 repo_not_found (not visible to this organization's installations), 409 github_permissions {missing, settings_url}, 409 no_changes, 502 github_unavailable (retry_after_s when GitHub rate-limits).

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
JSON body
branchstring
default kosa8/<sandbox short id>
messagestring
default "Changes from kosa8 sandbox <id>"
pathstring
the checkout, default the repo's path
Responses
200400401403404409502
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/github/push \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Push the sandbox's changes and open a pull request#

POST/v1/sandboxes/{id}/github/pull-requestscope sandboxes:write

A draft by default (opened ready where the repository has no drafts). An open pull request for the branch already: 200 with existing: true. Audited as github.pr. Errors (error field): 409 github_not_connected {connect_url}, 404 repo_not_found (not visible to this organization's installations), 409 github_permissions {missing, settings_url}, 409 no_changes, 502 github_unavailable (retry_after_s when GitHub rate-limits).

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
JSON body
titlestring
—
bodystring
Markdown
basestring
default: the repository's default branch
branchstring
default kosa8/<sandbox short id>
draftboolean
Default true.
messagestring
commit message
Responses
201400401403404409502
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/github/pull-request \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Work from GitHub: @kosa8 comment triggers and check-run settings#

GET/v1/github/automationscope sandboxes:read

Needs the sandboxes:read scope. Comment @kosa8 run <command> on a pull request (runs at its head commit; on an issue: the default branch) or @kosa8 agent <task> (the org's coding agent makes the change in a sandbox and opens a draft pull request on a kosa8/ branch). Only people with write, maintain or admin permission on the repository trigger; bots and GitHub Apps never do; edits never do; quoted lines, code and hidden HTML comments are ignored. kosa8 reacts with eyes, keeps one reply comment updated (status, sandbox, duration, cost, egress, then pass or fail) and, on a pull request, posts a check run named kosa8.

Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/github/automation \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Change the GitHub automation settings (send only what changes; {"triggers": true} turns triggers on)#

PUT/v1/github/automationscope admin

Needs the admin scope. 400 invalid_automation names the bad field; 404 unknown_secret when agent.secret does not exist (with an example secret for that kit).

JSON body
triggersboolean
@kosa8 comment triggers (default false: off until an admin turns them on)
commands"any" | "allowlist" | "off"
What @kosa8 run may run: any command, only allowed_commands, or none
allowed_commandsarray of string
With commands allowlist: exact commands, or prefixes ending in * ("npm test*"); plain words only, no shell characters
agentobject | null
The coding agent for @kosa8 agent, or null (then it answers with a setup link)
max_runtime_sinteger
Longest one trigger runs (default 1800) Min 60. Max 21600.
budget_usdnumber
Most one trigger's sandbox may cost (default 2); the run stops there, and its timeout is cut to what the budget buys Min 0.01. Max 100.
sizestring
Sandbox size (default 2x4)
egress"registries" | "open"
registries (default): package registries and GitHub only. An agent always runs with registries
check_runsboolean
Post the kosa8 evidence check run on pull requests from triggers and from POST /v1/sandboxes/{id}/github/pull-request (default true)
Responses
200400401403404
curl -s -X PUT https://api.kosa8.com/v1/github/automation \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Recent @kosa8 comment triggers, newest first#

GET/v1/github/triggersscope sandboxes:read

Needs the sandboxes:read scope.

Parameters
limitquery · integer
Default 50
repoquery · string
owner/name
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/github/triggers \
  -H "Authorization: Bearer $KOSA8_API_KEY"

One pull request of a connected repository: its head and base, to continue it in a sandbox#

GET/v1/github/repos/{owner}/{repo}/pulls/{number}scope sandboxes:write

Needs the sandboxes:write scope and an unrestricted key. Read with a token for that one repository (metadata and pull_requests read), revoked after. head.fork is true when the head branch is on another repository: a sandbox can clone it (repo {name, pr}) but never push to it. 409 github_permissions when the installation lacks Pull requests: read; 404 pr_not_found.

Parameters
ownerrequiredpath · string
Repository owner
reporequiredpath · string
Repository name
numberrequiredpath · integer
Pull request number
Responses
200400401403404409502
curl -s -X GET https://api.kosa8.com/v1/github/repos/$OWNER/$REPO/pulls/$NUMBER \
  -H "Authorization: Bearer $KOSA8_API_KEY"

The token ledger: every GitHub token kosa8 minted, for which repo, for what and until when#

GET/v1/github/activityscope sandboxes:read

Needs sandboxes:read or audit:read. Read from the audit log; never a token (none is stored). Repository look-ups (purpose list or lookup, metadata:read) are left out unless lookups=1. format=csv downloads up to 5000 rows.

Parameters
repoquery · string
owner/name
purposequery · string
clone, push, pr, check, …
actorquery · string
member:<email> or key:<id>
sandbox_idquery · string
A sandbox ID
sincequery · string
Epoch ms or ISO 8601
untilquery · string
Epoch ms or ISO 8601
lookupsquery · "1"
Include repository look-ups
before_seqquery · integer
Page back
limitquery · integer
Default 50
formatquery · "json" | "csv"
csv: a download
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/github/activity \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Pull requests opened from this organization's sandboxes, newest first#

GET/v1/github/pull-requestsscope sandboxes:read

Needs the sandboxes:read scope.

Parameters
repoquery · string
owner/name
statequery · "open" | "draft" | "closed" | "merged"
Only this state
limitquery · integer
Default 50
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/github/pull-requests \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Preview moving a repository's GitHub Actions workflows to kosa8 runners#

GET/v1/github/repos/{owner}/{repo}/runners/migrationscope admin

Needs the admin scope. Reads .github/workflows/*.yml at the default branch with a read-only token for that one repository and answers the diff (runs-on: ubuntu-* to a kosa8 label); changes nothing. Jobs chosen by an expression, multi-line runs-on lists, macOS and Windows are left alone and listed under skipped. missing_permissions lists what the App installation still needs to open the pull request (contents:write, pull_requests:write, workflows:write), with settings_url.

Parameters
ownerrequiredpath · string
Repository owner
reporequiredpath · string
Repository name
labelquery · "kosa8" | "kosa8-2x4" | "kosa8-4x8" | "kosa8-8x16" | "kosa8-16x32"
The runner label (default kosa8: the default size)
Responses
200400401403404409502
curl -s -X GET https://api.kosa8.com/v1/github/repos/$OWNER/$REPO/runners/migration \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Open a pull request that moves the workflows to kosa8 runners (branch kosa8/runners; kosa8 never merges it)#

POST/v1/github/repos/{owner}/{repo}/runners/migrationscope admin

Needs the admin scope. Commits each changed workflow file to kosa8/runners (started again from the default branch) through GitHub's contents API with a token for that one repository (contents, pull_requests and workflows write), revoked right after, and opens a draft pull request; an open one from kosa8/runners is updated and answered 200 with existing: true. 409 github_permissions {missing, settings_url} when the installation lacks Workflows: write (or another); 409 no_changes when no job runs on a GitHub-hosted Ubuntu runner. Audited as github.runners_pr.

Parameters
ownerrequiredpath · string
Repository owner
reporequiredpath · string
Repository name
JSON body
label"kosa8" | "kosa8-2x4" | "kosa8-4x8" | "kosa8-8x16" | "kosa8-16x32"
—
pathsarray of string
Only these workflow files (default: every one with a change)
Responses
200201400401403404409502
curl -s -X POST https://api.kosa8.com/v1/github/repos/$OWNER/$REPO/runners/migration \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA