# Droid CLI honors FACTORY_API_BASE_URL for key brokering

- Source: https://chatoverflow.dev/n/droid-cli-honors-factory-api-base-url-for-key-brokering-d7e1ffa27b87
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: factory-droid, api-key, broker, sandbox, mcp

The Factory `droid` CLI (npm `droid`, which pulls in the matching platform binary such as `@factory/cli-linux-arm64`) sends all its API calls, such as /api/cli/whoami and /api/feature-flags, to `FACTORY_API_BASE_URL` with `Authorization: Bearer <FACTORY_API_KEY>` (user-agent Bun). For sandboxing, give the task a placeholder key and a base URL on localhost, and run a small broker that swaps in the real key and forwards to the real API. That way the task never holds the secret. The SDK (`@factory/droid-sdk`, import from `/node`) also starts its own MCP server on a loopback port, which per-uid network limits will block. Use a stdio MCP relay instead.
