Implement vector search and metadata filters
Jump & context
Week 3: Memory Security, Trajectory Ledger Contract, Supply-Chain SBOM & Vector Foundations
The five hours
- 01
Concepts & system design
60 min· read · map the mechanismR13 — Qdrant multitenancy & metadata filtering
R03 — OWASP API authorization
Read the assigned sections; map the mechanism, threat model and trade-offs.
- 02
Project implementation
120 min· build · integrate · debugImplement vector search with pre-retrieval metadata filtering (
tenant_id,allowed_roles,document_acl). Compare pre-filtering vs. post-filtering trade-offs.Build, integrate, debug and improve the increment in the active project.
- 03
Security lab
60 min· attack your own systemAttempt cross-tenant retrieval queries and verify zero unauthorized chunks are returned or leaked in similarity scores.
Test the abuse case, failure path, authorization bypass or resource limit.
- 04
Verification & evidence
30 min· test · record evidenceMulti-tenant retrieval ACL test matrix passing 100%.
Add or run regression tests; record the 9-point evidence record.
- 05
Deliberate practice & Socratic review
30 min· explain aloud · update gapsAnswer the 8 Socratic questions without notes: What? Why? How? What if? Why not? How can I prove it? Where can it break? What have I learned?
Re-explain the hardest concept aloud, inspect one edge case, update the gap log.
- total5 h
Read today · inside the concepts block
R03 R13BOLA (API1), Broken Auth (API2), Unrestricted Resource Consumption (API4), SSRF (API7), Misconfiguration (API8).
Collections, payload metadata indexing, pre-filtering, multitenancy partitioning, and snapshots.
Read only the named sections needed for today's task. Reading sits inside the 60-minute concepts block; it is not extra time.
Free resources for this day
5 curated- docsOWASP · risk chapterAPI1:2023 Broken Object Level Authorization - OWASP API Security Top 10
Frames object-level authorization as an ID-in-request trust failure, which is the same failure mode as a retrieval call that trusts a client-supplied tenant_id instead of deriving it server-side.
R03moved 2026-11-11 - articleQdrant Blog · technical articlePre-Filtering vs Post-Filtering (and Why Qdrant Does Neither)
Explains where post-filtering silently loses recall and how filterable HNSW evaluates payload conditions during graph traversal, the core trade-off the day asks you to measure.
R13R03checked 2026-11-11 - videoQdrant Vector Search · 5 minQdrant Essentials | Combine Search & Filtering with Qdrant Filterable HNSW
Shows the filterable-HNSW path choosing between pre-filtering via payload indexes and in-graph filtering depending on filter cardinality, exactly the decision your tenant_id/allowed_roles filter hits.
R13checked 2026-11-11 - videoAPIsec University · 38 minUnderstanding the #1 OWASP API vulnerability, Broken Object Level Authorization #cybersecurity.
Walks through real BOLA exploitation and the per-object authorization check that prevents it, the control your document_acl filter has to mirror server-side.
R03checked 2026-11-11 - labQdrant Documentation · hands-on exampleMultitenancy with Qdrant
Runnable payload-based partitioning example with per-tenant filtering, giving you the isolation pattern to test pre-retrieval filters against cross-tenant leakage.
R13checked 2026-11-11
Evidence record · 9-point standard
A lab is complete only when it produces evidence. Installing PyRIT, Garak, Presidio or TransformerLens is not completion. Saved on this device only.
Day notes
emptyThe two source formulations
verbatim · nothing summarisedProject & Stage Target
P2 | S4, S0
Core Implementation
Implement vector search with pre-retrieval metadata filtering (tenant_id, allowed_roles, document_acl). Compare pre-filtering vs. post-filtering trade-offs.
Security Lab
Attempt cross-tenant retrieval queries and verify zero unauthorized chunks are returned or leaked in similarity scores.
Verification & Evidence
Multi-tenant retrieval ACL test matrix passing 100%.
Read Today (60m Concepts Block)
R13 (Qdrant multitenancy & metadata filtering), R03 (OWASP API authorization).
---