Read-Only by Design: An MCP Server for Secure Agent Secret Management
nabsha · reddit · 2026-08-01
To prevent AI agents from leaking credentials, a developer built a read-only-by-design MCP server.
- Core Mechanics: It exposes only non-writing tools (list, check, get masked, run). The run tool spawns commands with secrets injected as environment variables, ensuring plain-text secrets never enter the conversation context.
- Backing Store: Uses a local KeePassXC vault accessed via key-file only.
- Security Hook: Implements a PreToolUse hook for the shell path to prevent agents with bash privileges from bypassing MCP entirely.
- Limitations: The author notes this prevents accidents but not attacks, as anything that can read the key file compromises the vault.
More from coding & agent
- Developers Share Custom Settings and Shortcuts for Codex Micro — dkundel · 2026-08-01
- AI Agents to Take Over Quant Trading: Developer Shares Vision — doodlestein · 2026-08-01
- Tested: Using LLM Agents to Autonomously Discover RCEs in Open Source Libraries — rez0__ · 2026-08-01
- Grok Build v0.2.118 Update Adds Permanent Session Deletion and Smart Diagnostics — Kyrannio · 2026-08-01
- Single Prompt Generates Multiplayer Game: Claude 3.5 Sonnet Agent Test — TAbrodi · 2026-08-01
- Engineering AI Agent Loops: Master Unattended Workflows in 30 Mins — Saboo_Shubham_ · 2026-08-01