Kilo Code CLI
Wire KYA into Kilo Code so tool calls the agent routes through Shield’s MCP gate pass Shield’s evaluate first and are recorded. Kilo Code’s built-in tools do not go through the gate and are not evaluated or recorded. Allow runs, Deny stops, Hold waits for a person.
Setup
kya connect kilo
That writes a shield-kya entry into ~/.config/kilo/kilo.json under the mcp key, using Kilo’s local-server shape (type: "local", a command array, an environment map). For a per-project setup instead:
kya connect kilo --project # writes ./kilo.json
Restart Kilo after connecting. MCP servers load at startup.
Prefer editing by hand? Copy kilo/kilo.example.json into place and merge the mcp section yourself.
What KYA reports
Each tool call Kilo routes through Shield’s MCP gate lands on the receipt: tool id, decision (Allow / Deny / Hold), timestamp, and a clipped, redacted preview of what would change. Open it with kya receipt --open, or check the MCP server list in Kilo’s settings.
Files written
| Scope | Path |
|---|---|
| Global | ~/.config/kilo/kilo.json |
| Project | ./kilo.json |
Connect merges. Your other MCP servers and settings stay as they were. If the existing file doesn’t parse as JSON, connect stops and tells you. It never overwrites a config it cannot read.
Verify
- Restart Kilo.
- Ask the agent to list its MCP tools.
kya.policy_evaluate,kya.session_ingest,kya.request_approvalshould appear. -
Offline smoke, no cloud needed:
kya wrap --offline --tool-id Write --irreversible --args '{"path":"x.ts","content":"hi"}'Expect a
REQUIRE_APPROVErow in the record (trail) (--irreversiblewithout a policy never auto-allows).
Uninstall
Edit ~/.config/kilo/kilo.json and delete the shield-kya entry under mcp. Nothing else is installed: no daemon, no background process. (kya connect kilo --force rewires the entry if you only want to refresh it.)
Troubleshooting
- Server not listed in Kilo. Restart Kilo. MCP servers load at startup, not hot.
command not founderrors. Connect wiresnode …/cli.js serve-mcp --stdiofrom the install you ran it from. If you connected via a tempnpxcache and later cleared it, rerunkya connect kilo --forcefrom a real install (npm i -g @shield-agent/kya).- Tools silently bypass the gate. KYA only sees calls that go through MCP. A tool Kilo runs natively without MCP never reaches evaluate; see the honesty note below.
- Decisions need a key. The wired env sets
KYA_OFFLINE=1, so the server starts keyless and sample-evaluates. Against an authenticated control plane, setKYA_API_KEYin the entry’senvironmentblock.
Honesty note
Kilo decides which tools go through MCP. KYA gates the ones that do. A tool Kilo executes outside MCP is outside the gate. Do not treat this setup as full coverage of the agent.
Wrap fallback
Works with or without MCP:
kya wrap --offline -- kilo run "refactor src/"
Wrap evaluates the command itself before it runs and records a row in the record. Use it for hosts, shells, or scripts that never speak MCP.