Droid (Factory)
Wire KYA into Factory’s Droid so tool calls routed through MCP pass Shield’s evaluate first. Allow runs, Deny stops, Hold waits for a person.
Schema warning, up front: Droid’s on-disk MCP config format is not verified against a live install. The preferred path is Droid’s own CLI. Treat droid/mcp.example.json as a starting point, not as verified.
Setup - preferred: droid mcp add
droid mcp add shield-kya "npx --no-install @shield-agent/kya@0.35.8 serve-mcp --stdio" \
--env KYA_BASE_URL=https://shield-agent.com \
--env KYA_API_KEY=$KYA_API_KEY \
--env KYA_HOST=ide
This needs the package installed (npm i -g @shield-agent/kya); --no-install means no registry fetch at startup. No restart: Droid reloads automatically when its MCP config changes.
Setup - by hand (unverified)
The expected on-disk shape is ~/.factory/mcp.json (global) or .factory/mcp.json (project) with a standard mcpServers block; see the example. If droid mcp add wrote something different on your machine, trust what it wrote and tell us via an issue; the example gets corrected from real installs.
What KYA reports
Three tools: kya.policy_evaluate (Allow / Deny / Hold), kya.session_ingest, kya.request_approval. Calls land on the receipt with a clipped, redacted change preview: kya receipt --open.
Files written
droid mcp add writes Droid’s config itself (believed to be ~/.factory/mcp.json). KYA installs nothing else.
Verify
- Open Droid’s
/mcpmanager.shield-kyashould be listed. - Ask Droid for a small change; check the record (trail).
-
Offline smoke:
kya wrap --offline --tool-id Write --irreversible --args '{"path":"x.ts","content":"hi"}'Expect a
REQUIRE_APPROVErow in the record.
Uninstall
droid mcp remove shield-kya (or delete the block from the config file). Droid reloads on its own.
Troubleshooting
/mcpdoesn’t list shield-kya. Droid auto-reloadsmcp.json, so check which filedroid mcp addwrote (user level) versus the one you edited. If they differ, that is the schema drift the warning above is about.- Server fails to start. Install the package globally so
npx --no-installresolves without a fetch. KYA_API_KEYempty inside Droid. The--env KYA_API_KEY=$KYA_API_KEYflag copies the value at add time. Re-run the add command if the key rotated.- Empty record despite a listed server. Only MCP-routed calls reach KYA; see the honesty note.
Honesty note
Two honesty items, both deliberate. First: the on-disk schema is unverified, and this page says so rather than pretending otherwise. Second: Droid decides which tools go through MCP; anything native is outside the gate.
Wrap fallback
kya wrap --offline -- droid "triage the issue queue"
Wrap evaluates the command itself before it runs and records a row in the record. Exit 0 Allow, 4 Hold, 1 Deny.