@kosa8 in issues and pull requests
Comment on a pull request or an issue of a connected repo, and kosa8 runs a command or your coding agent in a fresh sandbox, then reports back on GitHub. Agent changes come back as a draft pull request for a person to review. Triggers are off until an admin turns them on.
Before you start#
- GitHub is connected to your kosa8 organization, and the repo is one the installation can see.
- The installation has accepted Issues (needed for
@kosa8on issues, and for GitHub to send comment events at all), Pull requests and Checks. See the permissions.GET /v1/github/automationlists anything missing per installation undermissing_permissions. - An admin turns triggers on:
curl -X PUT https://api.kosa8.com/v1/github/automation -H "Authorization: Bearer $KOSA8_API_KEY" \ -d '{"triggers": true}'
Triggers run as sandboxes of your organization, so your plan, payment method, running limit and spending cap apply to them like to any sandbox.
The commands#
| Comment | What happens |
|---|---|
@kosa8 run npm test | A fresh sandbox clones the pull request's head commit (on an issue: the default branch) and runs the command in the checkout, with CI=true. One reply shows the status, a link to the sandbox, how long it ran, what it cost and its egress (packets allowed and refused), then ✅ or ❌ with the last lines of output. |
@kosa8 agent fix the flaky login test | Your organization's coding agent (Claude Code, Codex or Gemini CLI) gets the task, with the issue's or pull request's title and description as context, and works in a sandbox with the repo cloned. When it finishes with changes, kosa8 commits them and opens a draft pull request from a kosa8/agent-… branch. Everything after @kosa8 agent, including the following lines, is the task. |
@kosa8 or @kosa8 help | A one-line reply with the usage. |
A command can be wrapped in backticks on the same line (@kosa8 run `make check`). A
mention inside a quote (>), a code block or inline code is not a command, so quoting
someone's @kosa8 never runs it again.
On a pull request#
runclones the pull request's head commit, a fork's too. The command runs with no secrets and, by default, egress to package registries and GitHub only.agentworks on pull requests from branches of the same repo, not from forks (kosa8 cannot push to a fork). Its draft pull request is based on the pull request's branch, so it shows only the agent's changes on top; merge it into that branch if you want them. kosa8 never pushes to the pull request's own branch.- A check run named
kosa8on the head commit carries the same evidence as the reply: queued, running, then passed or failed, with a link to the sandbox.
On an issue#
run and agent work on the default branch. The agent's draft pull request is
based on the default branch, and its description names the issue and the task.
Who can trigger#
- Only people GitHub says have write, maintain or admin permission on the repo. kosa8 asks GitHub for the commenter's permission on every trigger.
- Comments by bots and GitHub Apps never trigger, kosa8's own replies included, so nothing loops.
- Only new comments trigger. Editing a comment, or deleting one, never runs anything.
- Hidden HTML comments and invisible or direction-changing characters are removed before kosa8 reads a comment, and from the title and description an agent gets, so text a reader cannot see never reaches a sandbox or an agent as a command.
- Anyone else's
@kosa8is ignored, with no reply. Locked conversations are ignored.
The agent still reads the issue or pull request as context, and anyone may have written that. kosa8 tells the agent to treat it as information, not instructions, but prompt injection is not solved; read What if kosa8 were breached? for what an injected agent can and cannot reach.
What kosa8 will not do#
- Push to your default branch or to the pull request's branch: agent work goes to a new
kosa8/agent-…branch, and the git proxy refuses any other ref. - Mark a pull request ready, approve it, merge it or close it.
- Change files under
.github/workflows/: kosa8's tokens never carry the Workflows permission, so GitHub refuses such a push. - Put a GitHub token or your model key in the sandbox. The model key is a kosa8 secret held at the sandbox's egress broker; the agent sees a placeholder.
- Edit, label or close your issues, or edit anyone else's comment. It adds one 👀 reaction and one reply, which it edits as the work goes.
Set up the agent#
Add the model key as a kosa8 secret whose upstream is the provider's API, then name it:
# the key, held outside the sandbox (the agent sees a placeholder) curl -X PUT https://api.kosa8.com/v1/secrets/anthropic -H "Authorization: Bearer $KOSA8_API_KEY" \ -d '{"value": "sk-ant-…", "upstream": "https://api.anthropic.com", "header": "x-api-key", "scheme": "", "env": {"ANTHROPIC_API_KEY": "{{placeholder}}", "ANTHROPIC_BASE_URL": "{{url}}"}}' # the agent for @kosa8 agent curl -X PUT https://api.kosa8.com/v1/github/automation -H "Authorization: Bearer $KOSA8_API_KEY" \ -d '{"agent": {"kit": "claude", "secret": "anthropic"}}'
kit is claude (Claude Code, upstream https://api.anthropic.com),
codex (Codex CLI, https://api.openai.com) or gemini (Gemini CLI,
https://generativelanguage.googleapis.com). The secret's upstream must match the kit's.
GET /v1/github/automation answers an example secret for each kit. The agent runs headless
with its own permission prompts off: the sandbox, not the agent, is the boundary. Its model use is billed
by the provider to your key; the sandbox time is billed by kosa8.
Settings#
GET /v1/github/automation shows them (any key with sandboxes:read); PUT changes any of them
(admins; audited as github.automation).
| Setting | Default | What it does |
|---|---|---|
triggers | false | Turns @kosa8 comments on for the organization. While off, a write-access commenter gets a one-line reply saying so. |
commands | "any" | "any": any command for @kosa8 run. "allowlist": only allowed_commands. "off": no @kosa8 run, only @kosa8 agent. |
allowed_commands | [] | Up to 50 exact commands, or prefixes ending in * ("npm test*"). With an allow-list, a command with any shell character (; & | $ ` < >, quotes and so on) is refused, so npm test* cannot become npm test; curl …. |
agent | null | {"kit", "secret"} as above. Without it, @kosa8 agent answers with a setup link. |
max_runtime_s | 1800 | The longest one trigger runs, 60 to 21600 seconds. |
budget_usd | 2 | The most one trigger's sandbox may cost, 0.01 to 100. The time limit is cut to what the budget buys at the sandbox's size, and the cost is checked about once a minute while it runs; at the budget the command is stopped. |
size | "2x4" | The sandbox size. |
egress | "registries" | "registries": package registries and GitHub only. "open": the internet, for @kosa8 run only; an agent always runs with registries. |
check_runs | true | Post the kosa8 check run on pull requests, from triggers and from a sandbox's own pull request. |
# only these commands, at most $0.50 and 10 minutes each curl -X PUT https://api.kosa8.com/v1/github/automation -H "Authorization: Bearer $KOSA8_API_KEY" \ -d '{"commands": "allowlist", "allowed_commands": ["npm test*", "make check"], "budget_usd": 0.5, "max_runtime_s": 600}'
Limits#
- At most 5 triggers run at once per organization.
- At most 30 triggers per repo an hour, and 5 agent runs per repo an hour.
- A command is at most 2,000 characters; an agent task at most 3,000.
- Past a limit, the commenter gets a one-line reply saying which, and nothing runs.
- A trigger waits (up to about ten tries, a minute apart) when the organization is at its running limit, then gives up with a reply.
See what ran#
curl -s "https://api.kosa8.com/v1/github/triggers?repo=acme/api&limit=20" -H "Authorization: Bearer $KOSA8_API_KEY"
Each trigger has the repo, the issue or pull request, who asked, the command or task, its state and
conclusion, the sandbox, exit code, time, cost, egress counts, the draft pull request if any, and a link
to the comment. The audit log has a github.trigger event for
each, and every GitHub token kosa8 asked for along the way as github.token.
See also#
- Work with your GitHub repos
- GitHub App permissions
- What if kosa8 were breached?
- Secrets and Egress controls
Something wrong or missing? Write to contact@kosa8.com.