Repository navigation
Features Security Sandboxing
Durable approvals, the password gate, share-link exposure, and what Kanna does not do.
Kanna runs agents on your machine with your credentials. This page is about what that means and which controls are real.
Plan-mode approvals and AskUserQuestion prompts are parked as durable
requests rather than in-memory promises. A pending request survives a server
restart (resolved fail-closed as session_closed on boot) and replays to the
browser on reconnect, so a question cannot silently strand a chat.
Set KANNA_MCP_TOOL_CALLBACKS=1 to route them, plus a set of built-in tool
shims, through that protocol. Optional KANNA_SERVER_SECRET stabilises request
ids across a process lifetime.
Requests time out after 600 s as an explicit deny — never as an approval.
kanna --password <secret> puts a password gate in front of the WebSocket and
every /api route. A browser signs in once and receives a kanna_session
cookie (HttpOnly, SameSite=Strict, Secure over https); the password itself
is never stored in the browser. Sessions last auth.sessionMaxAgeDays (default
30) and survive server restarts.
Sessions and the password hash are managed by Better Auth
in auth.db under the data directory, signed with a generated auth-secret
beside it; both files are readable only by your user. Repeated wrong passwords
are throttled: after three sign-in attempts in ten seconds the login answers
429 until the window passes. Starting Kanna with a different --password
signs every browser out.
The remote MCP server is served outside the cookie
gate because its clients cannot hold a browser cookie: /mcp and the OAuth
endpoints authenticate with a bearer token or the launch password instead, share
the same rate limiter, and answer 404 when no --password is set.
Use it for any instance reachable beyond localhost. Kanna does not terminate TLS — put it behind a reverse proxy or a Cloudflare tunnel (Self-host basics).
Every request passes one origin guard before any route runs, with or without a password. It stops a web page you happen to visit from driving Kanna through your browser:
-
/wsand/beacon. A browser always sends anOriginheader on a WebSocket upgrade. If it is present and is not this server's own origin, the upgrade answers403. Beacons and scripts send noOriginand are not affected. -
/apiwrites (POST,PUT,PATCH,DELETE). A browser that reportsSec-Fetch-Sitemust reportsame-origin(ornone); otherwise a presentOriginmust match. A request with a session cookie but neither header is refused. Reads such as downloads and share links are never blocked. -
Left to their own credentials. Webhooks (
/hooks/:id), the remote MCP server and its OAuth endpoints, beacon transfers and/auth/*skip the guard; each carries a secret or token, or checks the origin itself.
Without --password, Kanna on the default 127.0.0.1 bind also checks the
Host header and answers 403 unless it is 127.0.0.1, localhost or
[::1]. That defeats DNS rebinding, where a hostile site re-points its own name
at your loopback address. Open the app through one of those names; a LAN IP or
machine name needs --remote or --host.
--remote, --host and --share without --password are unprotected: the
Host check is off, and anyone who can reach the port can start agent turns that
run commands on your machine. Kanna still starts, and logs a warning. Set
--password for any instance reachable beyond your own machine.
A read-only share link is unauthenticated by design:
/share/:token is one of the only two paths that bypass the password gate, and
the 256-bit token in the URL is the entire credential. Treat a share URL as a
secret, and revoke it when you are done.
A beacon lets the agent read, and optionally run commands, on another machine you paired. Pairing is refused, and Kanna rejects every beacon connection, until a password is set. Each machine's scope is default-deny, every call outside what you pre-approved raises an approval prompt, and the beacon re-checks its own folders and command switch before it acts. Revoke a machine under Settings → Beacons and the agent loses access at once.
Kanna does not sandbox the agent process — it runs with your user's permissions and can read and write whatever you can. What it does give you is separation between concurrent agents: starting work on a board card puts that agent in its own git worktree on its own branch, so three agents working at once cannot touch each other's files.
If you need stronger isolation than your own user account:
- Run Kanna inside a dedicated VM or container with no host credential access.
- Keep plan mode and
AskUserQuestionrouted through the durable approval protocol above, so gates stay in your hands. - Give the agent a checkout it is allowed to break, not your only copy.
Claude OAuth tokens, custom MCP server credentials and OAuth state all live in
~/.kanna/data/settings.json, written with your default file mode, not 0600
(on a shared machine, chmod 700 ~/.kanna/data). Kanna stores nothing outside
~/.kanna, and sends credentials nowhere except the provider they belong to.
Back that file up as a secret, or exclude it from backups entirely.
-
No code upload. The agent runs locally as a
claude/codexsubprocess. Only the prompts and tool output you send reach a model. -
No remote control surface beyond a Cloudflare tunnel you approve per
expose_portcall,--share/--cloudflaredthat you pass yourself, or a beacon you install and pair on a machine of your own. - No credential storage outside
~/.kanna.
Telemetry is the one thing that leaves the machine by default: OpenTelemetry traces and metrics (turn timings, subagent runs, process memory — never prompt or code content) go to Kanna's collector. It is a single switch under Settings → General → Telemetry Tracing, and turning it off stops the export immediately.
This wiki is generated from wiki/src/content/docs in cuongtranba/kanna.
Edit the docs there: changes made on this wiki are overwritten on the next sync.
The same docs are published at https://kanna-wiki.lowbit.link.
Getting Started
Features
- Providers & Models
- Chat & Transcript
- Generative UI
- Projects & Sessions
- Boards
- Multi-repo Stacks
- Slash Commands
- Cron Jobs
- Loops
- Beacons
- Kanna Plugins
- Package Auto-Update
- Advanced
- Security
Guides
- User Guide
- Contributing
- Ops & Self-Host
Sharing
Reference