Project guide

Project Guide | Honeypot Kkuldanji

Free honeypot tabletop planning note for low-risk security monitoring exercises. This guide organizes the repository's original implementation notes for security lab operators and tabletop facilitators.

Reviewed 2026-07-28. This page is derived from checked-in repository evidence and links back to its source.

Live Demo

Kkuldanji converts internal documents into a structured 6-section handover document and supports follow-up Q&A via retrieval (vector + semantic search).

This repo explores a document-to-handover workflow with a security-conscious web stack and an explicit split between:

Core capabilities:

Status: working prototype for explicit development/test environments. Authentication is a local demo implementation, not production identity.

Security boundary: AUTH_BACKEND=demo-local uses bundled users, self-issued JWT role claims, and process-local refresh/CSRF/rate-limit state. staging and production intentionally fail during startup even when a strong JWT_SECRET is present. Do not expose this backend to untrusted users or customer documents until external identity, server-authoritative tenant roles, shared security state, and document-level authorization are implemented.

System Overview

A document-handover assistant that turns messy operational files into cited Q&A, controlled workflows, and safer support handoffs.

AreaDetails
UsersSupport teams, onboarding teams, internal operations groups, and document-heavy service organizations.
Technical pathValidate the demo, README, architecture notes, and quality gate before deeper workflow review.
System scopeRetrieval-backed Q&A, document workflow controls, web security boundaries, and a hosted prototype surface.
Operating boundaryPrivate files and customer documents must stay inside approved storage; the repository should remain a prototype and pattern library.
Evaluation pathUse the README quick start and repository tests to verify upload, retrieval, citation, and workflow behavior.

Evaluation Path

Technical Notes

When to use this repo

This repo is the best place to review the three execution postures side by side:

Project layout

Scope

Problem

Handover documents are often:

Kkuldanji aims to reduce that overhead by extracting structured information from uploaded documents and generating an editable handover template, with retrieval-backed Q&A for follow-ups.

Key Features

Architecture

┌───────────────────────────────────────────────────────────────┐
│ Frontend (React + Vite + TypeScript)                           │
│ - Upload sidebar                                               │
│ - Handover editor (6 sections)                                 │
│ - Chat/Q&A                                                     │
└───────────────────────────────┬───────────────────────────────┘
                                │ HTTP (JWT + CSRF header)
┌───────────────────────────────▼───────────────────────────────┐
│ Backend (FastAPI)                                              │
│ - app/routers/auth.py    (login/refresh/me)                    │
│ - app/routers/upload.py  (async ingest + status)               │
│ - app/routers/chat.py    (analyze + chat)                      │
│ - app/security.py        (JWT/CSRF/rate-limit helpers)          │
│ - app/services/*         (blob/doc/search/llm)                 │
└───────────────────────────────┬───────────────────────────────┘
                                │
┌───────────────────────────────▼───────────────────────────────┐
│ Cloud Services (optional for local demo)                       │
│ - Azure Blob Storage (raw + processed JSON)                    │
│ - Azure Document Intelligence (OCR / PDF pipeline)             │
│ - Azure AI Search (vector + semantic search)                   │
│ - Azure OpenAI (generation + embeddings)                       │
│ - Google Gemini (preprocessing)                                │
└───────────────────────────────────────────────────────────────┘

LLM Strategy

This project uses "model role separation" to reduce failure modes and cost:

  1. Preprocess (long text -> structured JSON chunks)
  1. Retrieval + Q&A / Report generation
  1. Optional local provider override (BYO LLM)

Configuration is controlled by proto.env:

Directory Structure

.
├── app/
│   ├── main.py                 # FastAPI entrypoint, CORS, security headers
│   ├── config.py               # loads proto.env, optional Key Vault helper
│   ├── security.py             # JWT/refresh/CSRF/rate-limit helpers (demo-grade)
│   ├── routers/
│   │   ├── auth.py             # /api/auth/*
│   │   ├── upload.py           # /api/upload/*
│   │   └── chat.py             # /api/analyze, /api/chat
│   └── services/
│       ├── openai_service.py   # Azure OpenAI + Gemini calls
│       ├── search_service.py   # Azure AI Search index/create/search
│       ├── blob_service.py     # Azure Blob (raw/processed)
│       ├── document_service.py # text extraction (DOCX local + Azure DI)
│       └── prompts.py          # JSON extraction prompts
├── frontend/
│   ├── App.tsx
│   ├── services/               # auth + API calls
│   ├── components/             # UI
│   └── electron/               # optional desktop packaging
├── proto.env.example           # local env template (copy to proto.env)
├── docs/ops/RUNBOOK.md
└── .github/workflows/ci.yml

Prerequisites

1) Backend

Demo mode (no cloud keys):

Live mode (Azure/OpenAI/Search/Gemini): APP_MODE=live connects cloud document services while retaining the same demo-only authentication boundary. It is an integration evaluation mode, not a production deployment profile. Even locally, it requires an explicit 32-byte-or-longer JWT_SECRET and overrides for all three HONEYPOT_DEMO_*_PASSWORD values.

Create proto.env before either mode:

cp proto.env.example proto.env

Install and run:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[dev]"
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Backend endpoints:

2) Frontend

cd frontend
npm ci

## export VITE_GISCUS_CATEGORY_ID="DIC_kwxxxx"
npm run dev

Open:

3) Optional: Ollama local demo path (no cloud key)

Run Ollama locally:

ollama pull llama3.2
ollama serve

Then in the web UI:

Default local endpoint:

Demo Accounts

Bundled users and passwords exist only to keep the explicit local demo reproducible. Override the HONEYPOT_DEMO_*_PASSWORD values when needed, but do not publish or deploy these accounts. Changing their passwords does not make the authentication model production-capable.

Runtime notes

Evaluation Path

  1. GET /api/health — confirm demo/BYO/Azure posture first
  2. GET /api/runtime-brief — inspect auth, retrieval, and configuration mode
  3. GET /api/runtime-scorecard — confirm route pressure and security posture
  4. Login to the frontend and walk one upload → analyze → handover pass
  5. GET /api/approval-matrix — inspect handover completeness before trusting export-readiness claims

API

All state-changing requests must include:

Read endpoints that expose indexed/document metadata also require:

Auth

Upload

Status and schema endpoints

The frontend renders the same status board on the login screen and main workspace.

Key implementation files