Active · Mar 24, 2026
DocVault
A self-hosted insider-threat event collector for small teams: osquery plus a custom clipboard agent feed a Go/PostgreSQL server with tamper-evident audit logs and an operator AI assistant.
Postgres-trigger audit chain · 17,783 LOC · 23 tables · 102 routes · Single-use install tokens
- Role
- Solo (AI-pair-programmed with Claude Code)
- Stack
- Go 1.26.1 · PostgreSQL 16 · chi · pgx · htmx · osquery · AES-256-GCM · Docker · Caddy

DocVault is a self-hosted insider-threat and endpoint-audit platform. osquery and a custom Windows clipboard agent feed endpoint activity into a Go server; PostgreSQL stores the event stream behind a database-trigger hash chain that makes audit tampering detectable; an htmx web UI exposes audit, endpoint, alert, vault, and operator workflows. Windows agents onboard through single-use install tokens with automatic host-user mapping and heartbeat checks.
It is live at docvault.daeseon.ai, with source at Daeseon-AI-Factory/docvault.
What it does
- Collects endpoint activity through osquery and a custom Windows clipboard agent.
- Stores events, audit trails, users, vault files, endpoint state, alerts, agent actions, and security briefings in PostgreSQL.
- Uses a database-trigger hash chain to make app-level audit tampering detectable.
- Serves a server-rendered htmx UI, with Korean as the default product language and an EN/KO toggle.
- Provides admin installation flows, including an in-app install page and a one-click Windows installer.
- Adds an operator AI assistant for read and action workflows, with mutating actions logged and rollbackable.
Why
The goal is practical visibility for a small team, not a full SIEM, DRM system, legal-evidence system, or ML-based UEBA product. The useful product surface is narrower: see whether company endpoint activity is flowing, inspect suspicious behavior, and preserve an auditable trail before the team reaches for heavier enterprise tooling.
Engineering bits worth pointing at
- Tamper-evident audit chain. The early implementation moved audit integrity into a PostgreSQL trigger and advisory-lock flow so application bugs cannot silently bypass the chain. (log)
- Encryption bug fix. A streaming vault bug around AES-CTR and MAC boundaries was replaced with chunked AES-256-GCM so encrypted file storage has authenticated chunks. (log)
- Deployment stack. The live service runs behind Caddy on an NCP Seoul box, deployed with rsync, Docker build, Compose recreate, and a health check. (log)
- Install workflow. The Windows agent path moved from manual instructions toward an in-app install page and generated installer script, reducing non-technical setup friction. (log)
- Operator AI agent. The management assistant can inspect system state and perform guarded admin actions, with confirmation and rollback paths added after the first implementation. (log)
Current limits
DocVault is not being presented as a hardened public-internet security product. The current handoff still calls out real-desktop clipboard capture, osquery end-to-end verification, prompt-injection hardening for attacker-controlled tool-output fields, recovery-code handling, off-host backup verification, and the first real customer PC install as areas that need more proof before wider use.
Project log
Chronological record of troubleshooting, retros, and updates while building this.
Week of Jun 15, 20269 entries · 3 Update · 3 Tech retro · 3 UX retro
A portfolio demo should show the whole product — make it read-only, not lower-privilege
Tech retroJun 21, 2026 · 2 min
The demo had been made a non-admin for safety, which hid the AI assistant and admin screens — so it looked like a different, crippled product. Fixed by making the demo a full admin but enforcing read-only at the middleware and in the AI engine.
Making the AI assistant guide a non-technical admin (lightweight RAG, not a vector DB)
UpdateJun 20, 2026 · 2 min
The operator found the UI hard and wanted the AI to guide them. Added a doc-grounded help_docs tool so the assistant answers how-to/install questions strictly from a curated usage guide — lightweight RAG, no vector DB needed at this scale.
Email alerts + a daily digest — so the admin learns about issues without logging in
UpdateJun 20, 2026 · 2 min
Alerts were pull-only (dashboard) and the Slack notifier was unconfigured, so a non-technical admin who didn't log in never found out. Added SMTP email for high/critical alerts plus a daily Korean digest, with an on-demand send.
Adversarially reviewing the AI teammate's work — and hardening the demo login
Tech retroJun 19, 2026 · 3 min
A second AI assistant (Codex) shipped 22 commits while I was away. I reviewed the diff adversarially, confirmed it was solid, then fixed two real holes — a passwordless-admin footgun in the demo login and a missing code-signing pipeline — and a deploy bug my own verification caught.
One in-app page for agent install (download + visual guide together)
UX retroJun 17, 2026 · 1 min
The installer download and the install guide were scattered (download buried in Agent Status, guide a separate static page in a new tab). Consolidated into a single in-app /admin/install page reachable from the sidebar.
Honest retro: shipping the agent onboarding (what went wrong, both sides)
Tech retroJun 17, 2026 · 5 min
Candid post-mortem of building the one-click Windows installer + guides + in-app install page: the assistant's mistakes, the environment dead-ends, the real-world gotchas, and the process friction. No sugarcoating.
Idiot-proof visual install guide (and why a one-click .bat still isn't enough)
UX retroJun 16, 2026 · 2 min
Shipping a one-click installer wasn't enough for a non-technical user: SmartScreen hides its Run button and email blocks .bat files. Rewrote the install page into a visual, dialog-by-dialog guide and added transfer guidance for the admin.
Team management + an AI assistant that acts (with rollback)
UpdateJun 16, 2026 · 2 min
Added host→employee assignment, CSV bulk user import, an AI security briefing, and a tool-use AI assistant that can both query live data and perform actions (create user, assign host, ack alert) — every action logged and one-click rollback-able.
One-click Windows agent installer for non-technical end users
UX retroJun 16, 2026 · 2 min
A non-technical user installing the agent opened Docker by mistake and got stuck on the PSK placeholder. Replaced the copy-paste PowerShell install with an admin-only, secret-baked, self-elevating .bat they just double-click.
Week of Jun 8, 20263 entries · 2 Troubleshoot · 1 Tech retro
Made the agents production-grade: osquery TLS protocol and reliable clipboard delivery
Tech retroJun 10, 2026 · 3 min
To actually deploy DocVault for a remote user, I implemented the real osquery TLS wire protocol on the server (enroll_secret → node_key) so a stock osquery node can connect, and rewrote the clipboard agent around a bounded retry queue with periodic re-enrollment so events survive network outages. Plus a one-command Compose deploy and a full deployment guide.
Hardened DocVault access controls, agent auth, and CSV exports
TroubleshootJun 9, 2026 · 2 min
A full repository review found missing admin and folder authorization checks, fail-open agent PSK behavior, fragile CSV export generation, and incomplete audit coverage. Commits e0d498d, 6df4c71, and 9f81995 close those gaps and add regression tests.
Closed an API 2FA bypass and shipped a one-command production deploy
TroubleshootJun 9, 2026 · 3 min
After verifying a separate batch of access-control fixes, I closed the remaining auth gaps — an API-login 2FA bypass with no brute-force limit, example/weak secrets accepted at startup, and a hardcoded admin password — then added a Docker Compose + Caddy stack that auto-migrates and auto-issues TLS for both a dedicated server and an all-in-one install.
Week of May 25, 20261 entry · 1 Troubleshoot
Week of Apr 6, 20262 entries · 2 Update
CI/CD, release automation, and one-command deploy scripts
UpdateApr 8, 2026 · 1 min
Added GitHub Actions CI + a release workflow, plus deploy scripts for the server and the Windows agents — turning ad-hoc builds into a repeatable pipeline.
Hash-based file tracking — catch a sensitive file even after it's renamed
UpdateApr 8, 2026 · 1 min
Register sensitive files by SHA-256; the server matches incoming endpoint file events against those hashes (cached in memory) and records detections — so a tracked file is caught even if it's renamed.
Week of Mar 30, 20264 entries · 4 Update
Two-factor authentication (TOTP) with recovery codes
UpdateApr 1, 2026 · 1 min
Added TOTP-based 2FA implemented from the RFC primitives (HMAC-based one-time codes), a QR setup flow, a second login step, and recovery codes.
Behavior risk scoring (rule-based UEBA), with per-user baselines
UpdateApr 1, 2026 · 1 min
Added a risk-scoring engine that compares each event against a per-user behavioral baseline (work hours, weekends, known IPs, …) and accumulates weighted anomaly scores. Threshold-rule based — deliberately not ML.
A macOS clipboard agent, and splitting the agent cross-platform
UpdateMar 31, 2026 · 1 min
Added a macOS clipboard agent and refactored the single 397-line main into clean per-platform files (Windows/macOS) with a shared core and a launchd service.
Real-time dashboard updates with Server-Sent Events
UpdateMar 31, 2026 · 1 min
Added a Server-Sent Events hub so the dashboard updates live as endpoint events arrive — no polling, no WebSocket complexity.
Week of Mar 23, 20262 entries · 2 Tech retro
Moved audit-log tamper detection from app code to PostgreSQL triggers
Tech retroMar 25, 2026 · 1 min
Added a SHA-256 hash chain on audit_logs and endpoint_events via DB triggers, plus UPDATE/DELETE prevention. Chose DB-level enforcement so any insert path — including ad-hoc psql — is forced through the chain.
AI-scaffolded the full DocVault skeleton in a single 92-file commit
Tech retroMar 24, 2026 · 1 min
Ran the 8-phase implementation plan from CLAUDE.md to a working end-to-end skeleton in one commit, with AI assistance. Surface coverage was wide but depth was thin — the interesting parts came later.