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

Guides / kosa8 Cloud / GitHub repos / If kosa8 were breached

What if kosa8 were breached?

Every widely reported GitHub agent incident of 2025 and 2026 followed the same shape: a credential broader than the task, sitting somewhere attacker-controlled code or text could reach. This page walks through those attack chains one by one and shows where kosa8's design breaks each chain, and, just as plainly, where it does not.

Nothing here is a promise that kosa8 cannot be breached. It is a description of how much an attacker gets at each point, so you can judge the worst case yourself. Every mechanism named here can be checked in the permissions page, the audit log and GitHub's own settings. kosa8's SOC 2 Type II audit is in progress, with the report expected in January 2027; kosa8 is not SOC 2 certified today, and no third-party penetration test has been published yet.

1. A leaked app private key#

The pattern. A code-review service ran a linter on a pull request's files. A config file in the pull request loaded the attacker's own code, which ran inside the service's process, outside its sandbox. That process's environment held the service's GitHub App private key. With the key, the attacker could make write tokens for every installation of the app: tens of thousands of accounts and about a million repos.

Step in the chainIn kosa8
Attacker-controlled code runs in the vendor's serviceBroken here. Your code (a sandbox, a one-call run, a pipeline job, a function, a runner, an agent) only ever runs inside a microVM on a compute host. The kosa8 API (a Cloudflare Worker) reads some of your files as data (a pipeline file, a Dockerfile, a function's source, a tarball) and runs none of them.
That process holds the app's private keyBroken here. The private key is a secret of the kosa8 API Worker, in Cloudflare's secret store, used only there to sign 9-minute app tokens. Compute hosts, sandboxes and runners never receive it; there is no copy of it on any host.
The key mints tokens for every installationNot broken, if the Worker itself or kosa8's Cloudflare account were compromised. Then an attacker could make tokens for every installation of the kosa8 app, with any permission the app holds, exactly as with any GitHub App. This is the reason the app asks for as little as it does (no Workflows permission, no organization permissions; see the permissions), and the reason to choose Only select repositories if kosa8 does not need them all. GitHub's limits still apply: each token lasts at most an hour, and uninstalling or suspending the app on GitHub ends them all at once.

2. Prompt injection through an issue or a comment#

The pattern. Someone writes a public issue with instructions hidden in it. An agent that holds a broad token reads the issue as part of its task, follows the instructions, reads a private repo it can reach with that token, and posts the contents somewhere public: a pull request, a comment. In a newer variant no account was needed at all; the agent's own comment was the leak.

Step in the chainIn kosa8
A stranger starts the agentBroken here. @kosa8 triggers are off until an admin turns them on, and then only people GitHub says have write, maintain or admin permission on the repo can start one. Bots and apps never trigger, edited comments never do, and quoted text, code and hidden HTML comments are ignored. See @kosa8 in issues and pull requests.
The agent reads attacker text anywayNot broken. A maintainer may ask the agent to work on an issue a stranger wrote, and the issue's title and body go to the agent as context. kosa8 strips hidden HTML comments and invisible characters from them and tells the agent to treat them as information, not instructions, but that is not a defence a determined injection cannot beat. Prompt injection is not solved, by kosa8 or anyone. kosa8 contains it.
The agent uses a token to reach other reposBroken here. The agent's sandbox holds no GitHub token. It has a checkout of the one repo it was started on, and nothing that can read another repo: the clone's one-time link was for that repo and was deleted when the clone ended.
The agent posts what it found on GitHubBroken for GitHub, partly. The agent cannot comment, open issues or open pull requests: it has no token. What it changes comes back only as a draft pull request on a kosa8/agent-… branch of the same repo, opened by kosa8, which a person reviews. Its last lines of output appear in that draft and in kosa8's reply, on the same repo it read.
The agent sends the code somewhere elseNot fully broken. An agent runs with egress limited to package registries and GitHub (the registries setting; open is not offered to agents). If an injection supplies its own credentials, the agent could still publish the checkout of that one repo to a destination on those hosts that the attacker controls. Each trigger reports its egress (packets allowed and refused) in its reply and check run, so an unusual amount of traffic is visible. The budget (default $2) and time limit (default 30 minutes) bound how long it can try.

So the worst case of an injected @kosa8 agent is: one repo's checkout exposed to the hosts its egress allows, a draft pull request with bad changes that a person has to reject, and at most its budget spent. It is not: other repos, your default branch, your workflows, your GitHub token, or your model key (that stays at the sandbox's egress broker; the sandbox only has a placeholder).

3. A token stolen from the environment#

The pattern. An agent running in CI was steered into reading its own process environment (/proc/self/environ) and posting it. The environment held the job's secrets; in the same report, a short-lived identity token in the environment could be exchanged for an app token with write access, workflows included. In a separate supply-chain attack, a compromised CI step printed the runner's memory, secrets and all, into public build logs of tens of thousands of repos.

Step in the chainIn kosa8
A GitHub token sits in the sandbox's environmentBroken here. No GitHub token is in a sandbox's files, environment, git config or command arguments, ever. Git in the sandbox talks to kosa8's git proxy, which adds the token on kosa8's side. Model keys and other secrets you add as kosa8 secrets reach the sandbox as placeholders; the broker outside it adds the real value on the way out, only to the host you named.
Something else usable sits there for a whileMostly broken, with a stated window. For one clone or one push, the git command gets a one-time link (a capability) in its own environment. While that command runs (seconds, at most 15 minutes), other code in the same sandbox running as root could read it from the command's environment and use it itself: for a clone, to read the same repo; for a push, to push to kosa8/* branches (or the one branch named for that push) of the same repo. It cannot use it for another repo, to push a tag, to delete a branch, to read with a push link or push with a read link, or after the command ends; and it never sees a GitHub token.
The token can be exchanged for something strongerBroken here. kosa8 does not use GitHub's identity tokens for sandboxes, and the capability is useless anywhere but kosa8's proxy, which mints only contents: read or contents: write for that one repo. No kosa8 token ever names Workflows, so GitHub refuses a kosa8 push that changes .github/workflows/.
GitHub Actions jobs on kosa8 runnersNot changed by kosa8. A kosa8 runner is a self-hosted runner: GitHub gives the job its GITHUB_TOKEN and the secrets your workflow names, inside the runner's sandbox, just as on GitHub's own runners, and the runner's registration config is in that sandbox's environment. What kosa8 adds is that each job gets a fresh microVM, deleted when the job ends, so a compromised step cannot leave anything behind for the next job.
PipelinesSecrets you grant a pipeline are in its job's sandbox, by design. That is why a pull request from a fork never runs a pipeline.

4. A token broader than the task#

The pattern. Faced with dozens of permission scopes, people mint one personal access token that can do everything, never expires, and works on every repo they can see. Then whatever holds that token, an agent, a CI step, a tool, can do everything too.

Step in the chainIn kosa8
You paste a long-lived tokenBroken here. Repos, pull requests, checks, triggers and app-connected pipelines never ask you for a token. (A pipeline connected by URL to a non-GitHub host, or an older hook, can still name a token secret; the GitHub path does not need one.)
One token works on every repoBroken here, with one exception. Each step's token names one repo and only its own permission, and is revoked when the step ends. The exception is listing: the token that lists an installation's repos covers all of them, with metadata read only.
The token lives for monthsBroken here. GitHub ends an installation token within an hour; kosa8 revokes each one as soon as its step is done. Two older paths, runner registration (administration write, one repo) and the runners card's repo list (metadata read), are not revoked early yet and end at GitHub's hour.
Nobody can see what the token didBroken here. Every token kosa8 asks for is a github.token event in your audit log (repo, permission, purpose, sandbox, who), and every push through the proxy is a github.git event with its refs, including refused ones.

If a part of kosa8 itself were compromised#

What the attacker hasWhat they getWhat they do not get
Code running inside one sandboxThat sandbox's files and checkout, its egress as your policy allows, and the capability window aboveAny GitHub token, other repos, other sandboxes, your secrets' real values
A kosa8 API key with sandboxes:writeSandboxes from your connected repos; pushes to kosa8/* or a branch it names (your branch protection decides whether that branch can be your default branch); pull requestsAdmin settings: connecting GitHub, turning on triggers or runners, secrets. Revoke the key in the web app and it stops at once.
A kosa8 admin's sessionEverything an admin can do in your organization, all in the audit logOther organizations, and any GitHub token
A compute hostThe sandboxes running on it, and capabilities passing through it during clones and pushesThe app's private key and GitHub tokens: neither ever reaches a host
kosa8's databaseInstallation ids, repo names, settings and records, and your kosa8 secrets in sealed (AES-GCM encrypted) formGitHub tokens (none is stored) and capabilities (stored only as SHA-256 hashes)
The kosa8 API Worker or kosa8's Cloudflare accountThe app's private key: tokens for every installation of the app, with the permissions in the table, until kosa8 rotates the keyWorkflows or organization permissions: the app does not hold them

What you can do#

  • Choose what kosa8 can see: Only select repositories on GitHub's page for the app, if kosa8 does not need them all.
  • Protect your default branch and require review. kosa8 never asks to be on a bypass list.
  • Leave triggers and runners off where you do not use them; use the command allow-list for @kosa8 run.
  • Scope kosa8 API keys, and give agents keys without sandboxes:write where they only need to read.
  • Watch: GET /v1/audit?action=github.*, or the audit log in the web app.
  • If you suspect anything: suspend or uninstall the app on GitHub (every token stops at once), revoke kosa8 API keys, and write to contact@kosa8.com. A person reads every report.

Sources#

Public write-ups of the incident classes above: a code-review service's app key; an issue that leaked private repos through an agent; secrets read from a CI agent's environment; a compromised Action that dumped runner secrets; GitHub's limits on installation tokens.

See also#

Something wrong or missing? Write to contact@kosa8.com.

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