Security
colabhive-mcp is the bridge between your AI agent and ColabHive's full model catalog. Treat its config like a credential file — because it is one.
Threat model
| Threat | Likelihood | Impact | Mitigation |
|---|---|---|---|
| API key leak from client config | Medium | High | F2 OAuth + keychain (planned); detect & warn on plaintext keys in known config paths |
| Prompt-injection makes agent call destructive tool | High | High | Manifest sideEffects + annotations.destructive — host filters or asks user |
| Rate-limit abuse drives up cost | Medium | High | Infrastructure rate limits; dedicated keys; COLABHIVE_DENY_TOOLS client-side |
| Trained model from account A exposed to account B | Low | Critical | Visibility rules inherited from Actions API; hosted mode: SHA-256-keyed per-tenant pool; auth-scoped manifest endpoint |
| Cross-tenant data leak on hosted endpoint | Low | Critical | Each tenant has an isolated ColabHiveMCPServer and ManifestCache. Map key is SHA-256(api_key)[:16]; raw key never logged. |
| MITM between MCP server and ColabHive | Low | High | TLS-only to api.colabhive.com |
| MCP server crashes mid-call → client locks up | Medium | Medium | Structured exit codes + client retries; logs to stderr; systemd restart on host |
| Replay attack on mutating tool | Low | High | F4 HMAC + nonce + timestamp on sideEffects: ["mutating"] tools (planned) |
| Stale manifest serves removed tool | Low | Low | ETag refresh on tools/list; deprecation warnings surfaced to agent |
Auth
Hosted mode — header passthrough (live)
Every request to mcp.colabhive.com/mcp must carry an API key in one of:
Authorization: Bearer hive_xxx
# or
X-API-Key: hive_xxx
The server does not have a master key. The request's key is what's used downstream. If it's missing or invalid, the server returns 401. If it's valid but lacks visibility on a tool, that tool simply isn't in the response.
This is the same model as every other ColabHive API call. There's no separate "MCP key" — your existing hive_... works.
Local stdio mode (live)
export COLABHIVE_API_KEY=hive_xxx
uvx colabhive-mcp@latest
Or via --api-key flag, or ~/.config/colabhive-mcp/config.toml.
The key never leaves your machine except to api.colabhive.com for inference calls.
OAuth 2.1 device flow (planned, F2)
Will let you do:
colabhive-mcp login
# Open https://colabhive.com/auth/device, enter code ABCD-1234
Tokens stored in the OS keychain (macOS Keychain, libsecret on Linux, DPAPI on Windows). access_token 1h, refresh_token 30d, automatic renewal. Revocable per-client.
Best practices for API keys (both modes)
- Use one key per agent or machine. Granular scopes are stored but are not enforced yet; a dedicated key still gives you independent rotation and revocation.
- Never commit keys. Add
*.mcp.jsonandcolabhive-mcp/config.tomlto.gitignore. - Rotate quarterly. Set a calendar reminder.
- One key, one machine. If a laptop is lost, revoke that key.
What the hosted server stores
| Item | Stored? | Retention |
|---|---|---|
| API keys (raw or hashed) | No | n/a — only kept in-process memory while the tenant is in the LRU pool |
| Prompts / tool inputs | No | n/a |
| Tool outputs | No | n/a |
| Tool calls (logs) | Structured logs only (see Logging) | Per your log retention |
| Tenant manifest cache | Yes — in memory only | Until LRU eviction (typically minutes) |
Logs record, per tool call: timestamp, sha-prefix of the api_key, slug, status, and latency. They do not record arguments or outputs.
Network surface
Hosted endpoint
mcp.colabhive.com:443 (TLS via Let's Encrypt, Cloudflare in front).
Open routes:
GET /health— no auth required, returns liveness JSONPOST /mcp— JSON-RPC, requires API keyGET /mcp— SSE keep-alive channel, requires API keyPOST /admin/manifest/refresh— force-refresh tenant's cache, requires API key
Local stdio mode
The default. The server does not open any inbound port — it communicates over stdin/stdout with the MCP client that launched it.
Local HTTP mode
colabhive-mcp serve --host 127.0.0.1 --port 8765
Binds only to 127.0.0.1 by default. Override with --host 0.0.0.0 only if you understand the implications — the server prints a clear warning in that case.
Side-effects enforcement
Tools declare side-effects in their manifest (see Manifests). The agent host can:
- Auto-deny classes of tools — e.g. reject all
mutatingin a "safe browse" session. - Confirm with user before
annotations.destructive: trueorsideEffects: ["mutating"]. - Surface warnings when calling
piitools.
In local stdio mode, colabhive-mcp enforces an additional client-side allow/deny:
export COLABHIVE_DENY_TOOLS="web-*"
# or
colabhive-mcp --deny-side-effects=mutating,destructive
Hosted mode does not provide an equivalent per-tool deny today. API-key scopes are visible in the Console but are not enforced by the Builder API yet. Use a dedicated key for revocation and choose local stdio when a client-side tool allow/deny policy is required.
Rate limiting
api.colabhive.com enforces per-account limits. Hosted MCP just propagates them; on 429, the server translates into an MCP error with the original Retry-After hint, and the agent should back off.
| Bucket | Default |
|---|---|
| API and invocation limits | Enforced at the infrastructure layer; public per-plan tiers are not yet published |
| Manifest fetches | Subject to infrastructure limits; no separate public tier is guaranteed |
| Cost ceilings | Deployment-specific; not a general public-plan promise |
Client-side ratchet (local stdio only, today):
colabhive-mcp serve --max-calls-per-minute 20
Logging
The MCP server emits structured logs only — there is no separate audit API and no audit database table. Each tool call produces one structured log line via the server's logger:
mcp.tool.invoked slug=qwen-2.5-7b-instruct-public status=succeeded latency_ms=287
The record carries the timestamp, a SHA prefix of the API key (never the raw key), the tool slug,
status, and latency — not the arguments or the model output. In local stdio mode these go to
stderr (control with COLABHIVE_LOG_LEVEL / COLABHIVE_LOG_FORMAT); in hosted mode they are
structured JSON logs (see Architecture → Observability).
For usage, billing, and per-account activity, use console.colabhive.com. Prometheus metrics for
tool calls / latency / errors are on the roadmap (not emitted today).
Data residency
For each tool call via MCP:
- Input travels: your machine → (hosted) → ColabHive API → node runtime → model container.
- Output flows back the same way.
- No payload is persisted in MCP-layer infrastructure.
- Trained model artifacts stay in your account's MinIO bucket (SSE-S3 encrypted at rest).
In hosted mode the only extra hop vs Actions API is mcp.colabhive.com itself, which is operated by ColabHive (same data residency policy as the rest of the platform).
Reporting a vulnerability
Found a security issue? Do not file a GitHub issue. Email security@colabhive.com with:
- Reproduction steps
- Affected versions
- Suggested severity (CVSS if you can estimate)
We respond within 24 h, fix-or-mitigate within 7 d for High/Critical.
Hardening checklist
For production / enterprise deployments:
Hosted
- Use a dedicated API key for the MCP integration (not your main key); scopes are not an enforcement boundary yet
- Agree deployment-specific usage and cost limits where required
- Enable audit log retention ≥ 90 days
- Rotate the key quarterly
Local stdio
- All of the above
- Use OAuth (F2) once available
- Set
COLABHIVE_STABILITY=stableto exclude beta tools - Set
COLABHIVE_DENY_TOOLSfor tools withmutating/destructiveside-effects you don't need - Pin a manifest snapshot via
--manifest-pin <etag> - Run the local server as a non-root user with no shell
- Pin certs with
--cert-pin sha256:...if you operate inside a strict egress proxy
See also
- Configuration
- Manifests — side-effect declarations
- Architecture — hosted topology + per-tenant pool