Access Control Pipeline

Three-layer enforcement · folder gate · embed gate · retrieval filter

AAllowed tags:publicconfidentialsecret
1

Source files

Layer 1 — folder gate at ingestion

/public/
public
  • company-overview.md
    About the company, mission, public services.
  • press-release.md
    Latest public announcement about Project Alpha.
/confidential/
confidential
  • q3-roadmap.md
    Internal roadmap and licensing fee model.
  • partner-list.md
    Active partner accounts and contract types.
/secret/
secret
  • margins.md
    Per-project margin percentages.
  • salary-bands.md
    Compensation bands by level.
  • unreleased-ip.md
    Unreleased product IP and algorithms.
/mixed/
confidential
  • product-prd.md
    PRD with public, confidential, and secret sections.
2

Chunking + embed gate

Layer 2 — per-chunk sensitivity, structural to the DB

The ingestion script reads ## [PUBLIC], ## [CONFIDENTIAL], and ## [SECRET] headers in /mixed/product-prd.md and tags each chunk independently. Secret chunks get embed_blocked=True and are excluded from the vector DB entirely.

  • mix-prd-001PRD — Overview
    public embedded

    Project Alpha addresses the mid-market segment with a self-serve onboarding flow.

  • mix-prd-002PRD — Feature specs
    confidential embedded

    Licensing fees follow tiered model: Starter, Growth, Enterprise. Volume discounts available.

  • mix-prd-003PRD — Commercial targets
    secret embed_blocked

    Target margin 35% by EOY. Internal floor: 22%. Reserved for executive review.

3

Vector DB

What actually got stored (global, role-independent)

9 chunks in vector DB · 1 excluded by Layer 2
pub-overview-001public
Company overview
pub-press-001public
Press release — Project Alpha
conf-roadmap-001confidential
Q3 roadmap — licensing
conf-partners-001confidential
Partner accounts
sec-margins-001secret
Project Alpha margins
sec-salary-001secret
Salary bands
sec-ip-001secret
Unreleased IP
mix-prd-001public
PRD — Overview
mix-prd-002confidential
PRD — Feature specs
mix-prd-003 not in DB
Excluded by Layer 2 — only retrievable by safe_fetch() for internal roles.
4

Query as Alex

Layer 3 — metadata filter derived from role

retrieval filter (derived from Alex / Internal)
filter = { sensitivity: { $in: ["public", "confidential", "secret"] } }
5

Results to LLM

Only allowed chunks reach the model

Retrieved (2)
  • conf-roadmap-001confidential
    Q3 roadmap — licensing

    Licensing tier introduced in Q3 at standard fee model. Internal partners receive 15% discount.

  • mix-prd-002confidential
    PRD — Feature specs

    Licensing fees follow tiered model: Starter, Growth, Enterprise. Volume discounts available.

Filtered out (0)
Nothing filtered by Layer 3 for this query.
safe_fetch() available for internal role
mix-prd-003 (PRD — Commercial targets) — not in vector DB. Internal users may fetch directly.
Final context sent to LLM
# Q3 roadmap — licensing [confidential]
Licensing tier introduced in Q3 at standard fee model. Internal partners receive 15% discount.

# PRD — Feature specs [confidential]
Licensing fees follow tiered model: Starter, Growth, Enterprise. Volume discounts available.

The LLM never sees blocked content. Trust is enforced before generation, not inside it.