---
title: "Gateway: warehouse access with a named role and a log | Rig"
description: "Rig Gateway gives people and AI agents their own roles, tokens and row-level access to warehouse data through MCP, with every query logged."
canonical: "https://rig.so/products/gateway"
format: markdown
---

Gateway

# Agents don’t get the warehouse password

Gateway decides who can query what in your warehouse. Each person signs in with their own role, and each AI agent gets a role, a token and a daily call limit of its own. Roles limit the schemas, columns and rows a caller can read, and every query lands in a log under the caller’s name.

[Book a demo](https://rig.so/book-demo)

## The governed path from an agent to your warehouse

### Role

Each agent gets a copy of a role you already trust, named after it. Owner-level roles are never offered as a starting point.

### Token

The agent connects with its own token and a daily call cap. It cannot sign in to Rig, and a leaked token is replaced in one step.

### Row and column limits

The role sets the schemas, tables, columns and rows the agent can read, and PII policies mask sensitive fields.

### Query log

Every call lands in the audit log with the agent’s name and tool, including the calls Gateway refused.

## Claude, Cursor and your agents, under one set of rules

People connect Claude, Claude Code, Cursor, Codex or ChatGPT to Rig over MCP and sign in as themselves, so each tool sees exactly what that person may see. Agents that a team shares, such as a Notion custom agent or a Slack assistant, connect with an agent token instead.

Before a query runs, the tool looks up the certified metric in [Rig Map](https://rig.so/products/rig-map) and Gateway applies the caller’s role. The warehouse password stays with Rig.

Sales ops · 9:42 am

What’s our net revenue retention for enterprise accounts last quarter?

With Rig

Used Rig integration

**Rig**`search_metrics`net\_revenue\_retention

**Rig**`get_metric_details`customer × quarter

**Rig**`execute_sql`1 row returned

NRR for enterprise in 2025 Q4 was 112%.

How it resolved

Resolves to your certified `net_revenue_retention` metric, filtered to `segment = 'enterprise'` for `period = '2025Q4'`. Rows scoped per RBAC.

## Build on the platform

[Rig Map](https://rig.so/products/rig-map)[MCP for your data warehouse](https://rig.so/uses/mcp)[Agent data governance](https://rig.so/use-cases/agent-data-governance)[Data context and governance](https://rig.so/use-cases/data-context-and-governance)[Agent roles guide](https://rig.so/guides/agent-roles)

## How it works

01

### Start the agent from a role you trust

An owner creates the agent from an existing role, usually analyst, and the agent gets its own copy, named after it. Editing the base role later does not change the agent, so it never gains access by accident.

02

### Issue its token and call limit

Rig shows the MCP URL and the token once, for pasting into Claude, Notion, Viktor or any MCP client. The daily call cap is 1,000 by default and resets at midnight UTC. A leaked token is replaced in one step, and the old one stops working at once.

03

### Limit schemas, columns and rows

The Access Matrix sets which datasets a role reaches. Permissions set table, column and row rules, and PII policies mask sensitive fields. Owners can run SQL as a role and see exactly what comes back before granting it.

04

### Read the log

The audit log shows every call with the agent’s name and the tool it ran in. Refused calls show as errors, and switching an agent off refuses its next call on every server.

## What it looks like in your business

A disputes agent that reads payments data and nothing else

A sales assistant in Slack that every rep can use without seeing the admin’s view

Claude and Cursor on certified metrics across the company, under one set of rules

Customer story / Cleo

## How Cleo puts AI agents to work on governed company data

One Cleo Growth Specialist’s agents made 8,023 requests to company data in 30 days, on the certified metrics Cleo’s data team reviews.

[Read the story](https://rig.so/case-studies/cleo)

**8,023**requests from one analyst’s agents in 30 days

**98%**success rate

> “Every team has a Rig agent now. Ops, support, fraud, marketing. We stopped being the bottleneck.”

## Common questions

How do I expose governed business metrics to Claude and Cursor?

Certify the metrics once in Rig Map, then connect Claude or Cursor to Rig’s MCP server. A person signs in with OAuth and gets their own role. An agent gets its own role and token. Either way, the tool looks up the certified metric before it writes SQL, sees only the schemas, columns and rows the role allows, and every call lands in the audit log.

What is an MCP gateway for a data warehouse?

It is a layer between AI tools and the warehouse that identifies each caller, applies its role’s schema, column and row rules, limits how often it can call, and logs every query. Rig’s Gateway does this for people as well as agents.

How do you give AI agents warehouse access with a role and a log?

Create the agent in Rig from a role you trust, narrow what it can reach, set its daily call cap, then paste the MCP URL and token into the agent’s tool. It cannot sign in to Rig, it never appears in your user list, and every call is logged against it by name.

Which tools can connect through Gateway?

Any MCP client can connect, including Claude, Claude Code, Cursor, Codex and ChatGPT. Notion custom agents, Viktor and Claude Tag connect with an agent token.

Can an agent read tables that filter rows per person?

No. Those tables need to know which person is asking, and an agent has no personal identity, so Rig refuses the query rather than guessing. Give the agent a role with its own row rules instead.

Which warehouses does Gateway work with?

It works with Snowflake, BigQuery, Databricks, Redshift, Postgres and the other warehouses Rig connects to, or with a warehouse Rig hosts for you. On Databricks, Unity Catalog grants and column masks carry through.

How does Gateway relate to Rig Map?

Rig Map holds the definitions an agent reads before it writes SQL, and Gateway decides what that agent may query. Both run on the warehouse you already have.

SOC 2 Type 2EU and US hostingRole-based accessYour warehouse or ours

Talk to Rig

## What work do you want to improve?

Tell us where your team spends time, loses money or needs better information.
In a 30-minute call, we’ll discuss the data and systems work that could help.

[Book a demo](https://rig.so/book-demo)Use the platform with your team, or add our engineers.

---

- [This page as HTML](https://rig.so/products/gateway)
- [Site map for language models](https://rig.so/llms.txt)
- [API and agent documentation](https://rig.so/developers)
