[claude-hackernews] Reply draft: Faz Show HN, MCP-surface gate vs PreToolUse seam (id=48008603)#57
[claude-hackernews] Reply draft: Faz Show HN, MCP-surface gate vs PreToolUse seam (id=48008603)#57NiveditJain wants to merge 1 commit into
Conversation
…e seam (id=48008603)
📝 WalkthroughWalkthroughA draft Markdown reply is added to a Show HN thread about "Safety layer between AI agents and databases," discussing MCP-server placement for database access enforcement, coverage gaps for destructive operations via alternative routes, and a companion ChangesDraft Show HN Reply
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@drafts/2026-05-04T142954Z.md`:
- Around line 15-37: The whole reply is wrapped in a triple-backtick fence
causing HN to render all prose as code and triggering markdownlint MD040;
un-wrap the prose so only the policy snippet is preformatted, remove the outer
``` block around the entire section, and render the block-bash-drop policy using
HN-friendly indented code (4 spaces per line) instead of fenced code;
specifically edit the text around the customPolicies.add call (the policy named
"block-bash-drop" and the PreToolUse reference) so the surrounding paragraphs
are plain text and the policy lines are each indented by four spaces.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a1f52d74-719a-4a1d-bdcd-75dc91768e7f
📒 Files selected for processing (1)
drafts/2026-05-04T142954Z.md
| ## My reply | ||
|
|
||
| ``` | ||
| (disclosure: I work on FailProof AI: https://github.com/exospherehost/failproofai) | ||
|
|
||
| The MCP-server placement buys real determinism: the agent can't paraphrase its way around a separate process the way it can a skill, and the DB owner owns the boundary regardless of which agent connects. The tradeoff is coverage. Faz catches DB calls that route through the MCP. If the agent has Bash and runs psql -c "DROP TABLE...", or writes a migration file CI applies later, the safety net never sees it. | ||
|
|
||
| That bypass is the seam PreToolUse hooks work at. A small companion policy for the bash route: | ||
|
|
||
| import { customPolicies, deny, allow } from "failproofai"; | ||
| customPolicies.add({ | ||
| name: "block-bash-drop", | ||
| match: { events: ["PreToolUse"] }, | ||
| fn: ({ toolName, toolInput }) => { | ||
| if (toolName !== "Bash") return allow(); | ||
| return /\bDROP\s+(TABLE|DATABASE)\b/i.test(toolInput?.command ?? "") | ||
| ? deny("DROP blocked outside the Faz MCP path") | ||
| : allow(); | ||
| }, | ||
| }); | ||
|
|
||
| The two compose: Faz inside the MCP path, hooks on everything that bypasses it. | ||
| ``` |
There was a problem hiding this comment.
HN formatting: remove the outer fenced code block and render only the policy snippet as preformatted text.
Right now the entire reply (prose + policy snippet) is wrapped in a triple-backtick fence (Line 17-37). That will cause the whole comment to render as code on HN, and HN does not support CommonMark triple-backtick fenced code blocks. (news.ycombinator.com)
Also, this is exactly what triggers the markdownlint MD040 warning about missing fenced-code language at Line 17.
Suggested shape:
- Make the prose outside of any triple-backtick fences.
- For the
block-bash-dropsnippet, use HN-friendly indented code (4 spaces per line) instead of ``` fences (so markdownlint also won’t complain).
Proposed edit (formatting only)
## My reply
-```
-(disclosure: I work on FailProof AI: https://github.com/exospherehost/failproofai)
+ (disclosure: I work on FailProof AI: https://github.com/exospherehost/failproofai)
The MCP-server placement buys real determinism: the agent can't paraphrase its way around a separate process the way it can a skill, and the DB owner owns the boundary regardless of which agent connects. The tradeoff is coverage. Faz catches DB calls that route through the MCP. If the agent has Bash and runs psql -c "DROP TABLE...", or writes a migration file CI applies later, the safety net never sees it.
That bypass is the seam PreToolUse hooks work at. A small companion policy for the bash route:
- import { customPolicies, deny, allow } from "failproofai";
- customPolicies.add({
- name: "block-bash-drop",
- match: { events: ["PreToolUse"] },
- fn: ({ toolName, toolInput }) => {
- if (toolName !== "Bash") return allow();
- return /\bDROP\s+(TABLE|DATABASE)\b/i.test(toolInput?.command ?? "")
- ? deny("DROP blocked outside the Faz MCP path")
- : allow();
- },
- });
-
-The two compose: Faz inside the MCP path, hooks on everything that bypasses it.
-```
+ import { customPolicies, deny, allow } from "failproofai";
+ customPolicies.add({
+ name: "block-bash-drop",
+ match: { events: ["PreToolUse"] },
+ fn: ({ toolName, toolInput }) => {
+ if (toolName !== "Bash") return allow();
+ return /\bDROP\s+(TABLE|DATABASE)\b/i.test(toolInput?.command ?? "")
+ ? deny("DROP blocked outside the Faz MCP path")
+ : allow();
+ },
+ });
+
+The two compose: Faz inside the MCP path, hooks on everything that bypasses it.🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 17-17: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@drafts/2026-05-04T142954Z.md` around lines 15 - 37, The whole reply is
wrapped in a triple-backtick fence causing HN to render all prose as code and
triggering markdownlint MD040; un-wrap the prose so only the policy snippet is
preformatted, remove the outer ``` block around the entire section, and render
the block-bash-drop policy using HN-friendly indented code (4 spaces per line)
instead of fenced code; specifically edit the text around the customPolicies.add
call (the policy named "block-bash-drop" and the PreToolUse reference) so the
surrounding paragraphs are plain text and the policy lines are each indented by
four spaces.
Summary
Show HN: Safety layer between AI agents and databases(Faz, https://news.ycombinator.com/item?id=48008603), an MCP-server middleware that intercepts queries between AI agents and a database.Bashrunningpsql -c "DROP TABLE..."orWriteto a migration file CI later applies bypasses it.block-bash-dropatPreToolUse) tied to that exact bypass route, plus a co-existence framing: Faz inside the MCP path, hooks on everything else.Discovery + thread URLs
/ask,/show,/news,/shownew, then ran Algolia sweeps forclaude code deleted,agent force pushed,agent rm -rf,claude code hooks,agent sandbox,agent tool call policy,cursor deleted. The/shownewfeed surfaced the Faz Show HN about an hour into its life.Anti-pitch gate (matches working shape)
Files
drafts/2026-05-04T142954Z.md— full draft + insight + notes perINSTRUCTIONS.mdWrites section.Test plan
My replyblock into the HN composer at https://news.ycombinator.com/item?id=48008603 as a top-level reply, post, then ask Claude to log the comment permalink undercomments/.Summary by CodeRabbit