Skip to content

feat: add QDRANT_ALLOW_COLLECTIONS allowlist for least-privilege access - #166

Open
royalpinto007 wants to merge 1 commit into
qdrant:masterfrom
royalpinto007:feat/collection-allowlist
Open

feat: add QDRANT_ALLOW_COLLECTIONS allowlist for least-privilege access#166
royalpinto007 wants to merge 1 commit into
qdrant:masterfrom
royalpinto007:feat/collection-allowlist

Conversation

@royalpinto007

Copy link
Copy Markdown

Problem

When no fixed COLLECTION_NAME is configured, the qdrant-store and qdrant-find tools accept an arbitrary collection_name. That means an agent (or a prompt-injection reaching the model) can read from or write to any collection in the connected Qdrant instance. For anyone pointing this server at a shared or production Qdrant, that is a least-privilege gap. It is also the surface raised in the security discussions in #115 and #141.

Change

Add an optional QDRANT_ALLOW_COLLECTIONS env var: a comma-separated allowlist of collections the tools may touch. It is enforced in QdrantConnector, at both store() and search(), before the request reaches Qdrant. Any access to a collection outside the list raises a clear error.

  • Backward compatible: unset means all collections are allowed, so existing deployments are unaffected.
  • Mirrors the existing QDRANT_READ_ONLY scoping control.
  • Defense-in-depth: complements Qdrant's own API-key/JWT scoping by making a safe default trivial to configure at the tool boundary, where the MCP server typically holds a single broad key.

Tests

Added tests/test_collection_allowlist.py (CSV parsing, disallowed access rejected, allowed access works, no-allowlist stays unrestricted). Full suite passes (29 passed), lint/format clean.

Addresses the least-privilege concerns in #115 and #141.

The store and find tools accept an arbitrary collection_name, so an agent can
read or write any collection in the connected Qdrant instance. Add an optional
QDRANT_ALLOW_COLLECTIONS allowlist, enforced in the connector: when set, any
access to a collection outside the list is rejected before it reaches Qdrant.
Unset keeps the current behavior (all collections allowed), so existing
deployments are unaffected.

Addresses the least-privilege concerns raised in qdrant#115 and qdrant#141.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant