<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vadym Dobroskok</title>
    <description>The latest articles on DEV Community by Vadym Dobroskok (@w4p).</description>
    <link>https://dev.to/w4p</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4221235%2F5732db14-75a4-4bdf-82b5-445eed864c74.jpg</url>
      <title>DEV Community: Vadym Dobroskok</title>
      <link>https://dev.to/w4p</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/w4p"/>
    <language>en</language>
    <item>
      <title>Find SQLite Schema Drift with Codex via GateRook</title>
      <dc:creator>Vadym Dobroskok</dc:creator>
      <pubDate>Fri, 27 Nov 2026 06:25:35 +0000</pubDate>
      <link>https://dev.to/w4p/find-sqlite-schema-drift-with-codex-via-gaterook-2jfn</link>
      <guid>https://dev.to/w4p/find-sqlite-schema-drift-with-codex-via-gaterook-2jfn</guid>
      <description>&lt;p&gt;The same version of a job worker starts in one environment and fails in another: &lt;code&gt;no such column: retry_after_ms&lt;/code&gt;. Before rerunning a migration, find out what each database actually contains. This walkthrough gives Codex a read-only path to two SQLite files through GateRook and asks it to name the exact difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give the worker two different schemas
&lt;/h2&gt;

&lt;p&gt;Use two disposable files. Both have a &lt;code&gt;jobs&lt;/code&gt; table, but only the reference copy has the retry column. You can reproduce the case with the SQLite CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkdir -p sqlite-schema-demo
&lt;span class="nb"&gt;cd&lt;/span&gt; sqlite-schema-demo
sqlite3 baseline.db &lt;span class="s1"&gt;'CREATE TABLE jobs (id INTEGER PRIMARY KEY, status TEXT NOT NULL);'&lt;/span&gt;
sqlite3 expected.db &lt;span class="s1"&gt;'CREATE TABLE jobs (id INTEGER PRIMARY KEY, status TEXT NOT NULL, retry_after_ms INTEGER NOT NULL DEFAULT 0);'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep the files in this separate demo directory, not in GateRook's own profile directory. The worker error is the scenario for the exercise; you don't need to install or run a worker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect both files, with writes off
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="https://gaterook.com/" rel="noopener noreferrer"&gt;GateRook&lt;/a&gt;, add two SQLite connections named &lt;code&gt;baseline&lt;/code&gt; and &lt;code&gt;expected&lt;/code&gt;. Select the matching files. Attach both connections to the same dedicated demo endpoint. In its tool settings, leave &lt;strong&gt;Describe a table&lt;/strong&gt; available and turn off &lt;strong&gt;Change data&lt;/strong&gt;. For this check, you don't need to enable arbitrary SQL queries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmxv9guyhd1vovooqjvnj.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmxv9guyhd1vovooqjvnj.webp" alt="GateRook's SQLite setup form with the file field empty" width="800" height="1104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GateRook 2.0.0 documentation screenshot: the SQLite file picker before selecting a demo file.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr6gboe2cj49yiyq3octc.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr6gboe2cj49yiyq3octc.webp" alt="GateRook endpoint selector with the default endpoint" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Documentation screenshot: the endpoint selector. Choose your dedicated demo endpoint instead of the default shown here.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From that endpoint's &lt;strong&gt;Connect an AI app&lt;/strong&gt; setup, select Codex and complete the connection in a demo workspace. The request path is &lt;strong&gt;Codex → GateRook's MCP endpoint → the two local SQLite files&lt;/strong&gt;. Before running the prompt, confirm that the endpoint lists both files under their distinct names. A prompt alone is not a read-only boundary; use the tool settings and disposable files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for evidence from each file
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Use GateRook's &lt;code&gt;sql_describe_table&lt;/code&gt; tool twice: describe &lt;code&gt;main.jobs&lt;/code&gt; on the &lt;code&gt;baseline&lt;/code&gt; connection and then on &lt;code&gt;expected&lt;/code&gt;. Compare column names, types, nullability, and defaults. Name each connection in your answer. Tell me if there is a column present in only one file. Do not run other SQL, edit either file, or apply a migration. Separate the observed difference from any guess about its cause.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Naming both connections matters: the table name is identical, and a good-looking answer based on just one file is useless. If a call fails, ask the assistant to report the failed connection instead of inferring its schema.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the two calls returned
&lt;/h2&gt;

&lt;p&gt;In the isolated GateRook 2.0.0 test, &lt;code&gt;sql_describe_table&lt;/code&gt; ran once per connection. These are the relevant fields from those calls:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Connection&lt;/th&gt;
&lt;th&gt;Columns returned&lt;/th&gt;
&lt;th&gt;Retry column&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;baseline&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;id&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Absent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;expected&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;id&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;retry_after_ms&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;INTEGER&lt;/code&gt;, &lt;code&gt;nullable: false&lt;/code&gt;, default &lt;code&gt;0&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If your deployment points to a database shaped like &lt;code&gt;baseline&lt;/code&gt;, that difference explains why a query referencing the column would fail there. It doesn't tell you why the column is missing. Before applying a migration, check which file the worker actually opens, which migration should add the column, and whether it ran against that file.&lt;/p&gt;

&lt;p&gt;The demo uses schema metadata instead of application rows. You can reuse the same workflow to compare a saved snapshot against a staging copy, or to check whether two developer databases agree after a branch switch. &lt;a href="https://github.com/gaterook/gaterook" rel="noopener noreferrer"&gt;GateRook source on GitHub&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>One Desktop App Instead of 100+ MCP Server Setups</title>
      <dc:creator>Vadym Dobroskok</dc:creator>
      <pubDate>Sun, 15 Nov 2026 21:15:29 +0000</pubDate>
      <link>https://dev.to/w4p/one-desktop-app-instead-of-100-mcp-server-setups-5do</link>
      <guid>https://dev.to/w4p/one-desktop-app-instead-of-100-mcp-server-setups-5do</guid>
      <description>&lt;p&gt;Giving an AI assistant access to one database is straightforward. Giving it useful access to an application stack raises a more interesting question: &lt;strong&gt;who decides what it is allowed to do?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A checkout investigation might span MySQL, Redis, MongoDB, Kubernetes, OpenSearch and InfluxDB. I want the assistant to compare evidence across those systems. I also want to see the exact command before it changes anything, keep service credentials out of its configuration, and inspect what actually ran.&lt;/p&gt;

&lt;p&gt;That is the workflow behind &lt;a href="https://gaterook.com" rel="noopener noreferrer"&gt;GateRook&lt;/a&gt;: a desktop application that puts service connections behind a local MCP gateway, with scoped endpoints, access policies, approvals and an Activity history.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: GateRook is my project. This article adapts the &lt;a href="https://gaterook.com/articles/replace-100-mcp-servers-with-gaterook" rel="noopener noreferrer"&gt;original walkthrough&lt;/a&gt; for developers who want to understand the execution path and its boundaries. The &lt;a href="https://github.com/gaterook/gaterook" rel="noopener noreferrer"&gt;application source is on GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What “100+ MCP servers” means here
&lt;/h2&gt;

&lt;p&gt;The number refers to integration coverage. As of November 15, 2026, the &lt;a href="https://gaterook.com/integrations/" rel="noopener noreferrer"&gt;integration catalog&lt;/a&gt; contains &lt;strong&gt;122 entries: 50 connector types, 71 compatible-service entries and one generic external MCP integration&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Several compatible services share a connector. A managed PostgreSQL service, for example, does not need a separate implementation of the PostgreSQL protocol.&lt;/p&gt;

&lt;p&gt;For supported operations, I can configure a connection in GateRook instead of finding, installing and maintaining another service-specific MCP server. This does not mean I previously ran 122 servers, or that GateRook implements every feature of every specialist integration. Existing MCP servers can also sit behind the gateway when their tools are needed.&lt;/p&gt;

&lt;p&gt;Most connectors are included. Cassandra, Neo4j, ClickHouse, DuckDB, H2 and Microsoft Access use optional modules and an optional Java runtime; their first download needs internet access. The &lt;a href="https://github.com/gaterook/gaterook/blob/main/docs/connector-delivery.md" rel="noopener noreferrer"&gt;connector delivery documentation&lt;/a&gt; explains the split.&lt;/p&gt;

&lt;h2&gt;
  
  
  One endpoint, several services, explicit permissions
&lt;/h2&gt;

&lt;p&gt;There are three useful concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;connection&lt;/strong&gt; identifies a service, its credentials and its access constraints.&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;endpoint&lt;/strong&gt; exposes a selected set of connections and tools to an AI client.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;policy&lt;/strong&gt; determines how a requested operation may proceed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a checkout investigation, the arrangement looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AI client
    |
    | MCP
    v
GateRook endpoint: shop-investigation
    |
    +-- authentication and endpoint scope
    +-- argument validation and operation classification
    +-- policy decision / approval when required
    +-- execution and Activity record
    |
    +-- MySQL       orders
    +-- Redis       cached availability
    +-- MongoDB     product catalog
    +-- Kubernetes  workloads and logs
    +-- OpenSearch  search documents
    +-- InfluxDB    metrics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The client gets access to the endpoint. GateRook supplies the credentials for the selected service connection. This removes database passwords from the assistant's tool arguments while keeping the actual database and cloud permissions in force.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi1royu6wcxsu8upbhwnx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi1royu6wcxsu8upbhwnx.jpg" alt="Six service connections assigned to the shop-investigation endpoint in GateRook." width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Connections from the original controlled demo. It uses fictional shop data, five real local services and a local Kubernetes API fixture representing the GKE workflow. The loopback addresses and simplified development authentication are demo settings.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I can give a development assistant and a production investigation assistant different endpoints. Neither needs the entire integration catalog simply because the application supports it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A prompt is useful; an enforced policy is the boundary
&lt;/h2&gt;

&lt;p&gt;“Please do not modify production” is a reasonable instruction to an assistant. I also want that intent represented in the execution layer.&lt;/p&gt;

&lt;p&gt;GateRook has four tool modes:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Off&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The tool is unavailable through that endpoint.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Read only&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Classified reads can run; classified mutations go through approval.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Approval&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Both reads and changes require review.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bypass&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Calls can run without approval; other applicable controls remain.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The distinction between a &lt;strong&gt;Read only tool mode&lt;/strong&gt; and a &lt;strong&gt;read-only endpoint&lt;/strong&gt; matters. A read-only endpoint prohibits mutations and Bypass. For an investigation that must never write, that is the stronger boundary.&lt;/p&gt;

&lt;p&gt;The original demo uses 17 read-only tools, two approval tools and 11 disabled tools, with no Bypass. Its Redis key restrictions also exclude &lt;code&gt;session:*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These controls complement service permissions. A narrowly scoped database user or cloud role still matters, especially when a connector's read-only enforcement depends on the service or its operation classifier. The &lt;a href="https://github.com/gaterook/gaterook/blob/main/docs/security.md" rel="noopener noreferrer"&gt;security documentation&lt;/a&gt; describes those details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow one SKU across the stack
&lt;/h2&gt;

&lt;p&gt;Consider order &lt;code&gt;1001&lt;/code&gt; and product &lt;code&gt;sku-42&lt;/code&gt;: the product appears in search, but checkout reports it as unavailable.&lt;/p&gt;

&lt;p&gt;A focused investigation request might be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Compare order 1001 with the cached availability, product document, search document, checkout logs and recent metrics for sku-42. Return the evidence and a proposed fix. Do not make changes yet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The original demo produces the following evidence:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Observation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sql_query&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Order 1001 is pending and uses inventory version 18.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;redis_get&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The cached product reports zero available units and version 17.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mongo_find&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The catalog reports 12 units and version 18.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;opensearch_query&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The search document also reports 12 units and version 18.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;k8s_get&lt;/code&gt; / &lt;code&gt;k8s_logs&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The Kubernetes fixture returns a running pod and a sample cache-version mismatch.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;influxdb_query&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Seeded checkout metrics provide latency and error context.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The SQL read is deliberately small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inventory_version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1001&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The mismatch suggests stale cache data. It does not prove that the cache caused every checkout error. In a real investigation, I would also check timestamps, the cache update path and subsequent behavior.&lt;/p&gt;

&lt;p&gt;What changes operationally is that all these reads pass through one configured access point and appear in one history.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approve the command that will actually run
&lt;/h2&gt;

&lt;p&gt;The proposed fix in the demo updates one existing Redis key to inventory version 18 and gives it a five-minute expiry.&lt;/p&gt;

&lt;p&gt;Here is the Redis command, formatted for readability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SET "product:sku-42" '{"sku":"sku-42","available":12,"inventory_version":18}' XX PX 300000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two details worth reviewing before approval:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;XX&lt;/code&gt; requires the key to exist. It does not compare its previous value and is not compare-and-swap.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PX 300000&lt;/code&gt; sets an explicit five-minute expiry, so the replacement does not accidentally become permanent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a real application, I would prefer its supported cache-refresh operation if that operation performs additional consistency checks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpckcne87tbd4603e5c15.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpckcne87tbd4603e5c15.jpg" alt="GateRook approval request showing the exact Redis SET command, connection, endpoint, expiry and approval controls." width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The approval is attached to a concrete command and target, with a choice to deny or execute it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Under the hood, GateRook stores the prepared action and its digest. Before execution, it rechecks the approval, expiry, applicable policy and action integrity. The core executes the stored payload, so the client cannot replace the reviewed command with another one after approval.&lt;/p&gt;

&lt;p&gt;This is the control I care about: reviewing “set this key to this value with this expiry” before the write reaches Redis. A follow-up read in the demo confirmed 12 available units, version 18 and a remaining expiry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the execution history next to the controls
&lt;/h2&gt;

&lt;p&gt;An assistant's summary is useful, but I also want the underlying calls.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6kv6s5i1xf1edbagdgk5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6kv6s5i1xf1edbagdgk5.jpg" alt="GateRook Activity showing eight allowed reads, one approved Redis write and one read denied by policy." width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The original demo recorded ten calls across six connections: eight allowed reads, one approved write and one policy-denied read.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The denied request tried to read &lt;code&gt;session:demo-user&lt;/code&gt;. The &lt;code&gt;session:*&lt;/code&gt; restriction blocked it before the Redis operation ran. That is a useful test of the boundary: a normal product lookup succeeds while a session-key lookup fails.&lt;/p&gt;

&lt;p&gt;Activity brings together the tool, connection, caller, decision, duration and execution outcome. For an approved action, I can inspect the review and whether execution matched the approved payload. These records establish what happened at the tool layer; they do not establish that the model's diagnosis was correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  A large catalog should not become a giant prompt
&lt;/h2&gt;

&lt;p&gt;There is another scaling problem: loading every tool definition into an assistant's context.&lt;/p&gt;

&lt;p&gt;GateRook's automatic discovery mode switches to searched tool lists when the endpoint exceeds 40 tools or 100 KB of definitions. It exposes the core tools and ten most-used tools, while the rest remain discoverable through &lt;code&gt;find_tools&lt;/code&gt; and callable through &lt;code&gt;call_tool&lt;/code&gt; or &lt;code&gt;call_read_tool&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Those wrappers preserve the underlying tool's policies, approval requirements, limits, masking and audit behavior. Discovery changes how a tool is found, not its permission boundary. The &lt;a href="https://github.com/gaterook/gaterook/blob/main/docs/ARCHITECTURE.md#57-searched-tool-lists" rel="noopener noreferrer"&gt;architecture documentation&lt;/a&gt; explains the mechanism.&lt;/p&gt;

&lt;h2&gt;
  
  
  What control means in practice
&lt;/h2&gt;

&lt;p&gt;My goal is to control access, review changes and retain evidence. The scope of that control is explicit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GateRook governs calls routed through it. Separate shell access or another MCP connection needs its own controls.&lt;/li&gt;
&lt;li&gt;Keeping service credentials local does not keep all query results local. Allowed results reach the AI client and may reach its model provider.&lt;/li&gt;
&lt;li&gt;Approval is only useful if the proposed action is understood. It cannot make an incorrect fix correct.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a first setup, I would choose one non-production workflow, add only its required connections, verify an allowed read and a denied request, then test approval for one narrowly scoped change. The &lt;a href="https://gaterook.com/docs/getting-started/" rel="noopener noreferrer"&gt;getting-started guide&lt;/a&gt; covers setup, and the &lt;a href="https://gaterook.com/docs/ai-apps/" rel="noopener noreferrer"&gt;AI app guides&lt;/a&gt; cover client connections.&lt;/p&gt;

&lt;p&gt;For me, the benefit of one desktop app is being able to answer three questions in one place: &lt;strong&gt;what can the assistant reach, what am I approving, and what actually ran?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://gaterook.com/articles/replace-100-mcp-servers-with-gaterook" rel="noopener noreferrer"&gt;original article&lt;/a&gt; contains the full walkthrough. You can explore &lt;a href="https://gaterook.com" rel="noopener noreferrer"&gt;GateRook&lt;/a&gt; or inspect the &lt;a href="https://github.com/gaterook/gaterook" rel="noopener noreferrer"&gt;source on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;How do you currently separate an AI assistant's permission to investigate from its permission to change infrastructure?&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>Give AI access to your database while masking customer PII with GateRook</title>
      <dc:creator>Vadym Dobroskok</dc:creator>
      <pubDate>Mon, 09 Nov 2026 16:03:46 +0000</pubDate>
      <link>https://dev.to/w4p/give-ai-access-to-your-database-while-masking-customer-pii-with-gaterook-4pem</link>
      <guid>https://dev.to/w4p/give-ai-access-to-your-database-while-masking-customer-pii-with-gaterook-4pem</guid>
      <description>&lt;p&gt;An AI assistant can help investigate a subscription problem, explain an unfamiliar schema, or calculate revenue by plan. Those tasks rarely require a customer's name, email address, phone number, date of birth, or home address.&lt;/p&gt;

&lt;p&gt;Yet a perfectly ordinary SQL query can return all of them. Once the tool response reaches the AI client, those values may enter the model's context, the conversation history, or another downstream system. Asking the assistant to leave personal details out of its final answer happens too late: it has already received them.&lt;/p&gt;

&lt;p&gt;This walkthrough puts &lt;strong&gt;GateRook between the AI app and PostgreSQL&lt;/strong&gt;. We will let the assistant query a small customer database while GateRook replaces selected personal data with &lt;code&gt;‹masked›&lt;/code&gt; before returning the result. Then we will run useful analysis over the remaining data and inspect the actual AI call in Activity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I build &lt;a href="https://gaterook.com" rel="noopener noreferrer"&gt;GateRook&lt;/a&gt;, an open-source desktop MCP Firewall. Its application source is on &lt;a href="https://github.com/gaterook/gaterook" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. The example below uses GateRook 0.9.2 and PostgreSQL 16.13. Every customer record is fictional.&lt;/p&gt;

&lt;p&gt;Here is the result we are aiming for:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnmzrie7zkopbxrgtj9hz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnmzrie7zkopbxrgtj9hz.png" alt="GateRook Playground returns six customer rows with names, emails, phones, birth dates, and addresses masked, while plans, statuses, and revenue remain readable." width="799" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Five protected values per customer, six customers: GateRook reports 30 masked fields. This is an actual query result in Playground, which uses the same policy and masking pipeline as an agent call.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the privacy boundary belongs
&lt;/h2&gt;

&lt;p&gt;A read-only database account is a useful starting point. It limits changes to the database, but it can still read every sensitive column its grants permit.&lt;/p&gt;

&lt;p&gt;For this workflow, the request and response take this path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AI app
  -&amp;gt; MCP endpoint in GateRook
  -&amp;gt; endpoint scope, tool mode, policy and execution limits
  -&amp;gt; PostgreSQL using credentials held by GateRook
  -&amp;gt; result masking in GateRook
  -&amp;gt; masked MCP response to the AI app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model asks for a tool such as &lt;code&gt;sql_query&lt;/code&gt;. It supplies a connection name and SQL, rather than a database password. GateRook checks whether that endpoint exposes the tool and connection, executes an allowed request, and processes its result before the AI receives it.&lt;/p&gt;

&lt;p&gt;There are three separate decisions to make:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decision&lt;/th&gt;
&lt;th&gt;Control&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Which database objects can this connection read?&lt;/td&gt;
&lt;td&gt;PostgreSQL grants and GateRook resource restrictions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Which tools may the AI invoke, and when is review required?&lt;/td&gt;
&lt;td&gt;Endpoint tool modes and policy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Which returned values should be hidden?&lt;/td&gt;
&lt;td&gt;Pattern-based PII masking and explicit field rules&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Keeping these decisions separate is useful. An allowed query can still have sensitive output. Masking a result does not grant permission to execute a query that was otherwise forbidden.&lt;/p&gt;

&lt;p&gt;The gateway must be on the access path. A second MCP server with unrestricted database access, a database password in the agent's environment, or a direct SQL connection creates a separate path outside these controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prepare a database containing only fictional customers
&lt;/h2&gt;

&lt;p&gt;Use a disposable database for your first test. The commands below create a PostgreSQL container reachable through the local loopback address. If port &lt;code&gt;15432&lt;/code&gt; is already occupied, choose another port and use the same value in GateRook.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(openssl rand -hex 24)"&lt;/span&gt;

docker run -d \
  --name gaterook-postgres-pii \
  -p 127.0.0.1:15432:5432 \
  -e POSTGRES_PASSWORD \
  -e &lt;span class="nv"&gt;POSTGRES_DB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gaterook_demo \
  --health-cmd &lt;span class="s1"&gt;'pg_isready -U postgres -d gaterook_demo'&lt;/span&gt; \
  --health-interval 2s \
  --health-timeout 3s \
  --health-retries 30 \
  postgres:16.13

&lt;span class="kd"&gt;unset&lt;/span&gt; POSTGRES_PASSWORD

docker inspect --format &lt;span class="s1"&gt;'{{.State.Health.Status}}'&lt;/span&gt; \
  gaterook-postgres-pii
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait for &lt;code&gt;healthy&lt;/code&gt;. Save the following SQL as &lt;code&gt;customers.sql&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;demo_agent&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt; &lt;span class="no"&gt;PASSWORD&lt;/span&gt; &lt;span class="s1"&gt;'local-demo-only'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="kt"&gt;integer&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;full_name&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;phone&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;birth_date&lt;/span&gt; &lt;span class="kt"&gt;date&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;street_address&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;country_code&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;plan&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;monthly_revenue&lt;/span&gt; &lt;span class="kt"&gt;numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Avery Stone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'avery@example.test'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+1 202 555 0101'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s1"&gt;'1988-04-12'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'12 Example Lane'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ES'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'pro'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;49.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Morgan Reed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'morgan@example.test'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+1 202 555 0102'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s1"&gt;'1991-09-03'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'24 Sample Street'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'DE'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'business'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;199.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Riley Chen'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'riley@example.test'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+1 202 555 0103'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s1"&gt;'1985-02-21'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'36 Demo Road'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ES'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'pro'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'cancelled'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Jordan Lee'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'jordan@example.test'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+1 202 555 0104'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s1"&gt;'1995-11-08'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'48 Fiction Avenue'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'GB'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'free'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Casey Park'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'casey@example.test'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+1 202 555 0105'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s1"&gt;'1990-06-17'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'60 Example Lane'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'ES'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'business'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;199.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Taylor Quinn'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'taylor@example.test'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+1 202 555 0106'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s1"&gt;'1993-01-25'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'72 Sample Street'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'DE'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'pro'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'active'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;49.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;CONNECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;gaterook_demo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;demo_agent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;demo_agent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;demo_agent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Load it as the database administrator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; -i gaterook-postgres-pii \
  psql -U postgres -d gaterook_demo -v &lt;span class="nv"&gt;ON_ERROR_STOP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 \
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; customers.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The publicly documented password &lt;code&gt;local-demo-only&lt;/code&gt; belongs only to this disposable local fixture. Use a separately managed credential for a real database.&lt;/p&gt;

&lt;p&gt;The connection role gets &lt;code&gt;SELECT&lt;/code&gt; on this table. It is neither the table owner nor the PostgreSQL administrator, and the script grants it no write privileges. In an existing database, also inspect role memberships and grants to &lt;code&gt;PUBLIC&lt;/code&gt;: privileges are cumulative. See PostgreSQL's &lt;a href="https://www.postgresql.org/docs/16/sql-grant.html" rel="noopener noreferrer"&gt;GRANT documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Connect PostgreSQL to a scoped GateRook endpoint
&lt;/h2&gt;

&lt;p&gt;Install GateRook from &lt;a href="https://gaterook.com" rel="noopener noreferrer"&gt;gaterook.com&lt;/a&gt;, then open &lt;strong&gt;Connections → Add connection → PostgreSQL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For this local fixture, use:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Connection name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;postgres-demo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;&lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;&lt;code&gt;15432&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User&lt;/td&gt;
&lt;td&gt;&lt;code&gt;demo_agent&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;td&gt;The local fixture password&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Secret source&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Encrypted here&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Environment&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;DEV / Development&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery database&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gaterook_demo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Selected databases&lt;/td&gt;
&lt;td&gt;Only &lt;code&gt;gaterook_demo&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema allowlist&lt;/td&gt;
&lt;td&gt;&lt;code&gt;public&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Default schema&lt;/td&gt;
&lt;td&gt;&lt;code&gt;public&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The disposable container above has no TLS listener, so its local connection uses &lt;strong&gt;SSL mode: Off (disable)&lt;/strong&gt;. For a remote database, configure TLS and use &lt;strong&gt;Verify the CA and host name (verify-full)&lt;/strong&gt; with the appropriate CA certificate.&lt;/p&gt;

&lt;p&gt;Test the connection before saving it. Add it to an endpoint dedicated to the workflow; mine is named &lt;code&gt;showcase&lt;/code&gt;. An endpoint determines which connections and tools a particular AI app can use. Do not select unrelated endpoints in the connection wizard.&lt;/p&gt;

&lt;p&gt;The three tools needed here are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sql_list_schemas&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Discover accessible schemas and tables&lt;/td&gt;
&lt;td&gt;Read only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sql_describe_table&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Read columns, types, keys and indexes&lt;/td&gt;
&lt;td&gt;Read only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sql_query&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Execute a validated read query&lt;/td&gt;
&lt;td&gt;Read only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For an analytics-only endpoint, set &lt;code&gt;sql_execute&lt;/code&gt; to &lt;strong&gt;Off&lt;/strong&gt;. My existing demonstration endpoint also illustrates the &lt;strong&gt;Approval&lt;/strong&gt; mode for writes, as shown below; no write tool is used in this article, and the customer-table grant is still SELECT-only.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbnccdwziq09dgdfdw3h5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbnccdwziq09dgdfdw3h5.png" alt="The PostgreSQL tools exposed through showcase: schema discovery, table description, and queries are Read only; sql_execute is in Approval mode." width="800" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tool permissions and output masking solve different problems. The screenshot shows the endpoint's existing modes; an analytics-only setup can disable the write tool entirely.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Connect your AI app through &lt;strong&gt;AI apps&lt;/strong&gt;, selecting this endpoint. Use GateRook's client setup flow rather than putting the PostgreSQL credential into the AI app's configuration. The &lt;a href="https://gaterook.com/docs/getting-started" rel="noopener noreferrer"&gt;getting-started guide&lt;/a&gt; covers the connection workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Turn on PII masking in Development
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Policies → Development&lt;/strong&gt;, then scroll to &lt;strong&gt;Masking&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is an important step for a DEV test: in GateRook 0.9.2, the built-in PII categories are enabled by default for &lt;strong&gt;PROD&lt;/strong&gt;, while &lt;strong&gt;DEV&lt;/strong&gt; starts with secret masking and no enabled PII categories. &lt;strong&gt;STAGE&lt;/strong&gt; inherits individual settings from DEV unless it overrides them. Always inspect the effective policy for the connection's environment.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Personal data, found by pattern&lt;/strong&gt;, enable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Email addresses&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Phone numbers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Card numbers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IBANs&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These detectors inspect values regardless of their field names. An email address does not have to appear in a column literally called &lt;code&gt;email&lt;/code&gt; to match.&lt;/p&gt;

&lt;p&gt;Under &lt;strong&gt;Always mask these fields&lt;/strong&gt;, add each of these entries with the plus button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;customers.full_name
customers.birth_date
customers.street_address
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then select &lt;strong&gt;Save dev policy&lt;/strong&gt;. The saved rules apply from the next call.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8xpwi7oegs031iquk1a2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8xpwi7oegs031iquk1a2.png" alt="The saved Development masking policy with all four PII categories enabled and explicit rules for customers.full_name, customers.birth_date, and customers.street_address." width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the Masking section under Policies → Development. The explanatory text identifies its scope: every DEV connection.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The distinction between the two mechanisms matters:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;How this configuration protects it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;avery@example.test&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Email pattern&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;+1 202 555 0101&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Phone pattern&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;Avery Stone&lt;/code&gt; in &lt;code&gt;customers.full_name&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Explicit field rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A date in &lt;code&gt;customers.birth_date&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Explicit field rule&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An address in &lt;code&gt;customers.street_address&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Explicit field rule&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There is no general-purpose name or postal-address detector among those four PII checkboxes. Field rules cover sensitive columns whose values do not have one reliable universal shape. Add your own application-specific fields, such as a national identifier or a private support note, rather than assuming an email detector covers every kind of personal data.&lt;/p&gt;

&lt;p&gt;SQL field rules can use &lt;code&gt;table.column&lt;/code&gt; or &lt;code&gt;schema.table.column&lt;/code&gt;; a rule such as &lt;code&gt;*.birth_date&lt;/code&gt; covers that field name across tables. Prefer a schema-qualified rule when identically named tables need different treatment. The three customer-field rules above are specific to our fixture.&lt;/p&gt;

&lt;p&gt;Policy scope is broader than the endpoint used for the demo. A DEV policy change affects every DEV connection, and inherited STAGE settings can change with it. Review that scope before using the same procedure in a shared setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Verify what actually reaches the AI
&lt;/h2&gt;

&lt;p&gt;First, test in &lt;strong&gt;Playground&lt;/strong&gt;. Choose endpoint &lt;code&gt;showcase&lt;/code&gt;, tool &lt;code&gt;sql_query&lt;/code&gt;, and connection &lt;code&gt;postgres-demo&lt;/code&gt;. Set the result limit to &lt;code&gt;10&lt;/code&gt; and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;full_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="n"&gt;birth_date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;street_address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;monthly_revenue&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customers&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This intentionally includes sensitive columns so that the masking behavior is visible. For normal analysis, select only the columns the task needs.&lt;/p&gt;

&lt;p&gt;The screenshot near the beginning shows the actual result: all six rows remain present, but five values in each row are replaced with &lt;code&gt;‹masked›&lt;/code&gt;. The useful business fields keep their values.&lt;/p&gt;

&lt;p&gt;Next, run the same query through your connected AI app. The MCP tool arguments are ordinary JSON:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"connection"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"postgres-demo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"sql"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"SELECT customer_id, full_name, email, phone, birth_date, street_address, plan, status, monthly_revenue FROM public.customers ORDER BY customer_id;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is one row from the actual structured response, with column order preserved:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"columns"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"customer_id"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"full_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"phone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"birth_date"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"street_address"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"plan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"monthly_revenue"&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"rows"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"‹masked›"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"‹masked›"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"‹masked›"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"‹masked›"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s2"&gt;"‹masked›"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pro"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"active"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"49.00"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full response contained six rows and reported &lt;code&gt;truncated: false&lt;/code&gt;. Its text representation also contained the masking marker instead of the protected values. This matters because an MCP client can consume structured content or text; the readable table alone is not the whole response contract.&lt;/p&gt;

&lt;p&gt;Treat &lt;code&gt;‹masked›&lt;/code&gt; as a withheld value. It is not SQL &lt;code&gt;NULL&lt;/code&gt;, an empty string, a stable customer pseudonym, or a value the model should infer. A masked date becomes a string marker, so downstream code must also handle the change in representation.&lt;/p&gt;

&lt;p&gt;The source table is unchanged. This is output masking at the gateway; PostgreSQL retains the original values for authorized application workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Ask a useful question without selecting PII
&lt;/h2&gt;

&lt;p&gt;Now ask the assistant:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Using postgres-demo, calculate the number of active customers and total monthly revenue for each plan. Aggregate in SQL and return only the plan, count, and revenue. Do not select customer contact details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The query can be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="cm"&gt;(*) AS active_customers,
       SUM(monthly_revenue) AS monthly_revenue
FROM public.customers
WHERE status = 'active'
GROUP BY plan
ORDER BY monthly_revenue DESC;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result is:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;plan&lt;/th&gt;
&lt;th&gt;active_customers&lt;/th&gt;
&lt;th&gt;monthly_revenue&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;business&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;398.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pro&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;98.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa0zzslxrwjoxu9pcso4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa0zzslxrwjoxu9pcso4m.png" alt="GateRook returns the aggregate query with two business customers at 398.00, two pro customers at 98.00, and one free customer at 0.00." width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The AI can conclude that the fixture has &lt;strong&gt;five active customers&lt;/strong&gt;, &lt;strong&gt;496.00 in total monthly revenue&lt;/strong&gt;, and approximately &lt;strong&gt;80.2% of that revenue from the business plan&lt;/strong&gt;. It does not need any customer's email or address to calculate those figures.&lt;/p&gt;

&lt;p&gt;GateRook reports &lt;strong&gt;Masked: None&lt;/strong&gt; for this result because the query did not return a matching sensitive value. The masking policy is still enabled. The aggregate executes inside PostgreSQL before the gateway processes the returned rows.&lt;/p&gt;

&lt;p&gt;This is the workflow I want in everyday use: minimize the data in the query, with gateway masking as an additional control when a tool returns more detail than expected. A prompt helps express the analytical task; the configured controls enforce the boundary independently of whether the assistant follows that prompt perfectly.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Inspect the actual AI call in Activity
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;Activity → Agent calls&lt;/strong&gt;, then enter this filter and press Enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;endpoint:showcase connection:postgres-demo tool:sql_query
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the customer-row query from your AI app. In this run, the client is &lt;strong&gt;Codex&lt;/strong&gt;. The event identifies the endpoint, connection, protocol, SQL arguments, policy decision and timing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw53zqzhmz2gooejsx4lu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw53zqzhmz2gooejsx4lu.png" alt="Activity identifies the real Codex sql_query call through showcase and shows its SQL arguments without a database password." width="800" height="751"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll to &lt;strong&gt;Result&lt;/strong&gt;. The same event records &lt;strong&gt;30 masked fields&lt;/strong&gt;, together with a masked result preview, size and SHA-256 metadata.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1tcdzcf4nocprvajw99h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1tcdzcf4nocprvajw99h.png" alt="The Result section of the Codex call shows masked values in its preview, a response size and hash, and 30 masked fields." width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The useful evidence is that the call originated from the connected AI client and that masking happened in the gateway's response processing. Playground provides a convenient result viewer; Activity ties the actual client request to its execution.&lt;/p&gt;

&lt;p&gt;Do not use Activity as a guaranteed full archive of every result row. It records execution metadata and may show a masked preview. Masking changes also do not retroactively sanitize data already returned to an AI app or stored before the rules were enabled.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the masking works technically
&lt;/h2&gt;

&lt;p&gt;GateRook's implementation is available in the public repository, so the behavior can be inspected rather than inferred from the interface.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/gaterook/gaterook/blob/main/core/src/main/java/ai/msrv/gaterook/core/platform/MaskPolicy.java" rel="noopener noreferrer"&gt;&lt;code&gt;MaskPolicy&lt;/code&gt; implementation&lt;/a&gt; defines the environment defaults, enabled PII categories, entropy setting and explicit field rules.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/gaterook/gaterook/blob/main/core/src/main/java/ai/msrv/gaterook/core/platform/Masker.java" rel="noopener noreferrer"&gt;&lt;code&gt;Masker&lt;/code&gt; implementation&lt;/a&gt; combines several mechanisms: known credential values and their recognized encodings, sensitive key names, configured fields, secret patterns, optional entropy detection, and enabled PII patterns. The PII settings sit alongside credential protection; a database password and a customer's birth date are different things to protect.&lt;/p&gt;

&lt;p&gt;For SQL results, the connector preserves result-column metadata where the driver provides it. The masker can match the column label and its original schema/table/column identity. That lets a normal direct-column alias retain protection when its source metadata is available. See &lt;a href="https://github.com/gaterook/gaterook/blob/main/connectors/sql/src/main/java/ai/msrv/gaterook/connectors/sql/ResultReader.java" rel="noopener noreferrer"&gt;&lt;code&gt;ResultReader&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/gaterook/gaterook/blob/main/core/src/main/java/ai/msrv/gaterook/core/platform/mask/PiiRules.java" rel="noopener noreferrer"&gt;&lt;code&gt;PII detectors&lt;/code&gt;&lt;/a&gt; are pattern-based. Card recognition includes a Luhn check; IBAN recognition includes a mod-97 check. Phone recognition expects a leading &lt;code&gt;+&lt;/code&gt; and a supported digit count. Those details help explain both why ordinary values remain readable and why your own real-world formats need testing.&lt;/p&gt;

&lt;p&gt;There is an important limit: SQL expressions do not necessarily preserve source-column metadata. Transformations can also change a value's recognizable shape. Field masking and pattern recognition are therefore not a complete information-flow or query-inference defense.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the requirement is stricter than output masking
&lt;/h2&gt;

&lt;p&gt;The demo deliberately grants access to raw fictional customer columns so we can see the masking step. If your real requirement is &lt;strong&gt;“the AI database identity must never have access to those columns”&lt;/strong&gt;, enforce that in PostgreSQL as well.&lt;/p&gt;

&lt;p&gt;One approach is a separate analytics role that can select only a reviewed aggregate view. The following is an illustrative design for a larger dataset, run by an appropriate database owner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;VIEW&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;active_customers_by_plan&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="cm"&gt;(*) AS active_customers,
       SUM(monthly_revenue) AS monthly_revenue
FROM public.customers
WHERE status = 'active'
GROUP BY plan
HAVING COUNT(*)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;ROLE&lt;/span&gt; &lt;span class="n"&gt;ai_analytics&lt;/span&gt; &lt;span class="no"&gt;LOGIN&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;CONNECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;gaterook_demo&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;ai_analytics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="no"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;SCHEMA&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;ai_analytics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;analytics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;active_customers_by_plan&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;ai_analytics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Provision authentication for that role separately, and configure a separate GateRook connection with those credentials. Give the role no raw-table grants, ownership or membership in a broader role. Check &lt;code&gt;PUBLIC&lt;/code&gt; privileges too. With the ordinary PostgreSQL view privilege model, the view owner supplies the underlying-table privileges; inspect &lt;a href="https://www.postgresql.org/docs/16/sql-createview.html" rel="noopener noreferrer"&gt;CREATE VIEW&lt;/a&gt; before adapting this to views with different security options or row-level policies.&lt;/p&gt;

&lt;p&gt;The threshold of ten is just an example of a dataset-specific release rule, not a guarantee of anonymity. This view intentionally returns no rows for our tiny six-customer fixture. In a real system, rare combinations, repeated queries and differences between aggregates can still reveal information, so design the reporting surface for the disclosure risk you actually have.&lt;/p&gt;

&lt;p&gt;Likewise, the &lt;code&gt;customer_id&lt;/code&gt; retained in our row-level demo can link records together. Hiding direct identifiers does not make every remaining row anonymous. Exclude identifiers when the task does not need them, and review any remaining quasi-identifiers such as precise timestamps, location and unusual account attributes.&lt;/p&gt;

&lt;p&gt;GateRook can still add endpoint scope, limits, masking and Activity history around the narrower database surface. The database and the gateway contribute different controls.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical verification checklist
&lt;/h2&gt;

&lt;p&gt;Before connecting a real dataset, check the complete path with synthetic records:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Confirm the environment.&lt;/strong&gt; DEV, STAGE and PROD can have different effective masking rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check every protected field.&lt;/strong&gt; Include names, dates, addresses, free-text notes and application-specific identifiers, not only email addresses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inspect actual tool output.&lt;/strong&gt; Verify structured and text responses, rather than trusting an AI-generated summary of what it received.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exercise representative query shapes.&lt;/strong&gt; Direct columns, aliases, joins, views and expressions can expose different metadata. Validate them using fictional values and the exact database driver you deploy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check analytical usefulness.&lt;/strong&gt; Counts, status distributions and revenue totals should remain usable when the task is allowed to disclose them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review access outside GateRook.&lt;/strong&gt; Keep raw database credentials and alternate unrestricted tools out of the AI workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review Activity.&lt;/strong&gt; Confirm the client, endpoint, connection, decision and masking count for a real client call.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Output masking reduces exposure; it does not establish regulatory compliance or guarantee that every possible PII format will be detected. Allowed, unmasked results still reach your chosen AI client and may reach its provider. GateRook's &lt;a href="https://github.com/gaterook/gaterook/blob/main/docs/security.md" rel="noopener noreferrer"&gt;security model&lt;/a&gt; describes those boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it on a small workflow
&lt;/h2&gt;

&lt;p&gt;Start with one question that needs business facts but no customer identity: revenue by plan, failed-payment counts, an order-status distribution, or a schema investigation. Use a restricted database role, choose the tools that task needs, configure the masking policy, and verify the actual response before expanding access.&lt;/p&gt;

&lt;p&gt;In this example, the assistant received enough information to calculate active-customer counts and revenue while the configured customer PII fields were replaced before delivery. The setup is visible, the SQL is reproducible, and the AI call can be inspected afterward.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Website and downloads:&lt;/strong&gt; &lt;a href="https://gaterook.com" rel="noopener noreferrer"&gt;gaterook.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application source:&lt;/strong&gt; &lt;a href="https://github.com/gaterook/gaterook" rel="noopener noreferrer"&gt;github.com/gaterook/gaterook&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setup guide:&lt;/strong&gt; &lt;a href="https://gaterook.com/docs/getting-started" rel="noopener noreferrer"&gt;Getting started with GateRook&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security boundaries:&lt;/strong&gt; &lt;a href="https://github.com/gaterook/gaterook/blob/main/docs/security.md" rel="noopener noreferrer"&gt;GateRook security model&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>database</category>
      <category>mcp</category>
    </item>
    <item>
      <title>How I manage MCP access, approvals, and tool history with GateRook</title>
      <dc:creator>Vadym Dobroskok</dc:creator>
      <pubDate>Sun, 01 Nov 2026 22:16:08 +0000</pubDate>
      <link>https://dev.to/w4p/how-i-manage-mcp-access-approvals-and-tool-history-with-gaterook-4i8n</link>
      <guid>https://dev.to/w4p/how-i-manage-mcp-access-approvals-and-tool-history-with-gaterook-4i8n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5l0kde9f92v2zs7uqpsd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5l0kde9f92v2zs7uqpsd.png" alt="Concept illustration of GateRook as a violet gateway connecting AI clients to infrastructure, with approval and tool-history symbols" width="799" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use AI coding tools such as Claude, Codex, and Cursor, and I want them to work with the systems behind my applications: databases, server logs, APIs, and cloud services.&lt;/p&gt;

&lt;p&gt;MCP makes those connections useful. But once several servers and environments are involved, I need to answer a few practical questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which tools can this AI client use right now?&lt;/li&gt;
&lt;li&gt;Which connection will a call actually reach?&lt;/li&gt;
&lt;li&gt;Can it change data, or only inspect it?&lt;/li&gt;
&lt;li&gt;Where can I review the exact action before it runs?&lt;/li&gt;
&lt;li&gt;After the conversation ends, where is the record of what happened?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those questions are the reason I am building &lt;strong&gt;GateRook&lt;/strong&gt;, an open-source desktop MCP gateway.&lt;/p&gt;

&lt;p&gt;I am the author of the project. In this article, I want to explain the access model, walk through a database-and-logs workflow, and describe the boundaries of the approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with a growing MCP setup
&lt;/h2&gt;

&lt;p&gt;A database connection is useful on its own. Add an SSH log server, a cloud integration, a few external MCP servers, and separate development and production environments, and there are more decisions to keep track of.&lt;/p&gt;

&lt;p&gt;Each integration may have its own credentials, tool names, permission model, approval behavior, and logs. Using several AI clients adds another place to configure and review those choices.&lt;/p&gt;

&lt;p&gt;The difficult part is understanding the combined access you have granted.&lt;/p&gt;

&lt;p&gt;A request such as “investigate this failed job” might lead to several calls: discovering a schema, reading records, searching logs, inspecting infrastructure, and proposing a change. The natural-language request does not specify every step in advance.&lt;/p&gt;

&lt;p&gt;A chat transcript can explain what the assistant thinks it did. I also want an execution history that shows the tools it actually called, their arguments, the target environment, and the decisions made along the way.&lt;/p&gt;

&lt;p&gt;For me, useful AI access needs three things together: &lt;strong&gt;a defined scope, control over changes, and a reviewable history.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  One gateway, with access scoped to each endpoint
&lt;/h2&gt;

&lt;p&gt;GateRook runs as a desktop application between the AI client and the connected services.&lt;/p&gt;

&lt;p&gt;You add connections in GateRook, choose which connections and tools an endpoint exposes, and connect the AI client to that endpoint. The gateway handles authentication, evaluates the applicable rules, and records the calls passing through it.&lt;/p&gt;

&lt;p&gt;An endpoint can provide one entry point for several resources. You can also keep separate endpoints for different purposes: for example, development work and production investigation.&lt;/p&gt;

&lt;p&gt;That distinction matters. “One place to connect” should not mean “every client gets access to everything.”&lt;/p&gt;

&lt;p&gt;A small setup might look like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Resource&lt;/th&gt;
&lt;th&gt;Access for an investigation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Development database&lt;/td&gt;
&lt;td&gt;Read queries; changes require approval&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Selected application log files over SSH&lt;/td&gt;
&lt;td&gt;List, read, and search within configured limits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production database&lt;/td&gt;
&lt;td&gt;A separately scoped endpoint with stricter permissions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;External MCP tools&lt;/td&gt;
&lt;td&gt;Only the reviewed tools needed for the task&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;GateRook includes built-in connectors for databases, logs, SSH, APIs, and cloud services. It can also connect external MCP servers, so existing integrations can participate in the same access model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa6akwhvlyxdtim0v0o16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa6akwhvlyxdtim0v0o16.png" alt="GateRook Overview showing development and production endpoints, connected AI apps, and connection health" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Overview groups connections by endpoint and shows which AI applications are connected.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A history of every tool call through the gateway
&lt;/h2&gt;

&lt;p&gt;One of the main things I wanted was a place to inspect &lt;strong&gt;all tool calls routed through GateRook&lt;/strong&gt;, including calls that were denied or failed.&lt;/p&gt;

&lt;p&gt;The Activity view brings together the AI client, endpoint, connection, environment, tool, arguments, policy decision, duration, and outcome information. You can filter the history to investigate a particular client, connection, tool, or time period.&lt;/p&gt;

&lt;p&gt;This is useful for ordinary debugging as well as access control.&lt;/p&gt;

&lt;p&gt;If the assistant produces an unexpected answer, the history helps you check whether it queried the wrong environment, searched too narrow a time range, encountered a policy denial, or received an error. If it proposes a change, you can inspect the calls that led up to that proposal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0jo7c8933r5srsevbz52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0jo7c8933r5srsevbz52.png" alt="GateRook Activity showing tool calls, connections, clients, policy decisions, and execution durations" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Activity shows calls across connections and clients, including successful calls, policy denials, and errors.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Recording denied attempts matters too. A rejected operation is part of the explanation of what happened.&lt;/p&gt;

&lt;p&gt;The scope here is specific: GateRook records activity that passes through its gateway. An agent's separate terminal commands or direct connections are outside that history. Stored payloads also have masking and size limits; a useful audit trail does not require retaining every byte of sensitive output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review the exact action before a change runs
&lt;/h2&gt;

&lt;p&gt;GateRook requires review for changes by default.&lt;/p&gt;

&lt;p&gt;When a call needs approval, the application presents the prepared action and its target. For a database update, that means being able to inspect the SQL, the connection and environment, the reason approval is required, and available impact information.&lt;/p&gt;

&lt;p&gt;Consider this illustrative development-database change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'new-address@example.com'&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before approving it, I want to check the target database, the table, the condition, and the value being written. A generic “the assistant wants to use a tool” prompt would leave too much of that review implicit.&lt;/p&gt;

&lt;p&gt;The approval is tied to the prepared action stored by the gateway. After approval, GateRook executes that stored payload, with the applicable checks, instead of asking the model to reconstruct the command.&lt;/p&gt;

&lt;p&gt;You can approve or deny the request. An unanswered request expires; waiting does not turn into permission.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9dbvb882uw2dullyuk7d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9dbvb882uw2dullyuk7d.png" alt="GateRook approval card for a sql_execute request on the pb-mysql-local development connection, marked Waiting for approval and Not executed." width="800" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A pending SQL request shown in the AI client. “Approve in GateRook” opens the app’s review screen; the action remains unexecuted until you approve it there.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Approval behavior is configurable. GateRook has explicit per-tool Bypass settings, and temporary bypass is available for specific tools and connections in development and staging. Bypass skips the human approval step while retaining applicable policy limits.&lt;/p&gt;

&lt;p&gt;That makes the chosen mode part of the access decision. For a workflow where I want to review every change, I keep those tools in approval mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep infrastructure credentials on the gateway side
&lt;/h2&gt;

&lt;p&gt;To search logs or query a database, the model needs access to an allowed operation. It does not need the underlying authentication material in the conversation.&lt;/p&gt;

&lt;p&gt;With GateRook, connection credentials are configured on the gateway side. The model works with connection names and permitted tool arguments; GateRook handles authentication to the selected service.&lt;/p&gt;

&lt;p&gt;That means I do not need to paste database passwords, API keys, or SSH private keys into a prompt. Stored secrets are encrypted, and the application can also reference supported external secret stores.&lt;/p&gt;

&lt;p&gt;There is an important distinction between &lt;strong&gt;connection credentials&lt;/strong&gt; and &lt;strong&gt;the data a tool returns&lt;/strong&gt;. A database row or log line can itself contain sensitive information. Credential isolation therefore works alongside access restrictions, masking rules, and bounded results.&lt;/p&gt;

&lt;p&gt;The claim is that GateRook keeps the configured infrastructure credentials out of the model's tool arguments. It is not a guarantee that every possible secret in arbitrary source data will be detected, or that a separate agent with broad access to the same computer cannot reach files through another route.&lt;/p&gt;

&lt;h2&gt;
  
  
  Search remote logs without giving the AI an SSH key
&lt;/h2&gt;

&lt;p&gt;The SSH log connector is a concrete example of this approach.&lt;/p&gt;

&lt;p&gt;You configure SSH authentication in GateRook and explicitly select the remote files the connection may access. The AI can then use structured tools such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ssh_logs_list&lt;/code&gt; to discover the selected files.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh_logs_read&lt;/code&gt; to read a bounded portion of a file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh_logs_search&lt;/code&gt; to search by text, level, and event time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, after configuring a connection named &lt;code&gt;server-logs&lt;/code&gt; and selecting &lt;code&gt;app.log&lt;/code&gt;, a search could use these arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"connection"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"server-logs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"file"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"app.log"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"matchMode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"literal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"levels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ERROR"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"WARN"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"from"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"-1h"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"to"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"now"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"maxLines"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request identifies the connection, file, filters, and desired output size. It contains no SSH private key.&lt;/p&gt;

&lt;p&gt;GateRook builds the bounded commands used to read the selected files. The AI cannot supply an arbitrary shell command through these dedicated log tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fauiecljwiopc97nii8dk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fauiecljwiopc97nii8dk.png" alt="Details of an SSH log search showing its client, connection, timing, and structured arguments without authentication secrets" width="800" height="983"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An SSH log search in Activity, with the client, connection, timing, and structured arguments available for inspection.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The result still needs to be interpreted carefully. Time filters depend on timestamps in the records, and size or time limits can produce partial results. A bounded search returning no matches is not proof that an event never happened.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/msrv-ai/gaterook/blob/main/docs/ssh-log-files.md" rel="noopener noreferrer"&gt;SSH log connector guide&lt;/a&gt; explains file selection, timestamp parsing, limits, and continuation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect existing MCP servers and change access centrally
&lt;/h2&gt;

&lt;p&gt;A gateway is more useful if it can work with integrations you already have.&lt;/p&gt;

&lt;p&gt;GateRook supports external MCP servers alongside its built-in connectors. You choose which tools are exposed through an endpoint and manage their access modes there.&lt;/p&gt;

&lt;p&gt;Connections and tools can be enabled or disabled as the task changes. Tools switched off are not exposed or callable through that endpoint. This gives me a central place to narrow access when an investigation finishes or a resource is no longer needed.&lt;/p&gt;

&lt;p&gt;Compatible clients receive tool-list change notifications. Client discovery and caching behavior still vary, so the gateway's enforced permissions and what a client currently displays are separate concerns.&lt;/p&gt;

&lt;p&gt;External MCP servers also remain software you must trust appropriately. GateRook requires review of external tool definitions and does not treat an upstream &lt;code&gt;readOnlyHint&lt;/code&gt; as proof that an operation is harmless.&lt;/p&gt;

&lt;h2&gt;
  
  
  A database-and-logs investigation
&lt;/h2&gt;

&lt;p&gt;Here is an example workflow using those pieces together. It is an illustration of the setup, not a benchmark or an incident report.&lt;/p&gt;

&lt;p&gt;Suppose a background job is failing and you want the assistant to compare its database state with its application logs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Choose the scope.&lt;/strong&gt; Expose the relevant database tools and selected SSH log files through an investigation endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start with inspection.&lt;/strong&gt; Ask the assistant to inspect the relevant records and search recent logs for the job's error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review the evidence.&lt;/strong&gt; Use Activity to see the actual calls, arguments, environments, decisions, and outcomes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inspect a proposed change.&lt;/strong&gt; If the assistant suggests a database update, review the prepared action in GateRook.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make the decision.&lt;/strong&gt; Approve the exact change, deny it, or let the request expire.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduce access when finished.&lt;/strong&gt; Disable tools or remove connections from the endpoint when they are no longer needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This connects the investigation, the proposed action, and the execution record. It also gives the person reviewing the work a place to make a decision outside the assistant's explanation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other parts of the application
&lt;/h2&gt;

&lt;p&gt;The same application includes connection health, environment-aware policies, execution and output limits, a Playground for trying tool calls, and Insights derived from the audit history.&lt;/p&gt;

&lt;p&gt;HTTP APIs can be added through OpenAPI import, with the server, authentication, and selected operations reviewed before they become tools.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/msrv-ai/gaterook/blob/main/docs/ARCHITECTURE.md" rel="noopener noreferrer"&gt;architecture document&lt;/a&gt; describes the call flow, credential handling, approval model, and implementation boundaries in more detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I want to keep improving
&lt;/h2&gt;

&lt;p&gt;GateRook is still in development. Its current scope is a desktop application for one local user.&lt;/p&gt;

&lt;p&gt;There are practical tradeoffs to work through. A central gateway becomes an additional component to configure and trust. Approval prompts need enough detail to support a real decision without making routine work exhausting. Audit history needs enough context to explain events while respecting sensitive data and retention limits.&lt;/p&gt;

&lt;p&gt;I want the access model to stay understandable as the number of connections grows. At any point, I should be able to see what an AI client can reach, review a consequential action, and trace what actually happened.&lt;/p&gt;

&lt;p&gt;If you use several MCP servers, I would be interested in how you handle that today. Which operations do you review manually, and what information do you need in a tool-call history to investigate a problem?&lt;/p&gt;

&lt;h2&gt;
  
  
  Project and source
&lt;/h2&gt;

&lt;p&gt;GateRook is available under the Apache 2.0 license.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Website:&lt;/strong&gt; &lt;a href="https://gaterook.com" rel="noopener noreferrer"&gt;GateRook&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/msrv-ai/gaterook" rel="noopener noreferrer"&gt;msrv-ai/gaterook&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
