thumbgate 1.27.8 → 1.27.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.well-known/llms.txt +1 -2
  3. package/.well-known/mcp/server-card.json +1 -1
  4. package/README.md +4 -2
  5. package/adapters/claude/.mcp.json +2 -2
  6. package/adapters/mcp/server-stdio.js +1 -1
  7. package/adapters/opencode/opencode.json +1 -1
  8. package/bin/cli.js +259 -78
  9. package/config/gate-templates.json +228 -0
  10. package/config/gates/claim-verification.json +18 -0
  11. package/package.json +14 -21
  12. package/public/blog.html +30 -0
  13. package/public/compare/adopt-ai.html +219 -0
  14. package/public/compare/agentix-labs.html +197 -0
  15. package/public/compare/ai-experience-orchestration.html +216 -0
  16. package/public/compare/anthropic-claude-for-legal.html +260 -0
  17. package/public/compare/anthropic-containment.html +280 -0
  18. package/public/compare/arcade.html +175 -0
  19. package/public/compare/arcjet.html +239 -0
  20. package/public/compare/bumblebee.html +307 -0
  21. package/public/compare/claude-code-hooks.html +294 -0
  22. package/public/compare/databricks-unity-ai-gateway.html +215 -0
  23. package/public/compare/fallow.html +351 -0
  24. package/public/compare/heidi.html +233 -0
  25. package/public/compare/mem0.html +342 -0
  26. package/public/compare/oak-and-sparrow-gatekeeper.html +289 -0
  27. package/public/compare/rein.html +236 -0
  28. package/public/compare/sigmashake.html +256 -0
  29. package/public/compare/speclock.html +342 -0
  30. package/public/compare.html +2 -0
  31. package/public/guides/agent-harness-optimization.html +342 -0
  32. package/public/guides/agentic-web-governance.html +406 -0
  33. package/public/guides/ai-agent-governance-sprint.html +415 -0
  34. package/public/guides/ai-agent-pre-action-approval-gates.html +401 -0
  35. package/public/guides/ai-agent-workflow-migration-checklist.html +392 -0
  36. package/public/guides/ai-deployment-readiness.html +415 -0
  37. package/public/guides/ai-mode-ads-agent-governance.html +401 -0
  38. package/public/guides/ai-search-topical-presence.html +342 -0
  39. package/public/guides/autoresearch-agent-safety.html +342 -0
  40. package/public/guides/background-agent-governance.html +358 -0
  41. package/public/guides/best-tools-stop-ai-agents-breaking-production.html +363 -0
  42. package/public/guides/browser-automation-safety.html +342 -0
  43. package/public/guides/chatgpt-ads-trust.html +353 -0
  44. package/public/guides/claude-code-feedback.html +339 -0
  45. package/public/guides/claude-code-prevent-repeated-mistakes.html +161 -0
  46. package/public/guides/claude-code-skills-guardrails.html +343 -0
  47. package/public/guides/claude-desktop.html +356 -0
  48. package/public/guides/code-knowledge-graph-guardrails.html +365 -0
  49. package/public/guides/codex-cli-guardrails.html +339 -0
  50. package/public/guides/cursor-agent-guardrails.html +339 -0
  51. package/public/guides/cursor-prevent-repeated-mistakes.html +161 -0
  52. package/public/guides/database-agent-safety.html +406 -0
  53. package/public/guides/deepseek-v4-runtime-guardrails.html +346 -0
  54. package/public/guides/developer-machine-supply-chain-guardrails.html +358 -0
  55. package/public/guides/gcp-mcp-guardrails.html +147 -0
  56. package/public/guides/gemini-cli-feedback-memory.html +339 -0
  57. package/public/guides/gpt-5-5-model-evaluation.html +358 -0
  58. package/public/guides/internal-ai-engineering-stack-guardrails.html +348 -0
  59. package/public/guides/long-running-agent-context-management.html +346 -0
  60. package/public/guides/mcp-tool-governance.html +401 -0
  61. package/public/guides/multica-thumbgate-setup.html +134 -0
  62. package/public/guides/native-messaging-host-security.html +342 -0
  63. package/public/guides/policy-engine-pre-action-gates.html +346 -0
  64. package/public/guides/pre-action-checks.html +342 -0
  65. package/public/guides/pretooluse-hooks-vs-advisory-prompt-rules.html +342 -0
  66. package/public/guides/prompt-tricks-to-workflow-rules.html +365 -0
  67. package/public/guides/proxy-pointer-rag-guardrails.html +352 -0
  68. package/public/guides/rag-precision-tuning-guardrails.html +352 -0
  69. package/public/guides/reasoning-compression-guardrails.html +346 -0
  70. package/public/guides/relational-knowledge-ai-recommendations.html +342 -0
  71. package/public/guides/roo-code-alternative-cline.html +339 -0
  72. package/public/guides/semantic-programmatic-seo-guardrails.html +352 -0
  73. package/public/guides/seo-agent-skills-guardrails.html +344 -0
  74. package/public/guides/stop-repeated-ai-agent-mistakes.html +342 -0
  75. package/public/index.html +192 -50
  76. package/public/learn/ac-dc-runtime-enforcement.html +277 -0
  77. package/public/learn/agent-harness-pattern.html +181 -0
  78. package/public/learn/agent-identity-connector-governance.html +146 -0
  79. package/public/learn/agent-swarms-shared-gates.html +173 -0
  80. package/public/learn/agentic-enterprise-context-brain.html +117 -0
  81. package/public/learn/agentic-os-team-governance.html +146 -0
  82. package/public/learn/ai-agent-governance.html +158 -0
  83. package/public/learn/ai-agent-persistent-memory.html +211 -0
  84. package/public/learn/anthropomorphic-claim-gates.html +180 -0
  85. package/public/learn/background-agent-control-layer.html +184 -0
  86. package/public/learn/claude-code-goal-with-rubrics.html +205 -0
  87. package/public/learn/codex-role-plugins-need-governance.html +125 -0
  88. package/public/learn/cost-aware-agent-gate-routing.html +173 -0
  89. package/public/learn/databricks-unity-ai-gateway-runtime-governance.html +157 -0
  90. package/public/learn/deterministic-agent-workflows.html +185 -0
  91. package/public/learn/feedback-loop-vs-decision-layer.html +283 -0
  92. package/public/learn/from-prototype-to-production.html +223 -0
  93. package/public/learn/learn.css +51 -0
  94. package/public/learn/mcp-pre-action-checks-explained.html +172 -0
  95. package/public/learn/pretix-stripe-connect-marketplaces.html +161 -0
  96. package/public/learn/regulated-agent-execution-boundary.html +196 -0
  97. package/public/learn/spec-driven-development.html +168 -0
  98. package/public/learn/stop-ai-agent-force-push.html +134 -0
  99. package/public/learn/vibe-coding-safety-net.html +142 -0
  100. package/public/learn.html +34 -50
  101. package/public/numbers.html +2 -2
  102. package/public/pro.html +6 -6
  103. package/scripts/cli-schema.js +10 -22
  104. package/scripts/dashboard-chat.js +1 -2
  105. package/scripts/document-intake.js +49 -1
  106. package/scripts/gemini-embedding-policy.js +1 -2
  107. package/scripts/hook-stop-anti-claim.js +103 -42
  108. package/scripts/hosted-config.js +12 -0
  109. package/scripts/plausible-domain-config.js +1 -3
  110. package/scripts/reddit-browser-notification-watch.js +230 -0
  111. package/scripts/seo-gsd.js +0 -239
  112. package/scripts/tool-registry.js +2 -2
  113. package/scripts/vector-store.js +0 -44
  114. package/scripts/workspace-evolver.js +2 -62
  115. package/src/api/server.js +126 -335
  116. package/adapters/policy-engine/ethicore-guardian-client.js +0 -68
  117. package/adapters/policy-engine/thumbgate-policy-engine-adapter.js +0 -260
@@ -0,0 +1,342 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Pre-Action Checks for AI Coding Agents | ThumbGate Guide</title>
7
+ <meta name="description" content="Pre-action gates stop the risky move before the agent executes it. ThumbGate uses thumbs-up/down feedback to decide what should be reinforced, warned, or blo..." />
8
+ <meta property="og:title" content="Pre-Action Checks for AI Coding Agents | ThumbGate Guide" />
9
+ <meta property="og:description" content="Pre-action gates stop the risky move before the agent executes it. ThumbGate uses thumbs-up/down feedback to decide what should be reinforced, warned, or blo..." />
10
+ <meta property="og:type" content="article" />
11
+ <meta property="og:url" content="https://thumbgate.ai/guides/pre-action-checks" />
12
+ <link rel="canonical" href="https://thumbgate.ai/guides/pre-action-checks" />
13
+ <link rel="llm-context" href="/llm-context.md" type="text/markdown" />
14
+ <link rel="icon" type="image/svg+xml" href="/thumbgate-icon.png" />
15
+ <link rel="apple-touch-icon" href="/assets/brand/thumbgate-mark.svg" />
16
+ <meta property="og:image" content="/og.png" />
17
+ <style>
18
+ :root {
19
+ --bg: #0a0a0b;
20
+ --bg-raised: #111113;
21
+ --bg-card: #161618;
22
+ --line: #222225;
23
+ --text: #e8e8ec;
24
+ --muted: #8b8b96;
25
+ --cyan: #22d3ee;
26
+ --green: #4ade80;
27
+ --red: #f87171;
28
+ }
29
+ * { box-sizing: border-box; }
30
+ body {
31
+ margin: 0;
32
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
33
+ background: var(--bg);
34
+ color: var(--text);
35
+ line-height: 1.65;
36
+ }
37
+ a { color: var(--cyan); text-decoration: none; }
38
+ a:hover { text-decoration: underline; }
39
+ .container { max-width: 980px; margin: 0 auto; padding: 0 24px; }
40
+ .topbar {
41
+ position: sticky;
42
+ top: 0;
43
+ z-index: 20;
44
+ backdrop-filter: blur(12px);
45
+ background: rgba(10, 10, 11, 0.88);
46
+ border-bottom: 1px solid var(--line);
47
+ }
48
+ .topbar .container {
49
+ display: flex;
50
+ justify-content: space-between;
51
+ align-items: center;
52
+ padding-top: 14px;
53
+ padding-bottom: 14px;
54
+ }
55
+ .brand {
56
+ font-weight: 700;
57
+ color: var(--text);
58
+ display: inline-flex;
59
+ align-items: center;
60
+ gap: 8px;
61
+ text-decoration: none;
62
+ }
63
+ .brand .logo-mark { width: 28px; height: 28px; display: block; }
64
+ .hero { padding: 72px 0 32px; }
65
+ .eyebrow {
66
+ display: inline-flex;
67
+ align-items: center;
68
+ gap: 8px;
69
+ padding: 6px 12px;
70
+ border-radius: 999px;
71
+ border: 1px solid rgba(34, 211, 238, 0.22);
72
+ background: rgba(34, 211, 238, 0.1);
73
+ color: var(--cyan);
74
+ text-transform: uppercase;
75
+ letter-spacing: 0.08em;
76
+ font-size: 12px;
77
+ font-weight: 700;
78
+ }
79
+ h1 {
80
+ font-size: clamp(34px, 5vw, 56px);
81
+ line-height: 1.06;
82
+ letter-spacing: -0.04em;
83
+ margin: 16px 0;
84
+ max-width: 760px;
85
+ }
86
+ .hero p {
87
+ max-width: 720px;
88
+ color: var(--muted);
89
+ font-size: 18px;
90
+ }
91
+ .signal-row {
92
+ display: flex;
93
+ flex-wrap: wrap;
94
+ gap: 12px;
95
+ margin: 28px 0 0;
96
+ }
97
+ .signal-pill {
98
+ display: inline-flex;
99
+ align-items: center;
100
+ gap: 8px;
101
+ padding: 10px 14px;
102
+ border-radius: 999px;
103
+ border: 1px solid var(--line);
104
+ background: var(--bg-raised);
105
+ font-weight: 600;
106
+ font-size: 14px;
107
+ }
108
+ .signal-pill.up {
109
+ border-color: rgba(74, 222, 128, 0.28);
110
+ color: #b8f7c8;
111
+ background: rgba(74, 222, 128, 0.1);
112
+ }
113
+ .signal-pill.down {
114
+ border-color: rgba(248, 113, 113, 0.28);
115
+ color: #ffc0c0;
116
+ background: rgba(248, 113, 113, 0.1);
117
+ }
118
+ .grid {
119
+ display: grid;
120
+ grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
121
+ gap: 24px;
122
+ padding-bottom: 72px;
123
+ }
124
+ .card, .detail-section, .sidebar-card {
125
+ background: var(--bg-card);
126
+ border: 1px solid var(--line);
127
+ border-radius: 16px;
128
+ }
129
+ .card { padding: 24px; }
130
+ .detail-section { padding: 24px; margin-bottom: 18px; }
131
+ .detail-section h2 { margin: 0 0 12px; font-size: 24px; letter-spacing: -0.03em; }
132
+ .detail-section p { color: var(--muted); }
133
+ .detail-section ul, .card ul { padding-left: 18px; color: var(--muted); }
134
+ .card h2 { margin-top: 0; }
135
+ .sidebar {
136
+ display: flex;
137
+ flex-direction: column;
138
+ gap: 18px;
139
+ }
140
+ .sidebar-card {
141
+ padding: 20px;
142
+ }
143
+ /* Only the first sidebar card sticks. Stacking multiple stickies at the
144
+ same top offset makes them overlap each other on scroll. The related-
145
+ pages card flows normally below. */
146
+ .sidebar-card:first-child {
147
+ position: sticky;
148
+ top: 84px;
149
+ max-height: calc(100vh - 104px);
150
+ overflow-y: auto;
151
+ -webkit-overflow-scrolling: touch;
152
+ }
153
+ .proof-links {
154
+ display: flex;
155
+ flex-wrap: wrap;
156
+ gap: 12px;
157
+ margin-top: 16px;
158
+ }
159
+ .cta-button {
160
+ display: inline-flex;
161
+ align-items: center;
162
+ justify-content: center;
163
+ margin-top: 18px;
164
+ padding: 12px 16px;
165
+ border-radius: 10px;
166
+ background: var(--cyan);
167
+ color: #071116;
168
+ font-weight: 700;
169
+ text-decoration: none;
170
+ }
171
+ .faq-item {
172
+ border-top: 1px solid var(--line);
173
+ padding: 14px 0;
174
+ }
175
+ .faq-item summary {
176
+ cursor: pointer;
177
+ font-weight: 600;
178
+ }
179
+ .faq-item p {
180
+ color: var(--muted);
181
+ }
182
+ .related-card {
183
+ display: block;
184
+ padding: 14px;
185
+ border-radius: 12px;
186
+ border: 1px solid var(--line);
187
+ background: var(--bg-raised);
188
+ margin-top: 12px;
189
+ color: var(--text);
190
+ }
191
+ .related-label {
192
+ display: block;
193
+ color: var(--muted);
194
+ font-size: 12px;
195
+ text-transform: uppercase;
196
+ letter-spacing: 0.08em;
197
+ margin-bottom: 4px;
198
+ }
199
+ @media (max-width: 860px) {
200
+ .grid {
201
+ grid-template-columns: 1fr;
202
+ }
203
+ .sidebar-card:first-child {
204
+ position: static;
205
+ max-height: none;
206
+ overflow: visible;
207
+ }
208
+ }
209
+ </style>
210
+ <script type="application/ld+json">
211
+ {
212
+ "@context": "https://schema.org",
213
+ "@type": "TechArticle",
214
+ "headline": "What Are Pre-Action Checks?",
215
+ "description": "Pre-action gates stop the risky move before the agent executes it. ThumbGate uses thumbs-up/down feedback to decide what should be reinforced, warned, or blo...",
216
+ "about": [
217
+ "claude code masterclass guardrails",
218
+ "cursor prevent repeated mistakes",
219
+ "claude code prevent repeated mistakes",
220
+ "codex cli guardrails"
221
+ ],
222
+ "url": "https://thumbgate.ai/guides/pre-action-checks",
223
+ "publisher": {
224
+ "@type": "Organization",
225
+ "name": "ThumbGate",
226
+ "url": "https://thumbgate.ai"
227
+ },
228
+ "mainEntityOfPage": "https://thumbgate.ai/guides/pre-action-checks"
229
+ }
230
+ </script>
231
+ <script type="application/ld+json">
232
+ {
233
+ "@context": "https://schema.org",
234
+ "@type": "FAQPage",
235
+ "mainEntity": [
236
+ {
237
+ "@type": "Question",
238
+ "name": "How are pre-action checks different from prompt rules?",
239
+ "acceptedAnswer": {
240
+ "@type": "Answer",
241
+ "text": "Prompt rules ask the model nicely. Pre-action gates intercept the tool call and block it before execution when the known-bad pattern matches."
242
+ }
243
+ },
244
+ {
245
+ "@type": "Question",
246
+ "name": "Can a thumbs up matter too?",
247
+ "acceptedAnswer": {
248
+ "@type": "Answer",
249
+ "text": "Yes. ThumbGate explicitly uses thumbs up to reinforce successful behavior so the system is not only punitive."
250
+ }
251
+ }
252
+ ]
253
+ }
254
+ </script>
255
+ </head>
256
+ <body>
257
+ <div class="topbar">
258
+ <div class="container">
259
+ <a class="brand" href="/"><img src="/assets/brand/thumbgate-mark-inline.svg" alt="ThumbGate" class="logo-mark" width="28" height="28"><span class="logo-text">ThumbGate</span></a>
260
+ <a href="https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/VERIFICATION_EVIDENCE.md" target="_blank" rel="noopener">Verification evidence</a>
261
+ </div>
262
+ </div>
263
+
264
+ <main class="container">
265
+ <section class="hero">
266
+ <div class="eyebrow">guide | pre-action checks for ai coding agents</div>
267
+ <h1>What Are Pre-Action Checks?</h1>
268
+ <p>Pre-action gates stop the risky move before the agent executes it. ThumbGate uses thumbs-up/down feedback to decide what should be reinforced, warned, or blocked.</p>
269
+ <div class="signal-row">
270
+ <div class="signal-pill up">👍 Thumbs up reinforces good behavior</div>
271
+ <div class="signal-pill down">👎 Thumbs down blocks repeated mistakes</div>
272
+ </div>
273
+ </section>
274
+
275
+ <section class="grid">
276
+ <div>
277
+ <div class="card">
278
+ <h2>Why this page exists</h2>
279
+ <ul><li>Prompt rules are advisory. Pre-action gates are enforcement.</li><li>A repeated thumbs down can become a warning gate or a hard block.</li><li>The right proof asset is not the rule text alone but the evidence that the gate fired before damage.</li></ul>
280
+ </div>
281
+
282
+ <section class="detail-section">
283
+ <h2>Why this matters</h2>
284
+ <p>Most AI coding failures are not mysterious. They are repeated mistakes: force-pushes, destructive scripts, missed verification steps, or breaking architectural constraints.</p><p>A pre-action check turns that failure pattern into a runtime checkpoint. The agent sees the stop before the bad action lands.</p>
285
+
286
+ </section>
287
+ <section class="detail-section">
288
+ <h2>How ThumbGate makes the loop useful</h2>
289
+
290
+ <ul><li>Capture structured thumbs-up/down feedback.</li><li>Promote repeated failures into prevention rules.</li><li>Score and enforce the rules with Thompson Sampling and pre-action hooks.</li><li>Publish verification evidence so the system is auditable.</li></ul>
291
+ </section>
292
+ <section class="detail-section">
293
+ <h2>Best next step</h2>
294
+ <p>If a buyer is exploring the category, this page should move them to either a comparison page or the main product proof pack.</p>
295
+
296
+ </section>
297
+ <div class="detail-section">
298
+ <h2>FAQ</h2>
299
+
300
+ <details class="faq-item">
301
+ <summary>How are pre-action checks different from prompt rules?</summary>
302
+ <p>Prompt rules ask the model nicely. Pre-action gates intercept the tool call and block it before execution when the known-bad pattern matches.</p>
303
+ </details>
304
+ <details class="faq-item">
305
+ <summary>Can a thumbs up matter too?</summary>
306
+ <p>Yes. ThumbGate explicitly uses thumbs up to reinforce successful behavior so the system is not only punitive.</p>
307
+ </details>
308
+ </div>
309
+ </div>
310
+
311
+ <aside class="sidebar">
312
+
313
+
314
+
315
+
316
+ <div class="sidebar-card">
317
+ <h2>GSD execution brief</h2>
318
+ <p>This page was prioritized because it captures high-intent demand around pre-action checks for ai coding agents and feeds directly into ThumbGate's proof-led conversion path.</p>
319
+ <p><strong>Opportunity score:</strong> 83</p>
320
+ <p><strong>Primary persona:</strong> engineering-lead</p>
321
+ <p><strong>Keyword cluster:</strong> claude code masterclass guardrails, cursor prevent repeated mistakes, claude code prevent repeated mistakes, codex cli guardrails</p>
322
+ <p><strong>Pricing:</strong> Pro $19/mo or $149/yr. Team $49/seat/mo.</p>
323
+ <div class="proof-links"><a href="https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/VERIFICATION_EVIDENCE.md" target="_blank" rel="noopener">Verification evidence</a><a href="https://github.com/IgorGanapolsky/ThumbGate/blob/main/proof/automation/report.json" target="_blank" rel="noopener">Automation proof</a><a href="https://github.com/IgorGanapolsky/ThumbGate" target="_blank" rel="noopener">GitHub repository</a></div>
324
+ <a class="cta-button" href="/checkout/pro?utm_source=website&amp;utm_medium=seo_page&amp;utm_campaign=guides_pre-action-checks&amp;cta_placement=seo_brief&amp;plan_id=pro" target="_blank" rel="noopener">Go Pro — $19/mo</a>
325
+ </div>
326
+ <div class="sidebar-card">
327
+ <h2>Related pages</h2>
328
+
329
+ <a class="related-card" href="/compare/speclock">
330
+ <span class="related-label">Related page</span>
331
+ <strong>ThumbGate vs SpecLock</strong>
332
+ </a>
333
+ <a class="related-card" href="/guides/claude-code-feedback">
334
+ <span class="related-label">Related page</span>
335
+ <strong>Claude Code Feedback Memory That Actually Enforces</strong>
336
+ </a>
337
+ </div>
338
+ </aside>
339
+ </section>
340
+ </main>
341
+ </body>
342
+ </html>
@@ -0,0 +1,342 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>PreToolUse Hooks vs Advisory Prompt Rules: Secure AI Coding Agents | ThumbGate</title>
7
+ <meta name="description" content="Prompt files like .cursorrules or CLAUDE.md are advisory guidelines that agents can ignore or bypass. Learn why PreToolUse hooks provide deterministic security." />
8
+ <meta property="og:title" content="PreToolUse Hooks vs Advisory Prompt Rules: Secure AI Coding Agents | ThumbGate" />
9
+ <meta property="og:description" content="Prompt files like .cursorrules or CLAUDE.md are advisory guidelines that agents can ignore or bypass. Learn why PreToolUse hooks provide deterministic security." />
10
+ <meta property="og:type" content="article" />
11
+ <meta property="og:url" content="https://thumbgate.ai/guides/pretooluse-hooks-vs-advisory-prompt-rules" />
12
+ <link rel="canonical" href="https://thumbgate.ai/guides/pretooluse-hooks-vs-advisory-prompt-rules" />
13
+ <link rel="llm-context" href="/llm-context.md" type="text/markdown" />
14
+ <link rel="icon" type="image/svg+xml" href="/thumbgate-icon.png" />
15
+ <link rel="apple-touch-icon" href="/assets/brand/thumbgate-mark.svg" />
16
+ <meta property="og:image" content="/og.png" />
17
+ <style>
18
+ :root {
19
+ --bg: #0a0a0b;
20
+ --bg-raised: #111113;
21
+ --bg-card: #161618;
22
+ --line: #222225;
23
+ --text: #e8e8ec;
24
+ --muted: #8b8b96;
25
+ --cyan: #22d3ee;
26
+ --green: #4ade80;
27
+ --red: #f87171;
28
+ }
29
+ * { box-sizing: border-box; }
30
+ body {
31
+ margin: 0;
32
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
33
+ background: var(--bg);
34
+ color: var(--text);
35
+ line-height: 1.65;
36
+ }
37
+ a { color: var(--cyan); text-decoration: none; }
38
+ a:hover { text-decoration: underline; }
39
+ .container { max-width: 980px; margin: 0 auto; padding: 0 24px; }
40
+ .topbar {
41
+ position: sticky;
42
+ top: 0;
43
+ z-index: 20;
44
+ backdrop-filter: blur(12px);
45
+ background: rgba(10, 10, 11, 0.88);
46
+ border-bottom: 1px solid var(--line);
47
+ }
48
+ .topbar .container {
49
+ display: flex;
50
+ justify-content: space-between;
51
+ align-items: center;
52
+ padding-top: 14px;
53
+ padding-bottom: 14px;
54
+ }
55
+ .brand {
56
+ font-weight: 700;
57
+ color: var(--text);
58
+ display: inline-flex;
59
+ align-items: center;
60
+ gap: 8px;
61
+ text-decoration: none;
62
+ }
63
+ .brand .logo-mark { width: 28px; height: 28px; display: block; }
64
+ .hero { padding: 72px 0 32px; }
65
+ .eyebrow {
66
+ display: inline-flex;
67
+ align-items: center;
68
+ gap: 8px;
69
+ padding: 6px 12px;
70
+ border-radius: 999px;
71
+ border: 1px solid rgba(34, 211, 238, 0.22);
72
+ background: rgba(34, 211, 238, 0.1);
73
+ color: var(--cyan);
74
+ text-transform: uppercase;
75
+ letter-spacing: 0.08em;
76
+ font-size: 12px;
77
+ font-weight: 700;
78
+ }
79
+ h1 {
80
+ font-size: clamp(34px, 5vw, 56px);
81
+ line-height: 1.06;
82
+ letter-spacing: -0.04em;
83
+ margin: 16px 0;
84
+ max-width: 760px;
85
+ }
86
+ .hero p {
87
+ max-width: 720px;
88
+ color: var(--muted);
89
+ font-size: 18px;
90
+ }
91
+ .signal-row {
92
+ display: flex;
93
+ flex-wrap: wrap;
94
+ gap: 12px;
95
+ margin: 28px 0 0;
96
+ }
97
+ .signal-pill {
98
+ display: inline-flex;
99
+ align-items: center;
100
+ gap: 8px;
101
+ padding: 10px 14px;
102
+ border-radius: 999px;
103
+ border: 1px solid var(--line);
104
+ background: var(--bg-raised);
105
+ font-weight: 600;
106
+ font-size: 14px;
107
+ }
108
+ .signal-pill.up {
109
+ border-color: rgba(74, 222, 128, 0.28);
110
+ color: #b8f7c8;
111
+ background: rgba(74, 222, 128, 0.1);
112
+ }
113
+ .signal-pill.down {
114
+ border-color: rgba(248, 113, 113, 0.28);
115
+ color: #ffc0c0;
116
+ background: rgba(248, 113, 113, 0.1);
117
+ }
118
+ .grid {
119
+ display: grid;
120
+ grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
121
+ gap: 24px;
122
+ padding-bottom: 72px;
123
+ }
124
+ .card, .detail-section, .sidebar-card {
125
+ background: var(--bg-card);
126
+ border: 1px solid var(--line);
127
+ border-radius: 16px;
128
+ }
129
+ .card { padding: 24px; }
130
+ .detail-section { padding: 24px; margin-bottom: 18px; }
131
+ .detail-section h2 { margin: 0 0 12px; font-size: 24px; letter-spacing: -0.03em; }
132
+ .detail-section p { color: var(--muted); }
133
+ .detail-section ul, .card ul { padding-left: 18px; color: var(--muted); }
134
+ .card h2 { margin-top: 0; }
135
+ .sidebar {
136
+ display: flex;
137
+ flex-direction: column;
138
+ gap: 18px;
139
+ }
140
+ .sidebar-card {
141
+ padding: 20px;
142
+ }
143
+ .sidebar-card:first-child {
144
+ position: sticky;
145
+ top: 84px;
146
+ max-height: calc(100vh - 104px);
147
+ overflow-y: auto;
148
+ -webkit-overflow-scrolling: touch;
149
+ }
150
+ .proof-links {
151
+ display: flex;
152
+ flex-wrap: wrap;
153
+ gap: 12px;
154
+ margin-top: 16px;
155
+ }
156
+ .cta-button {
157
+ display: inline-flex;
158
+ align-items: center;
159
+ justify-content: center;
160
+ margin-top: 18px;
161
+ padding: 12px 16px;
162
+ border-radius: 10px;
163
+ background: var(--cyan);
164
+ color: #071116;
165
+ font-weight: 700;
166
+ text-decoration: none;
167
+ }
168
+ .faq-item {
169
+ border-top: 1px solid var(--line);
170
+ padding: 14px 0;
171
+ }
172
+ .faq-item summary {
173
+ cursor: pointer;
174
+ font-weight: 600;
175
+ }
176
+ .faq-item p {
177
+ color: var(--muted);
178
+ }
179
+ .related-card {
180
+ display: block;
181
+ padding: 14px;
182
+ border-radius: 12px;
183
+ border: 1px solid var(--line);
184
+ background: var(--bg-raised);
185
+ margin-top: 12px;
186
+ color: var(--text);
187
+ }
188
+ .related-label {
189
+ display: block;
190
+ color: var(--muted);
191
+ font-size: 12px;
192
+ text-transform: uppercase;
193
+ letter-spacing: 0.08em;
194
+ margin-bottom: 4px;
195
+ }
196
+ @media (max-width: 860px) {
197
+ .grid {
198
+ grid-template-columns: 1fr;
199
+ }
200
+ .sidebar-card:first-child {
201
+ position: static;
202
+ max-height: none;
203
+ overflow: visible;
204
+ }
205
+ }
206
+ </style>
207
+ <script type="application/ld+json">
208
+ {
209
+ "@context": "https://schema.org",
210
+ "@type": "TechArticle",
211
+ "headline": "PreToolUse Hooks vs Advisory Prompt Rules: Secure AI Coding Agents",
212
+ "description": "Prompt files like .cursorrules or CLAUDE.md are advisory guidelines that agents can ignore or bypass. Learn why PreToolUse hooks provide deterministic security.",
213
+ "about": [
214
+ "pretooluse hooks vs advisory prompt rules",
215
+ "claude code security",
216
+ "cursor rules bypass",
217
+ "mcp security"
218
+ ],
219
+ "url": "https://thumbgate.ai/guides/pretooluse-hooks-vs-advisory-prompt-rules",
220
+ "publisher": {
221
+ "@type": "Organization",
222
+ "name": "ThumbGate",
223
+ "url": "https://thumbgate.ai"
224
+ },
225
+ "mainEntityOfPage": "https://thumbgate.ai/guides/pretooluse-hooks-vs-advisory-prompt-rules"
226
+ }
227
+ </script>
228
+ <script type="application/ld+json">
229
+ {
230
+ "@context": "https://schema.org",
231
+ "@type": "FAQPage",
232
+ "mainEntity": [
233
+ {
234
+ "@type": "Question",
235
+ "name": "Why are CLAUDE.md and .cursorrules files insufficient for security?",
236
+ "acceptedAnswer": {
237
+ "@type": "Answer",
238
+ "text": "They are advisory prompt-level files. The agent can ignore them, overwrite them, suffer from context drift, or be jailbroken into bypassing them since they are not enforced at the runtime level."
239
+ }
240
+ },
241
+ {
242
+ "@type": "Question",
243
+ "name": "How does a PreToolUse hook protect the codebase?",
244
+ "acceptedAnswer": {
245
+ "@type": "Answer",
246
+ "text": "PreToolUse hooks intercept tool calls at the protocol layer before they are executed. If a command matches a blocked pattern, the hook denies execution, making safety deterministic rather than probabilistic."
247
+ }
248
+ }
249
+ ]
250
+ }
251
+ </script>
252
+ </head>
253
+ <body>
254
+ <div class="topbar">
255
+ <div class="container">
256
+ <a class="brand" href="/"><img src="/assets/brand/thumbgate-mark-inline.svg" alt="ThumbGate" class="logo-mark" width="28" height="28"><span class="logo-text">ThumbGate</span></a>
257
+ <a href="https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/VERIFICATION_EVIDENCE.md" target="_blank" rel="noopener">Verification evidence</a>
258
+ </div>
259
+ </div>
260
+
261
+ <main class="container">
262
+ <section class="hero">
263
+ <div class="eyebrow">guide | pretooluse hooks vs advisory prompt rules</div>
264
+ <h1>PreToolUse Hooks vs Advisory Prompt Rules</h1>
265
+ <p>Why files like .cursorrules and CLAUDE.md cannot protect your codebase from high-risk agent operations, and how protocol-level PreToolUse hooks enforce deterministic safety.</p>
266
+ <div class="signal-row">
267
+ <div class="signal-pill up">👍 PreToolUse: Deterministic Protocol Blocking</div>
268
+ <div class="signal-pill down">👎 Prompt Rules: Easily Ignored or Jailbroken</div>
269
+ </div>
270
+ </section>
271
+
272
+ <section class="grid">
273
+ <div>
274
+ <div class="card">
275
+ <h2>Why this page exists</h2>
276
+ <ul>
277
+ <li>Advisory files like CLAUDE.md are hints that the model can choose to ignore under pressure.</li>
278
+ <li>Real security requires blocking unsafe operations before they hit the terminal or file system.</li>
279
+ <li>PreToolUse hooks provide protocol-level enforcement that cannot be bypassed by agent reasoning.</li>
280
+ </ul>
281
+ </div>
282
+
283
+ <section class="detail-section">
284
+ <h2>The Vulnerability of Prompt-Level Rules</h2>
285
+ <p>Files like <code>.cursorrules</code>, <code>CLAUDE.md</code>, or custom prompt instructions are simply part of the model's context window. They instruct the model on how it <em>should</em> behave. However, this model suffers from structural weaknesses:</p>
286
+ <ul>
287
+ <li><strong>Context Drift:</strong> As conversations grow, early prompt instructions are deprioritized or pushed out of attention.</li>
288
+ <li><strong>Jailbreaking:</strong> The user prompt or an external file read can override instructions, forcing the agent to bypass its own rules.</li>
289
+ <li><strong>Self-Modification:</strong> Agents with file-writing privileges can edit or delete <code>.cursorrules</code> files to bypass constraints.</li>
290
+ </ul>
291
+ </section>
292
+
293
+ <section class="detail-section">
294
+ <h2>Deterministic PreToolUse Hook Enforcement</h2>
295
+ <p>A <code>PreToolUse</code> hook intercepts execution at the Model Context Protocol (MCP) or platform layer. When the agent attempts to run a bash command, modify a file, or query a database, the call is evaluated by a local policy engine before execution.</p>
296
+ <p>If the action matches a known-bad pattern or violates a policy, the hook blocks it and returns a structured error response. The agent is physically stopped, preserving the system state and preventing the error before it can happen.</p>
297
+ </section>
298
+
299
+ <div class="detail-section">
300
+ <h2>FAQ</h2>
301
+ <details class="faq-item">
302
+ <summary>Why are CLAUDE.md and .cursorrules files insufficient for security?</summary>
303
+ <p>They are advisory prompt-level files. The agent can ignore them, overwrite them, suffer from context drift, or be jailbroken into bypassing them since they are not enforced at the runtime level.</p>
304
+ </details>
305
+ <details class="faq-item">
306
+ <summary>How does a PreToolUse hook protect the codebase?</summary>
307
+ <p>PreToolUse hooks intercept tool calls at the protocol layer before they are executed. If a command matches a blocked pattern, the hook denies execution, making safety deterministic rather than probabilistic.</p>
308
+ </details>
309
+ </div>
310
+ </div>
311
+
312
+ <aside class="sidebar">
313
+ <div class="sidebar-card">
314
+ <h2>GSD execution brief</h2>
315
+ <p>This guide explains the structural boundary between prompt-level guidelines and protocol-level pre-action gates to help teams move from advisory rules to hard enforcement.</p>
316
+ <p><strong>Opportunity score:</strong> 92</p>
317
+ <p><strong>Primary persona:</strong> security-engineer</p>
318
+ <p><strong>Keyword cluster:</strong> pretooluse hooks vs advisory prompt rules, claude code security, cursor rules bypass, mcp security</p>
319
+ <p><strong>Pricing:</strong> Pro $19/mo or $149/yr. Team $49/seat/mo.</p>
320
+ <div class="proof-links">
321
+ <a href="https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/VERIFICATION_EVIDENCE.md" target="_blank" rel="noopener">Verification evidence</a>
322
+ <a href="https://github.com/IgorGanapolsky/ThumbGate/blob/main/proof/automation/report.json" target="_blank" rel="noopener">Automation proof</a>
323
+ <a href="https://github.com/IgorGanapolsky/ThumbGate" target="_blank" rel="noopener">GitHub repository</a>
324
+ </div>
325
+ <a class="cta-button" href="/checkout/pro?utm_source=website&amp;utm_medium=seo_page&amp;utm_campaign=guides_pretooluse-hooks-vs-advisory-prompt-rules&amp;cta_placement=seo_brief&amp;plan_id=pro" target="_blank" rel="noopener">Go Pro — $19/mo</a>
326
+ </div>
327
+ <div class="sidebar-card">
328
+ <h2>Related pages</h2>
329
+ <a class="related-card" href="/guides/pre-action-checks">
330
+ <span class="related-label">Related page</span>
331
+ <strong>What Are Pre-Action Checks?</strong>
332
+ </a>
333
+ <a class="related-card" href="/guides/claude-code-feedback">
334
+ <span class="related-label">Related page</span>
335
+ <strong>Claude Code Feedback Memory That Enforces</strong>
336
+ </a>
337
+ </div>
338
+ </aside>
339
+ </section>
340
+ </main>
341
+ </body>
342
+ </html>