🔐 Kilo Code Security — Permissions, Sandbox & Hardening
A coding agent runs with your permissions. It reads your repository, edits files and runs shell commands. Kilo gives you two layers of control on top: permission rules that decide what runs automatically, what asks and what's blocked, and an optional operating-system sandbox that limits where commands can write and whether they can reach the network.
The previous version called Kilo Apache-2.0 (the project is MIT) and said prompts route through OpenRouter by default. Everything below is checked against Kilo's own documentation.
1. Permission rules: allow, ask, deny
{
"$schema": "https://app.kilo.ai/config.json",
"permission": {
"*": "ask",
"read": "allow",
"bash": { "*": "ask", "git status *": "allow", "rm *": "deny" },
"edit": { "*": "ask", "*.md": "allow" }
}
}
- The last matching rule wins. Put the catch-all
"*"first and exceptions after it. A catch-all placed last overrides everything before it. - Wildcards:
*and?;~and$HOMEexpand. Useexternal_directoryrules for paths outside the project. - The same rules can be set per agent in Markdown agent files, which is how you give a review-only agent no edit rights. JetBrains and VS Code have an Auto-Approve settings screen for the same thing.
2. The sandbox (off by default)
// ~/.config/kilo/kilo.jsonc
{
"sandbox": {
"enabled": true,
"network": "deny",
"allowed_hosts": ["github.com:443", "api.github.com:443"],
"writable_paths": ["~/shared-output"]
}
}
- It limits writes to allowed locations and blocks outbound network from model-originated commands, except the hosts you list. It doesn't limit reads: the agent can still read anything your account can.
- macOS and Linux only; not available on Windows. If a policy can't be enforced, Kilo refuses to run the tool rather than falling back silently.
- Only global config can add hosts or writable paths. A project config can tighten the sandbox but not loosen it, so a cloned repository can't open itself up.
- Turn it on when running unfamiliar commands, installing dependencies, working in an untrusted repository, or handling content that could carry prompt injection.
3. Where your code and prompts go
- Kilo Gateway (when signed in): requests go through Kilo to the model provider.
- BYOK / direct providers: to the provider you configured. Log out of the Gateway to make sure nothing routes through Kilo.
kilo-auto/freeand free models may log your prompts, including NVIDIA's free trial endpoints. Don't use them on confidential code.- Background tasks (titles, commit messages) use the small model, which may go through the Gateway unless you set
small_modelon your own provider.
Hardening checklist
- Set
"permission": { "*": "ask" }globally and allow-list only routine commands (git status *, your test runner). - Deny destructive commands explicitly (
rm *,git push --force*). - Enable the sandbox on macOS/Linux with
network: "deny"and only the hosts you need. - Keep keys in environment variables (
{env:VAR}), never in a projectkilo.jsoncyou commit. - Avoid Auto Free and free models on proprietary code.
- Review what cloud agents and Slack can reach: they act on connected repositories and can open pull requests.
- Update deliberately. Pin a version by installing a
.vsixand disabling auto-update if you need to control it.
Source is public at github.com/Kilo-Org/kilocode (MIT). Cross-platform guidance: Security centre.
Sources: Kilo Code documentation, kilo.ai/pricing and Kilo-Org/kilocode releases (v7.8.1, 2026-09-25). Checked 2026-09-27.
← Back to the Kilo Code hub