K-Dense BYOK is a desktop AI research assistant that lets scientists describe research tasks in plain language and have an agent inspect data, run analysis code, search sources, and produce figures or reports. It is intended for scientific work across fields, using the user’s selected hosted or local AI models. The catalogue add-ons support its research workflow.
Borrowing it
Nothing to install: this file belongs to K-Dense-AI/k-dense-byok. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/K-Dense-AI/k-dense-byok/main/AGENTS.mdgit clone --depth 1 https://github.com/K-Dense-AI/k-dense-byokWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/k-dense-ai/k-dense-byok/agents-md)<a href="https://agentmods.dev/instructions/k-dense-ai/k-dense-byok/agents-md"><img src="https://agentmods.dev/badge/instructions/k-dense-ai/k-dense-byok/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/k-dense-ai/k-dense-byok/agents-md"><img src="https://agentmods.dev/badge/instructions/k-dense-ai/k-dense-byok/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.19736 | $0.19736 |
| Opus 5.5 | $0.07894 | $0.07894 |
| Sonnet 5.5 | $0.03947 | $0.03947 |
| Haiku 4.5 | $0.01974 | $0.01974 |
Grade D, and why
k-dense-byok AGENTS.md scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads MCP configurationmediumAgent snooping
mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.
- **MCP is Pi's built-in support, and it forces a tool denylist.** `session-registry.ts` adds Pi's exported `createCodemodeExtension()`, `createToolSearchExtension()` and `createMcpExtension()` to the lead's extension fa Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
- **Raw-data guard.** `server/src/agent/data-guard.ts` is a `tool_call` hook (registered after the subagent bridge so budget gates run first) that blocks `write`/`edit`/`bash` mutations of the project's protected globs ( How it starts
The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for coding agents (Claude Code loads it via CLAUDE.md) working in this repository.
Project overview
K-Dense BYOK is a local AI research-assistant app ("Kady") that brings the user's own model credentials (API keys or supported subscriptions). It runs natively on macOS, Linux, and Windows. It is one repo with two runtime services started together by the cross-platform launcher start.mjs (wrapped by ./start.sh on macOS/Linux and start.cmd on Windows):
| Service | Port | Code |
|---|---|---|
| Frontend (Next.js 16 / React 19) | 3000 | web/ |
| Backend (TypeScript + Pi coding-agent SDK) | 8000 | server/ |
The backend embeds the Pi SDK (@earendil-works/pi-coding-agent) and runs a single flat agent with built-in tools (read/bash/edit/write/grep/find/ls), a subagent/bg_wait delegation pair (the pi-subagents extension package), an interview clarifying-questions tool (a native re-implementation of pi-interview — see server/src/agent/interview.ts; the form renders inline in the chat UI instead of the package's own browser window), the pi-web-access web tools (web_search/fetch_content/get_search_content/source_check), live PDF annotation tools (add_pdf_annotation/list_pdf_annotations/remove_pdf_annotation), a hybrid durable Modal tool family (modal_run/modal_submit/modal_status/modal_wait/modal_cancel/modal_results/modal_submit_batch; server/src/agent/modal-tool.ts), a generate_image tool (Pi 1.0 image models, saved into the sandbox; server/src/agent/image-tool.ts), and MCP tools through Pi's built-in MCP support (project .pi/mcp.json + global <agentDir>/mcp.json; see the MCP caveat below). PDF annotations and Modal jobs are also available to child agents through the vendored kady-pdf-annotations and kady-modal Pi packages; annotation sidecars use a shared cross-process lock and atomic replacement. Modal jobs are server-owned and restart-recoverable. There is no orchestrator/expert split and no model proxy: models go directly to OpenRouter, connected Pi OAuth providers (openai, openai-codex, anthropic, github-copilot, xai, kimi-coding, meta), NVIDIA NIM (API key), or a local Ollama / OpenAI-compatible server. Everything runs locally; user data lives in projects/.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 21d ago Changed · +675 tokens per session de71aeb31ec7
- 1mo ago Changed · +1 lines · +563 tokens per session 20aea46f9b30
- 1mo ago Changed · +205 tokens per session 5a03e8e481e5
- 1mo ago Changed · +1,867 tokens per session a957af4d03b5
- 1mo ago Changed · +10 lines · +952 tokens per session 5e9e18858c8b
- 1mo ago Changed · +5 lines · +2,402 tokens per session scan C → D 1bdf7d5e027c
- 1mo ago Changed · +13 lines · +3,660 tokens per session scan A → C 35384bec7300
- 1mo ago Changed · +2 lines · +1,598 tokens per session 3a7c5b98a656
- 2mo ago Changed · +347 tokens per session f1f42a65581c
- 2mo ago First seen · 111 lines · 7,467 tokens per session scan A e92e58bf1be2
k-dense-byok AGENTS.md is an instructions file published in the GitHub repository K-Dense-AI/k-dense-byok (1,427 stars, last pushed 21d ago), licensed MIT. It adds 19,736 tokens to every session, about $0.0789 per session on Opus 5.5. A static security scan graded it D with 2 findings (reads mcp configuration, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
k-dense-byok AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| k-dense-byok AGENTS.mdK-Dense-AI/k-dense-byok | Instructions file | 1.4k | 21d ago | MIT | D | 19,736 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |