Skip to content
Back to skills

Knowledge Base Ingestion

ASecurity

Title: Knowledge Base Ingestion & Provenance Keywords: knowledge-engine, kb, google-drive, chunker, converter, graphify, provenance, sanitizers, sync, repo-writer, ingestion, pii-redaction Agents: data-pipeline-engineer, backend, privacy-engineer, security When to use: When building, modifying, or auditing document ingestion, Google Drive Picker sync, chunking, graph generation, PII/secret sanitization, or provenance tracking in `@agent-os/knowledge-engine` and `packages/lobby-server/src/kb/`...

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
ai-agentsgonodegitapidatabasebackendsecurity

Works with

  • api

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add ronnikc/agent-os-protocol --skill knowledge-base-ingestion --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Knowledge Base Ingestion?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Knowledge Base Ingestion
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ronnikc-knowledge-base-ingestion/badge)](https://www.skillsdirectory.com/skills/ronnikc-knowledge-base-ingestion)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
Title: Knowledge Base Ingestion & Provenance
Keywords: knowledge-engine, kb, google-drive, chunker, converter, graphify, provenance, sanitizers, sync, repo-writer, ingestion, pii-redaction
Agents: data-pipeline-engineer, backend, privacy-engineer, security
When to use: When building, modifying, or auditing document ingestion, Google Drive Picker sync, chunking, graph generation, PII/secret sanitization, or provenance tracking in `@agent-os/knowledge-engine` and `packages/lobby-server/src/kb/`.
Version: 1.0.0
Last updated: 2026-12-05

Ingest external and repository documents safely into Agent OS knowledge bases via `@agent-os/knowledge-engine` (`converter`, `chunker`, `sanitizers`, `provenance`, `graphify`) and `packages/lobby-server/src/kb/` (`jobs`, `sync`, `repoWriter`, `googleDrivePicker`). Guarantees secret/PII redaction, deterministic chunking, replay-safe sync, and auditable provenance.

---

## Workflow

### Step 1 — Convert & sanitize before chunking or storage
- Pass all raw inputs (Markdown, text, Drive exports) through `converter.ts` and `sanitizers.ts` BEFORE chunking, indexing, or committing via `repoWriter.ts`.
- Strip credentials, tokens, and disallowed raw PII; quarantine or reject files that fail sanitization rather than writing partial unredacted bytes.

### Step 2 — Enforce deterministic chunking & provenance metadata
- Chunk documents with `chunker.ts` using stable content hashes and deterministic chunk IDs so re-ingestion of unchanged files is a no-op.
- Attach `provenance.ts` records (source URI/Drive file ID, revision/checksum, ingestion timestamp, sanitizer verdict) to every stored artifact.

### Step 3 — Update graph relations & replay-safe sync checkpoints
- Build entity/document links via `graphify.ts` without leaking restricted source contents into public graph nodes.
- In `lobby-server/src/kb/jobs.ts` and `sync.ts`, use explicit checkpoints and idempotent upserts so interrupted sync jobs resume safely without duplicating chunks or losing deletions.

### Step 4 — Verify Google Drive Picker & repo-writer boundaries
- Confirm `googleDrivePicker.ts` requests minimum read-only file scope for user-selected items only and never persists raw OAuth tokens in KB output or repo commits.
- Verify `repoWriter.ts` writes only inside designated KB paths and prevents path traversal.

### Step 5 — Run memory & build verification
Run `npx tsc -b` and `npm run verify-memory` (plus targeted KB unit tests when modifying `knowledge-engine` or `lobby-server/src/kb`).

---

## Input Schema

```yaml
input:
  source_type:
    type: string
    required: true
    enum: [google_drive, repo_docs, uploaded_file, api_sync]
  pipeline_stage:
    type: string
    required: false
    enum: [convert, sanitize, chunk, graphify, sync, full]
    default: full
```

## Output Schema

```yaml
output:
  sanitized_before_store: { type: boolean }
  deterministic_chunks: { type: boolean }
  provenance_complete: { type: boolean }
  replay_safe: { type: boolean }
  path_traversal_blocked: { type: boolean }
```

## Quality Gate

- Every document passes `sanitizers.ts` before chunking, graph indexing, or repo write.
- Re-running ingestion on identical source inputs yields identical chunk hashes and zero duplicates.
- Every KB entry carries complete `provenance.ts` source + checksum metadata.
- `repoWriter.ts` enforces strict destination path confinement (no `..` escape).
- `npx tsc -b` and `npm run verify-memory` pass.

## Chain Metadata

```yaml
chain_metadata:
  skill_slug: "knowledge-base-ingestion"
  stage: "S1"
  suggested_next:
    - slug: "database-migration-audit"
      stage: "S1"
      reason: "Verify KB metadata schema changes and index coverage"
    - slug: "security-and-hardening"
      stage: "S3"
      reason: "Verify path confinement, OAuth scope minimization, and secret redaction"
```

## Error Handling

- Unsupported binary/corrupt input during conversion → quarantine job record with sanitized reason and continue remaining files.
- Secret or credential detected by sanitizer → redact or block commit; never write raw credential material into KB or git history.
- Interrupted Drive sync job → resume from last committed checkpoint using deterministic source+revision keys.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.