[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B51C6Z93FCPMF7Y4D1GHKW":3,"skill-same:01M7B51C6Z93FCPMF7Y4D1GHKW":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":13,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M7B51C6Z93FCPMF7Y4D1GHKW","assessing-vector-and-embedding-weaknesses",null,"Test RAG vector stores (Pinecone, Qdrant, Weaviate, Chroma, pgvector, FAISS) for embedding inversion, cross-tenant data leakage, and data poisoning per OWASP LLM08:2025. Use when performing an authorized security assessment of a RAG pipeline's retrieval layer or auditing multi-tenant vector-store isolation.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: assessing-vector-and-embedding-weaknesses\ndescription: Test RAG vector stores (Pinecone, Qdrant, Weaviate, Chroma, pgvector,\n  FAISS) for embedding inversion, cross-tenant data leakage, and data poisoning per\n  OWASP LLM08:2025. Use when performing an authorized security assessment of a RAG\n  pipeline's retrieval layer or auditing multi-tenant vector-store isolation.\ndomain: cybersecurity\nsubdomain: ai-security\ntags:\n- ai-security\n- vector-database\n- embedding-inversion\n- rag-security\n- owasp-llm08\n- multi-tenant-isolation\n- data-poisoning\n- retrieval-augmented-generation\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_ai_rmf:\n- MEASURE-2.7\natlas_techniques:\n- AML.T0024\n---\n# Assessing Vector and Embedding Weaknesses\n\n> **Authorized use only:** These tests interact with vector stores and embedding models in RAG systems you own or are authorized to assess. Embedding inversion and cross-tenant probing against systems you do not control may expose third-party data and is prohibited without authorization.\n\n## Overview\n\nRetrieval-Augmented Generation (RAG) systems convert documents into embedding vectors stored in a vector database (Pinecone, Qdrant, Weaviate, Chroma, pgvector, FAISS) and retrieve the nearest vectors to ground LLM responses. OWASP **LLM08:2025 Vector and Embedding Weaknesses** covers the security risks unique to this layer:\n\n- **Embedding inversion** — embeddings are not one-way. A trained inversion model (or a black-box reconstruction attack) can recover substantial portions of the original text from its vector, leaking source documents (maps to MITRE ATLAS **AML.T0024.001 Invert ML Model**).\n- **Membership inference** — querying whether a specific record contributed to the corpus (AML.T0024.000).\n- **Cross-tenant \u002F multi-tenant leakage** — when one namespace\u002Fcollection is shared or filter isolation is missing, a tenant retrieves another tenant's chunks.\n- **Knowledge-base poisoning** — an attacker who can write to the corpus inserts crafted chunks that dominate retrieval (high cosine similarity to expected queries) and carry indirect prompt-injection payloads.\n- **Retrieval manipulation** — adversarial documents tuned to be retrieved for many unrelated queries (\"retrieval hijacking\").\n\nThe parent technique is **AML.T0024 — Exfiltration via ML Inference API**: an attacker uses legitimate inference\u002Fquery access to exfiltrate data (source text via inversion, membership, or model extraction). This skill provides a repeatable assessment of all five weakness classes.\n\n## When to Use\n\n- During a security assessment of any RAG \u002F vector-search application (OWASP LLM08 coverage).\n- When a vector store is multi-tenant and you must prove namespace\u002Fmetadata isolation.\n- When the corpus accepts user-supplied or third-party documents (poisoning surface).\n- When the embedding endpoint is externally reachable (inversion\u002Fmembership surface).\n- When validating retrieval-filtering controls before go-live.\n\n## Prerequisites\n\n- Authorization and scope covering the target embedding endpoint and vector store.\n- Python 3.10+.\n- Read (and, for poisoning tests, write) access to a test collection — never the production corpus.\n\n```bash\n# Vector DB clients + embeddings + similarity tooling\npython -m pip install numpy scikit-learn sentence-transformers\npython -m pip install qdrant-client chromadb pinecone-client weaviate-client\n# (optional) text-embedding inversion research baseline\npython -m pip install vec2text\n```\n\n## Objectives\n\n- Measure embedding-inversion exposure on the target embedding model.\n- Run a membership-inference probe against the corpus.\n- Test multi-tenant isolation (namespace, metadata filter, RBAC) for cross-tenant leakage.\n- Inject benign poisoned chunks into a *test* collection and measure retrieval dominance.\n- Detect indirect prompt-injection content surviving in retrieved chunks.\n- Recommend controls: tenant-scoped filters, content validation, embedding-access limits.\n\n## MITRE ATT&CK Mapping\n\n| ID | Tactic | Official Technique Name | Role in this skill |\n|----|--------|-------------------------|--------------------|\n| AML.T0024 | ATLAS: Exfiltration | Exfiltration via ML Inference API | Using query\u002Fembedding access to exfiltrate source data |\n| AML.T0024.000 | ATLAS: Exfiltration | Infer Training Data Membership | Membership-inference probe against the corpus |\n| AML.T0024.001 | ATLAS: Exfiltration | Invert ML Model | Embedding-inversion reconstruction of source text |\n| AML.T0020 | ATLAS: Resource Development | Poison Training Data | Knowledge-base poisoning of the corpus |\n| AML.T0051.001 | ATLAS: Initial Access | LLM Prompt Injection: Indirect | Injection payloads embedded in retrieved chunks |\n\n## Workflow\n\n### Step 1: Inventory the RAG pipeline\n\nDocument the embedding model + dimensions, the vector store and its tenancy model, the chunking strategy, retrieval `top_k` and similarity metric (cosine\u002Fdot\u002FL2), and any metadata filters applied at query time.\n\n```python\n# Example: inspect a Qdrant collection\nfrom qdrant_client import QdrantClient\nclient = QdrantClient(url=\"http:\u002F\u002Flocalhost:6333\")\ninfo = client.get_collection(\"docs\")\nprint(info.config.params.vectors)   # size + distance metric\nprint(client.count(\"docs\"))         # corpus size\n```\n\n### Step 2: Test embedding-inversion exposure\n\nEmbeddings of similar text are close; an attacker with the embedding endpoint can iteratively reconstruct text whose embedding matches a target vector. Measure how much a nearest-neighbour-in-embedding-space recovers, using cosine similarity between candidate reconstructions and the target.\n\n```python\nimport numpy as np\nfrom sentence_transformers import SentenceTransformer\nfrom sklearn.metrics.pairwise import cosine_similarity\n\nmodel = SentenceTransformer(\"all-MiniLM-L6-v2\")\nsecret = \"Patient John Doe, MRN 553120, diagnosed with hypertension.\"\ntarget_vec = model.encode([secret])\n\n# Attacker has only target_vec and the embedding endpoint. Hill-climb candidate text.\ncandidates = [\n    \"Patient name and medical record number with a diagnosis.\",\n    \"John Doe medical record hypertension diagnosis\",\n    \"Patient John Doe MRN diagnosed hypertension\",\n]\ncand_vecs = model.encode(candidates)\nsims = cosine_similarity(target_vec, cand_vecs)[0]\nfor c, s in sorted(zip(candidates, sims), key=lambda x: -x[1]):\n    print(f\"{s:.3f}  {c}\")\n# High similarity for a near-verbatim guess => inversion risk is real for this model.\n```\n\nFor a research-grade reconstruction baseline, `vec2text` can be used against compatible embedding models to demonstrate full-text recovery.\n\n### Step 3: Membership inference\n\nDetermine whether a specific document is in the corpus by measuring the top-1 retrieval similarity for an exact-quote query: in-corpus items return a markedly higher max similarity than out-of-corpus controls.\n\n```python\ndef membership_score(client, collection, embed, text):\n    vec = embed([text])[0].tolist()\n    hits = client.search(collection_name=collection, query_vector=vec, limit=1)\n    return hits[0].score if hits else 0.0\n\nin_corpus = membership_score(client, \"docs\", model.encode, \"\u003Cexact quote from a known chunk>\")\ncontrol  = membership_score(client, \"docs\", model.encode, \"An unrelated random sentence.\")\nprint(f\"in-corpus={in_corpus:.3f}  control={control:.3f}  delta={in_corpus-control:.3f}\")\n# A large positive delta indicates the item is in the corpus (membership leak).\n```\n\n### Step 4: Test multi-tenant isolation\n\nConfirm that tenant B cannot retrieve tenant A's chunks. Issue tenant-B-authenticated queries that *should* be filtered, and verify no tenant-A `tenant_id` appears in results.\n\n```python\n# Query as tenant B; expect ONLY tenant_id == \"B\" results.\nfrom qdrant_client.models import Filter, FieldCondition, MatchValue\n\nvec = model.encode([\"confidential salary information\"])[0].tolist()\nhits = client.search(\n    collection_name=\"docs\",\n    query_vector=vec,\n    limit=10,\n    query_filter=Filter(must=[FieldCondition(key=\"tenant_id\", match=MatchValue(value=\"B\"))]),\n)\nleaked = [h for h in hits if h.payload.get(\"tenant_id\") != \"B\"]\nprint(\"CROSS-TENANT LEAK\" if leaked else \"isolation OK\", \"->\", len(leaked), \"foreign rows\")\n\n# Critical test: repeat WITHOUT the filter to confirm the server, not the client,\n# enforces isolation. If unfiltered queries return tenant A data, isolation is client-side only.\nhits_nofilter = client.search(collection_name=\"docs\", query_vector=vec, limit=10)\nprint(\"server-side isolation FAILS\" if any(h.payload.get(\"tenant_id\") != \"B\" for h in hits_nofilter) else \"OK\")\n```\n\n### Step 5: Knowledge-base poisoning (test collection only)\n\nInsert a benign poisoned chunk crafted to be retrieved for many unrelated queries, then measure how often it appears in `top_k`.\n\n```python\nfrom qdrant_client.models import PointStruct\n\n# Benign marker payload (no real injection) to measure retrieval dominance.\npoison = \"POISON-CANARY. \" + \" \".join(\n    [\"password reset billing refund account login support error help\"] * 8\n)\nclient.upsert(\"docs_test\", points=[\n    PointStruct(id=999999, vector=model.encode([poison])[0].tolist(),\n                payload={\"tenant_id\": \"B\", \"source\": \"poison-test\"})\n])\n\nqueries = [\"how do I get a refund\", \"reset my password\", \"what is the weather\"]\nfor q in queries:\n    hits = client.search(\"docs_test\", model.encode([q])[0].tolist(), limit=5)\n    dominated = any(h.payload.get(\"source\") == \"poison-test\" for h in hits)\n    print(f\"{'POISON in top5' if dominated else 'clean'}: {q}\")\n```\n\n### Step 6: Detect indirect prompt injection in retrieved chunks\n\nScan retrieved chunk text for injection markers before it is concatenated into the prompt.\n\n```python\nimport re\nINJECTION_PATTERNS = [\n    r\"ignore (all|previous|the above) instructions\",\n    r\"system prompt\", r\"you are now\", r\"disregard\", r\"\u003C\u002F?(system|instructions)>\",\n]\ndef chunk_is_injection(text):\n    low = text.lower()\n    return [p for p in INJECTION_PATTERNS if re.search(p, low)]\n\nfor hit in client.search(\"docs\", model.encode([\"help\"])[0].tolist(), limit=10):\n    flags = chunk_is_injection(hit.payload.get(\"text\", \"\"))\n    if flags:\n        print(\"INDIRECT INJECTION in chunk\", hit.id, flags)\n```\n\n### Step 7: Report and remediate\n\n- **Inversion\u002Fmembership:** rate-limit and authenticate the embedding endpoint; avoid returning raw similarity scores; restrict who can query embeddings.\n- **Cross-tenant:** enforce tenant filters server-side (separate collections\u002Fnamespaces per tenant where feasible); never rely on client-supplied filters.\n- **Poisoning:** validate and provenance-tag every ingested chunk; scan inputs for injection; cap any single source's share of retrieval.\n- **Indirect injection:** sanitize retrieved chunks and apply output guardrails (see `defending-llms-with-guardrails`).\n\n## Tools and Resources\n\n| Tool | Purpose | Primary Source |\n|------|---------|----------------|\n| OWASP LLM08 | Vector and Embedding Weaknesses guidance | https:\u002F\u002Fgenai.owasp.org\u002Fllmrisk\u002Fllm082025-vector-and-embedding-weaknesses\u002F |\n| sentence-transformers | Embedding generation for testing | https:\u002F\u002Fwww.sbert.net\u002F |\n| Qdrant client | Vector store + filtered search | https:\u002F\u002Fqdrant.tech\u002Fdocumentation\u002F |\n| Chroma \u002F Weaviate \u002F Pinecone | Alternative vector stores | https:\u002F\u002Fdocs.trychroma.com\u002F |\n| vec2text | Embedding-inversion research baseline | https:\u002F\u002Fgithub.com\u002Fjxmorris12\u002Fvec2text |\n| MITRE ATLAS | AML.T0024 Exfiltration via ML Inference API | https:\u002F\u002Fatlas.mitre.org\u002F |\n\n## Validation Criteria\n\n- [ ] RAG pipeline inventoried (embedding model, store, tenancy, metric, top_k, filters).\n- [ ] Embedding-inversion exposure measured and rated.\n- [ ] Membership-inference delta computed for in-corpus vs control items.\n- [ ] Multi-tenant isolation tested both with and without client filters (server-side enforcement confirmed).\n- [ ] Poisoning dominance measured in a test collection only.\n- [ ] Retrieved chunks scanned for indirect-injection content.\n- [ ] Findings reported with remediation for each weakness class.\n- [ ] No production corpus modified during the assessment.\n","# Assessing Vector and Embedding Weaknesses\n\n> **Authorized use only:** These tests interact with vector stores and embedding models in RAG systems you own or are authorized to assess. Embedding inversion and cross-tenant probing against systems you do not control may expose third-party data and is prohibited without authorization.\n\n## Overview\n\nRetrieval-Augmented Generation (RAG) systems convert documents into embedding vectors stored in a vector database (Pinecone, Qdrant, Weaviate, Chroma, pgvector, FAISS) and retrieve the nearest vectors to ground LLM responses. OWASP **LLM08:2025 Vector and Embedding Weaknesses** covers the security risks unique to this layer:\n\n- **Embedding inversion** — embeddings are not one-way. A trained inversion model (or a black-box reconstruction attack) can recover substantial portions of the original text from its vector, leaking source documents (maps to MITRE ATLAS **AML.T0024.001 Invert ML Model**).\n- **Membership inference** — querying whether a specific record contributed to the corpus (AML.T0024.000).\n- **Cross-tenant \u002F multi-tenant leakage** — when one namespace\u002Fcollection is shared or filter isolation is missing, a tenant retrieves another tenant's chunks.\n- **Knowledge-base poisoning** — an attacker who can write to the corpus inserts crafted chunks that dominate retrieval (high cosine similarity to expected queries) and carry indirect prompt-injection payloads.\n- **Retrieval manipulation** — adversarial documents tuned to be retrieved for many unrelated queries (\"retrieval hijacking\").\n\nThe parent technique is **AML.T0024 — Exfiltration via ML Inference API**: an attacker uses legitimate inference\u002Fquery access to exfiltrate data (source text via inversion, membership, or model extraction). This skill provides a repeatable assessment of all five weakness classes.\n\n## When to Use\n\n- During a security assessment of any RAG \u002F vector-search application (OWASP LLM08 coverage).\n- When a vector store is multi-tenant and you must prove namespace\u002Fmetadata isolation.\n- When the corpus accepts user-supplied or third-party documents (poisoning surface).\n- When the embedding endpoint is externally reachable (inversion\u002Fmembership surface).\n- When validating retrieval-filtering controls before go-live.\n\n## Prerequisites\n\n- Authorization and scope covering the target embedding endpoint and vector store.\n- Python 3.10+.\n- Read (and, for poisoning tests, write) access to a test collection — never the production corpus.\n\n```bash\n# Vector DB clients + embeddings + similarity tooling\npython -m pip install numpy scikit-learn sentence-transformers\npython -m pip install qdrant-client chromadb pinecone-client weaviate-client\n# (optional) text-embedding inversion research baseline\npython -m pip install vec2text\n```\n\n## Objectives\n\n- Measure embedding-inversion exposure on the target embedding model.\n- Run a membership-inference probe against the corpus.\n- Test multi-tenant isolation (namespace, metadata filter, RBAC) for cross-tenant leakage.\n- Inject benign poisoned chunks into a *test* collection and measure retrieval dominance.\n- Detect indirect prompt-injection content surviving in retrieved chunks.\n- Recommend controls: tenant-scoped filters, content validation, embedding-access limits.\n\n## MITRE ATT&CK Mapping\n\n| ID | Tactic | Official Technique Name | Role in this skill |\n|----|--------|-------------------------|--------------------|\n| AML.T0024 | ATLAS: Exfiltration | Exfiltration via ML Inference API | Using query\u002Fembedding access to exfiltrate source data |\n| AML.T0024.000 | ATLAS: Exfiltration | Infer Training Data Membership | Membership-inference probe against the corpus |\n| AML.T0024.001 | ATLAS: Exfiltration | Invert ML Model | Embedding-inversion reconstruction of source text |\n| AML.T0020 | ATLAS: Resource Development | Poison Training Data | Knowledge-base poisoning of the corpus |\n| AML.T0051.001 | ATLAS: Initial Access | LLM Prompt Injection: Indirect | Injection payloads embedded in retrieved chunks |\n\n## Workflow\n\n### Step 1: Inventory the RAG pipeline\n\nDocument the embedding model + dimensions, the vector store and its tenancy model, the chunking strategy, retrieval `top_k` and similarity metric (cosine\u002Fdot\u002FL2), and any metadata filters applied at query time.\n\n```python\n# Example: inspect a Qdrant collection\nfrom qdrant_client import QdrantClient\nclient = QdrantClient(url=\"http:\u002F\u002Flocalhost:6333\")\ninfo = client.get_collection(\"docs\")\nprint(info.config.params.vectors)   # size + distance metric\nprint(client.count(\"docs\"))         # corpus size\n```\n\n### Step 2: Test embedding-inversion exposure\n\nEmbeddings of similar text are close; an attacker with the embedding endpoint can iteratively reconstruct text whose embedding matches a target vector. Measure how much a nearest-neighbour-in-embedding-space recovers, using cosine similarity between candidate reconstructions and the target.\n\n```python\nimport numpy as np\nfrom sentence_transformers import SentenceTransformer\nfrom sklearn.metrics.pairwise import cosine_similarity\n\nmodel = SentenceTransformer(\"all-MiniLM-L6-v2\")\nsecret = \"Patient John Doe, MRN 553120, diagnosed with hypertension.\"\ntarget_vec = model.encode([secret])\n\n# Attacker has only target_vec and the embedding endpoint. Hill-climb candidate text.\ncandidates = [\n    \"Patient name and medical record number with a diagnosis.\",\n    \"John Doe medical record hypertension diagnosis\",\n    \"Patient John Doe MRN diagnosed hypertension\",\n]\ncand_vecs = model.encode(candidates)\nsims = cosine_similarity(target_vec, cand_vecs)[0]\nfor c, s in sorted(zip(candidates, sims), key=lambda x: -x[1]):\n    print(f\"{s:.3f}  {c}\")\n# High similarity for a near-verbatim guess => inversion risk is real for this model.\n```\n\nFor a research-grade reconstruction baseline, `vec2text` can be used against compatible embedding models to demonstrate full-text recovery.\n\n### Step 3: Membership inference\n\nDetermine whether a specific document is in the corpus by measuring the top-1 retrieval similarity for an exact-quote query: in-corpus items return a markedly higher max similarity than out-of-corpus controls.\n\n```python\ndef membership_score(client, collection, embed, text):\n    vec = embed([text])[0].tolist()\n    hits = client.search(collection_name=collection, query_vector=vec, limit=1)\n    return hits[0].score if hits else 0.0\n\nin_corpus = membership_score(client, \"docs\", model.encode, \"\u003Cexact quote from a known chunk>\")\ncontrol  = membership_score(client, \"docs\", model.encode, \"An unrelated random sentence.\")\nprint(f\"in-corpus={in_corpus:.3f}  control={control:.3f}  delta={in_corpus-control:.3f}\")\n# A large positive delta indicates the item is in the corpus (membership leak).\n```\n\n### Step 4: Test multi-tenant isolation\n\nConfirm that tenant B cannot retrieve tenant A's chunks. Issue tenant-B-authenticated queries that *should* be filtered, and verify no tenant-A `tenant_id` appears in results.\n\n```python\n# Query as tenant B; expect ONLY tenant_id == \"B\" results.\nfrom qdrant_client.models import Filter, FieldCondition, MatchValue\n\nvec = model.encode([\"confidential salary information\"])[0].tolist()\nhits = client.search(\n    collection_name=\"docs\",\n    query_vector=vec,\n    limit=10,\n    query_filter=Filter(must=[FieldCondition(key=\"tenant_id\", match=MatchValue(value=\"B\"))]),\n)\nleaked = [h for h in hits if h.payload.get(\"tenant_id\") != \"B\"]\nprint(\"CROSS-TENANT LEAK\" if leaked else \"isolation OK\", \"->\", len(leaked), \"foreign rows\")\n\n# Critical test: repeat WITHOUT the filter to confirm the server, not the client,\n# enforces isolation. If unfiltered queries return tenant A data, isolation is client-side only.\nhits_nofilter = client.search(collection_name=\"docs\", query_vector=vec, limit=10)\nprint(\"server-side isolation FAILS\" if any(h.payload.get(\"tenant_id\") != \"B\" for h in hits_nofilter) else \"OK\")\n```\n\n### Step 5: Knowledge-base poisoning (test collection only)\n\nInsert a benign poisoned chunk crafted to be retrieved for many unrelated queries, then measure how often it appears in `top_k`.\n\n```python\nfrom qdrant_client.models import PointStruct\n\n# Benign marker payload (no real injection) to measure retrieval dominance.\npoison = \"POISON-CANARY. \" + \" \".join(\n    [\"password reset billing refund account login support error help\"] * 8\n)\nclient.upsert(\"docs_test\", points=[\n    PointStruct(id=999999, vector=model.encode([poison])[0].tolist(),\n                payload={\"tenant_id\": \"B\", \"source\": \"poison-test\"})\n])\n\nqueries = [\"how do I get a refund\", \"reset my password\", \"what is the weather\"]\nfor q in queries:\n    hits = client.search(\"docs_test\", model.encode([q])[0].tolist(), limit=5)\n    dominated = any(h.payload.get(\"source\") == \"poison-test\" for h in hits)\n    print(f\"{'POISON in top5' if dominated else 'clean'}: {q}\")\n```\n\n### Step 6: Detect indirect prompt injection in retrieved chunks\n\nScan retrieved chunk text for injection markers before it is concatenated into the prompt.\n\n```python\nimport re\nINJECTION_PATTERNS = [\n    r\"ignore (all|previous|the above) instructions\",\n    r\"system prompt\", r\"you are now\", r\"disregard\", r\"\u003C\u002F?(system|instructions)>\",\n]\ndef chunk_is_injection(text):\n    low = text.lower()\n    return [p for p in INJECTION_PATTERNS if re.search(p, low)]\n\nfor hit in client.search(\"docs\", model.encode([\"help\"])[0].tolist(), limit=10):\n    flags = chunk_is_injection(hit.payload.get(\"text\", \"\"))\n    if flags:\n        print(\"INDIRECT INJECTION in chunk\", hit.id, flags)\n```\n\n### Step 7: Report and remediate\n\n- **Inversion\u002Fmembership:** rate-limit and authenticate the embedding endpoint; avoid returning raw similarity scores; restrict who can query embeddings.\n- **Cross-tenant:** enforce tenant filters server-side (separate collections\u002Fnamespaces per tenant where feasible); never rely on client-supplied filters.\n- **Poisoning:** validate and provenance-tag every ingested chunk; scan inputs for injection; cap any single source's share of retrieval.\n- **Indirect injection:** sanitize retrieved chunks and apply output guardrails (see `defending-llms-with-guardrails`).\n\n## Tools and Resources\n\n| Tool | Purpose | Primary Source |\n|------|---------|----------------|\n| OWASP LLM08 | Vector and Embedding Weaknesses guidance | https:\u002F\u002Fgenai.owasp.org\u002Fllmrisk\u002Fllm082025-vector-and-embedding-weaknesses\u002F |\n| sentence-transformers | Embedding generation for testing | https:\u002F\u002Fwww.sbert.net\u002F |\n| Qdrant client | Vector store + filtered search | https:\u002F\u002Fqdrant.tech\u002Fdocumentation\u002F |\n| Chroma \u002F Weaviate \u002F Pinecone | Alternative vector stores | https:\u002F\u002Fdocs.trychroma.com\u002F |\n| vec2text | Embedding-inversion research baseline | https:\u002F\u002Fgithub.com\u002Fjxmorris12\u002Fvec2text |\n| MITRE ATLAS | AML.T0024 Exfiltration via ML Inference API | https:\u002F\u002Fatlas.mitre.org\u002F |\n\n## Validation Criteria\n\n- [ ] RAG pipeline inventoried (embedding model, store, tenancy, metric, top_k, filters).\n- [ ] Embedding-inversion exposure measured and rated.\n- [ ] Membership-inference delta computed for in-corpus vs control items.\n- [ ] Multi-tenant isolation tested both with and without client filters (server-side enforcement confirmed).\n- [ ] Poisoning dominance measured in a test collection only.\n- [ ] Retrieved chunks scanned for indirect-injection content.\n- [ ] Findings reported with remediation for each weakness class.\n- [ ] No production corpus modified during the assessment.\n",{"name":5,"tags":24,"author":33,"domain":34,"license":14,"version":35,"subdomain":25,"description":7,"nist_ai_rmf":36,"atlas_techniques":38},[25,26,27,28,29,30,31,32],"ai-security","vector-database","embedding-inversion","rag-security","owasp-llm08","multi-tenant-isolation","data-poisoning","retrieval-augmented-generation","mahipal","cybersecurity","1.0",[37],"MEASURE-2.7",[39],"AML.T0024","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill assessing-vector-and-embedding-weaknesses",{"tool":52,"command":53},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill assessing-vector-and-embedding-weaknesses",{"tool":55,"command":56},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill assessing-vector-and-embedding-weaknesses","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses\u002FSKILL.md",true,[60,64,70,74],{"path":61,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fapi-reference.md","REFERENCE","参考文档",2344,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses\u002Freferences\u002Fapi-reference.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fstandards.md",1958,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses\u002Freferences\u002Fstandards.md",{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"scripts\u002Fagent.py","SCRIPT","脚本",5982,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fassessing-vector-and-embedding-weaknesses\u002Fscripts\u002Fagent.py",[81,89,96,103,110,117],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":85,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":85,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":85,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":85,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":85,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":85,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]