Security
Kraft runs coding agents on your machine, in git worktrees of your
repositories. Without a sandbox, an agent runs as your user and can do
whatever you can. Kraft binds to 127.0.0.1, and on that address its API
needs no login, so any local process can drive it.
To report a vulnerability, see Reporting a vulnerability. The mechanisms behind each protection have their own page.
In short
Added in 2.6
Kraft protects your machine from a web page in your browser and from another machine on your network. It also keeps an agent from acting beyond its own work item, but only a sandboxed worker under a network: policy gets that guarantee. No repository has a sandbox by default, and an unsandboxed agent runs as you.
It doesn't protect you from other users or processes on the same machine, from an agent running without a sandbox, or from anyone who holds your password or bearer token.
Whether an agent can approve its own gate depends on that sandbox and its network: policy. unrestricted_network: true gives the guarantee up, and on macOS the sandboxed worker can still read your other processes' environment. Cursor can't run under a network: policy, so it can't have the guarantee.
Threat model
Kraft runs on your machine, binds 127.0.0.1 by default, and edits your
repositories through git worktrees using whatever coding agent you have
configured. Seven threats shape it:
| Threat | What stops it | Section |
|---|---|---|
| A web page in your browser | A loopback bind that checks the Host, no framing, and no images fetched from other sites | Network and browser |
| Another machine on your network | A loopback bind by default; a password, allowed_hosts and a login throttle when you expose it | Network and browser, Login |
| An agent acting beyond its own work item | Refused item verbs, a sandbox and a network policy | Agents and gates, Workers and the sandbox |
| A repository's content or settings | Search reads only regular files inside the repository; Settings need the password only off loopback | Files and settings |
| An add-on you installed, or its next update | A review before anything is written, limits and never permissions, no commands and a version pinned per work item | Kraft add-ons |
A repository's own .kraft/ library | The same limits and review, read from the commit origin names, and loaded only after a person accepts it | Repo libraries |
| Text an agent reads that steers it | Nothing filters it. A sandbox with a network: policy, a tool policy and the gates limit the damage | Prompt injection |
What Kraft doesn't try to protect against is under Out of scope.
Out of scope
Kraft doesn't try to protect against these:
| Not protected | Why |
|---|---|
| Other users and processes on the same machine | The loopback API has no login, so anyone who can open a connection to it can drive Kraft. $KRAFT_HOME/run itself is 0700, so other users can't read the databases and logs in it. |
| An agent running without a sandbox | It has your user's access. See Default posture. |
| The agent CLI and its provider | Kraft runs the CLI you installed. What that CLI sends to its model provider, and what the provider keeps, is between you and the provider. See Data and privacy. |
| A repository's own commands | Its setup_command and test commands run with the worker's access. |
| Anyone who has your password or the bearer token | Either one grants full control. |
| The machine and the forge | A compromised OS, container runtime, gh or glab login, or git remote is outside what Kraft can check. |
Run it safely
These settings matter most. Each one is a line here and a link to the page that explains it.
- Run each repository's agents in a sandbox.
Without one, an agent has your SSH agent, your logins and your home
directory. Without a container runtime,
kind: osfences the agent with the operating system's own sandbox, bubblewrap on Linux and Seatbelt on macOS: see The OS sandbox. - Give the sandbox a
network:policy. A launch into a sandbox without one is refused, whatever the harness, because that sandbox's network isn't restricted and the worker has no channel to Kraft.unrestricted_network: trueon the sandbox accepts that knowingly: the launch runs and gates aren't enforced. Cursor ignores a proxy, sonetwork:refuses it: it runs in a sandbox only withunrestricted_network: trueand without a tool policy. See Network policy. - Keep Kraft on loopback. To reach the board from another device, set an access password first and use Tailscale: Remote access.
- Protect your default branch with a required review from someone other
than the account Kraft uses. A sandboxed worker under the
network:policy of step 2 can't approve its own gate; an unsandboxed one can. See Agents and gates. - Don't point Kraft at content you don't trust: a repository, a trigger source or a beads queue. A sandbox limits what the agent can do, not what an injected instruction gets it to write into the change. See Prompt injection.
- Give CI and webhook senders the
trigger-token, never themcp-token. See The bearer token. - Review a harness profile's
executableand a repository'ssetup_commandafter anyone else has had access to Settings. See Files and settings.
Default posture
This is what a fresh install does before you change any setting.
| Area | What a fresh install does | Tighten it |
|---|---|---|
| Sandbox | None. No repository sets sandbox:, so every agent runs directly on your machine, as your user. | Set sandbox: on a repository: a container, or kind: os on Linux or macOS. On macOS a sandboxed worker can still read your other processes' environment: what it does less. |
| Files and logins | A worker reads anything your user can: ~/.ssh, your forge CLI's login, your agent's login, and $KRAFT_HOME, including the bearer token. It can push with your SSH agent. | Run it in a sandbox. |
| Worker environment | An allowlist, but it includes HOME and SSH_AUTH_SOCK and passes ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN through. | Environment variables lists it; a sandbox credentials entry, which needs network:, keeps a variable out of the container. |
| Network | Without a sandbox, a worker reaches any host your machine can. A sandbox without a network: policy is refused unless it sets unrestricted_network: true, which leaves egress open. | Add network: to the sandbox. |
| Claude Code | Shipped chains run it with --permission-mode auto and no tool list. Its own classifier decides most calls. A call that reaches Kraft's permission gate is allowed, because no allowed_tools is set, except Monitor and your deny_tools. | Set allowed_tools and deny_tools: Permission gate. |
| Gemini and Antigravity | Never reach the gate. Gemini runs with --approval-mode yolo and Antigravity with --dangerously-skip-permissions, so every call is approved. Neither can enforce a tool list, so a launch with one is refused. | Unattended runs has the flags. |
| OpenCode and Amp | Never reach the gate. OpenCode runs with --auto and Amp asks for no approvals. Both enforce deny_tools and allowed_tools through rules Kraft writes at launch. | Unattended runs. |
| Codex and Cursor | They reach the gate through a pre-tool hook, installed only when the task's policy has something to enforce. With no allowed_tools, the gate gives no opinion, so the CLI's own mode decides every call outside deny_tools and the grants. | Permission gate. |
| Codex and Cursor, when Kraft can't answer | The CLI's own mode decides, unless the task holds allowed_tools: then the hook denies. In a sandbox under network:, the hook denies on any failure. | Permission gate. |
| Escalation turns | They hold the git-commit, git-rebase and git-push grants, which the permission gate allows. They can push their item's branch, including with --force-with-lease. | defaults.escalation_grants: [] removes the gate's allow only. See Escalation turns can force-push. |
| Local API | While Kraft is bound to 127.0.0.1, a request from this machine needs no password or token. Any local process or user can file, start and approve work. | Not possible on loopback. See Out of scope. |
| Gates | Most shipped gates wait for you. See Agents and gates. | Require a review on your forge. |
| An agent deciding its own gates | An unsandboxed worker can. See Agents and gates. | Sandbox it with a network: policy, and require a review. |
Prompt injection
Everything a worker reads is input to the agent, and text in it can steer the agent. That includes:
- the repository's files, including ones other people wrote;
- the repository's pull-request rules, which a task that declares
pr_rulesis told to follow, as they are on the item's own branch; - a work item's title and description, whether a person typed it, a trigger posted it or auto-intake copied it from a bead;
- review comments on the merge request, which the feedback loop asks the agent to address.
Kraft doesn't filter or sanitise any of it. What limits the damage is what
limits any other agent mistake: a
sandbox with a network:
policy, a tool policy (allowed_tools, deny_tools), and the gates, where a
person reads the change before it merges. Under the
default posture, an injected instruction runs with your
user's access.
Don't point Kraft at a repository, a trigger source or a bead queue whose content you don't trust. A sandbox limits what the agent can do, not what an injected instruction gets it to write into the change.
Kraft pushes the branch from the host, outside any sandbox, and runs no git
hook then, not even one you installed in the repository's git directory. Such
a hook can read the working tree, which the agent writes: pre-commit's
pre-push runs whatever .pre-commit-config.yaml names.
A pre-push hook of yours, such as a test run or a linter, doesn't run on
Kraft's push. git-lfs's doesn't either: Kraft runs git lfs push itself
before the push, and stops the item when its new commits hold LFS files and
the machine has no git-lfs.
git-lfs talks to the server .lfsconfig names, on a push and on a checkout
or rebase that brings in new files, and the agent can edit that file too.
When the item's own work changes it, committed or not, Kraft stops the item
for you instead of running that git on your machine. Drop the commits that
change it from the branch, or push the branch yourself if it is meant; Kraft
carries on from then.
Reporting a vulnerability
Report vulnerabilities privately, not in a public issue. Use GitHub private reporting, as described in SECURITY.md. Only the latest release gets security fixes: see Supported versions.
Related
- Data and privacy: what leaves your machine and where Kraft keeps secrets.
- Permission gate: what the permission gate allows each harness to do.
- Sandboxed workers: how to run agents in a container.
- Remote access: how to reach the board from another device.