Most teams secure their AI at the model layer — but the real vulnerabilities live upstream, in the ingestion pipeline. This episode breaks down how to build a document pipeline that treats data classification, redaction, and access control as first-class security concerns.
Show Notes
Security teams building LLM-powered products tend to focus on output filters and prompt guardrails — but those controls arrive too late. The document ingestion pipeline is where sensitive enterprise data is processed, classified, and embedded, and it's where most AI-related breaches actually originate. This episode of DEV.co walks through what a production-grade, security-conscious ingestion pipeline looks like from end to end, drawing on DEV.co's deep dive on securing enterprise LLM ingestion pipelines for teams building on RAG architectures.
The episode covers each stage of the pipeline in concrete detail, with benchmarks and design decisions that go well beyond the usual high-level advice:
- The breach numbers that make this urgent: IBM's 2026 Cost of a Data Breach report puts the average AI-related incident at $5.3 million — and 92% of those organizations lacked proper AI access controls. The 2026 OWASP LLM Top Ten confirms the pattern: sensitive information disclosure, data poisoning, and vector/embedding weaknesses all trace back to the pipeline, not the model.
- Connectors as policy objects: Every data source — SharePoint, Confluence, Salesforce, S3, Postgres — should be treated as a declared policy boundary, not a script. Connectors must specify tenant ownership, classification rules, and re-sync cadence. Change data capture beats full re-indexing for both cost and accuracy.
- Classification must run first: Every document gets a sensitivity label (public, internal, confidential, restricted) before chunking or embedding. That label propagates to every derived chunk and governs whether the chunk is redacted, embedded at all, or retrievable by a given role. For teams building production retrieval-augmented generation systems, skipping this step is not a shortcut — it's a liability.
- Redaction before embedding — not after: Once sensitive text is inside a vector index, it's extremely difficult to find and purge. A 2026 benchmark of regex, spaCy NER, GLiNER, and hybrid pipelines found PII leak rates ranging from 0.04% to 0.41% depending on configuration. The winning approach is a hybrid: regex for structured identifiers, named-entity recognition for names and locations, and an LLM pass only for ambiguous chunks. Pure LLM redaction is roughly 14× slower than transformer NER and introduces its own data-egress risks.
- Stable token replacement over deletion: When a sensitive identifier is detected, replacing it with a typed, hashed placeholder (rather than deleting it) preserves chunk length and sentence structure — both of which affect embedding quality. The mapping between token and real value lives in a separate, access-controlled vault, never in the vector store itself.
- Access-control metadata on every vector: Chunks written to the vector store must carry tenant ID, classification label, source document ID, allowed roles, and a retention clock. Retrieval should filter by authorization before similarity search runs. On storage: pgvector with HNSW indexing hit 0.978 recall at 2.6 ms median latency on a 100K-vector benchmark — and below roughly 10 million vectors, it's a full production choice that also provides ACID compliance and row-level security in the same engine as application data.
For more from the show, check out the episode Claude Code vs Cursor vs Copilot: What Enterprise Teams Actually Need to Know, which looks at how development tooling choices play out at the enterprise level. Teams looking for expert help implementing secure AI infrastructure can also explore DEV.co's cybersecurity development services.
DEV.co
RFP.co
What is DEV?
Software and web development from the side that has to ship it and then live with it. Architecture decisions with a cost attached, scoping, technical debt, hiring and vendor selection, and the AI tooling question every engineering team is now answering whether they planned to or not.
Each episode takes one decision — rewrite or refactor, framework choice, build versus buy, how to scope a fixed-bid project honestly — and works through the tradeoffs, including the ones that only show up in year two. Written for engineering leads, technical founders and the people who fund them. Five or six minutes, no hand-waving.
Topics include rewrite versus refactor, build versus buy, scoping fixed-bid work honestly, technical debt you should keep, framework and platform choices, hiring and vendor selection, code review culture, and where AI tooling actually helps.
Produced by DEV.co, web and software development. Full details, services and further reading at https://dev.co