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

  1. Open Droid’s /mcp manager. shield-kya should be listed.
  2. Ask Droid for a small change; check the record (trail).
  3. Offline smoke:

    kya wrap --offline --tool-id Write --irreversible --args '{"path":"x.ts","content":"hi"}'
    

    Expect a REQUIRE_APPROVE row in the record.

Uninstall

droid mcp remove shield-kya (or delete the block from the config file). Droid reloads on its own.

Troubleshooting

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.