Developer builds three-layer regex filter to block untrusted LLM output from personal knowledge base
A developer has built an automated pipeline that every 10 minutes uses a Claude AI model to summarize conversation logs and commit the results to a personal Obsidian Vault on GitHub, with no human review in the loop. Recognizing that the summarizing model could return malicious or accidental content — such as embedded API keys, auth URLs, or prompt-injection text from prior sessions — the developer treats all AI-generated output as untrusted input. To mitigate this, the generation step runs Claude in a maximally restricted mode with no file-write or network tools, enforced empty MCP server config, and a strict JSON schema that rejects any free-form output. A separate Python validation script then re-scans the returned JSON independently, followed by a third regex pass over the written files and git diff before any commit is allowed. The design reflects a zero-trust philosophy: restricting what the model can do during generation is not considered sufficient, so the receiving side independently validates output regardless.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in