Run Kuriko

Data sources

A data source is somewhere tools read company data from. You describe it in policy.yaml, grant it to groups, and apply. No code, and no credential ever leaves your secret manager.

Pick your source

SourcekindKuriko signs in withTools can
BigQuerybigqueryIts own identity. No secret at allRead tables and views
SnowflakesnowflakeA key pair; the private key is a secretRead tables and views
PostgrespostgresA read-only user's connection URLRead tables
Any JSON APIapiAn API key or token, or each person's OAuth sign-inRead, and add rows. HubSpot, Linear, GitHub, Google Drive, Notion, your own services…
Amazon Redshift SoonredshiftKuriko's own identity on AWSRead tables and views
Databricks SoondatabricksA service principalRead Unity Catalog tables and views
Microsoft Fabric SoonfabricEntra IDRead Fabric Warehouse and Synapse tables. Also SQL Server and Azure SQL
Databases on a private network SoonToday a database must accept connections from the gateway.

There are only two shapes. A database or warehouse (postgres, snowflake, bigquery) has tables. Anything with an HTTP API is the api kind, which you describe in policy.yaml, from the API's own docs. Kuriko has no code for any particular product: every API is described the same way.

Every source works the same way once it's in policy.yaml: grants, row rules and masking apply to all of them, and a tool reads every row the person may see, up to 10,000 per read. Past that, the read says truncated instead of quietly dropping rows.

Your warehouse is . Its section is BigQuery: no credential to store.

Reading and writing

A grant says read or write (which includes read). A tool declares the same when it's registered, and the gateway checks both on every request, so a tool can only add rows where it said it would, for people whose grants allow it.

Sourcereadwrite
An api resource with addEvery row the person may seeAdd rows, through the request you describe
An api resource without addEvery row the person may seeRefused: kuriko policy plan rejects a write grant on it
Databases and warehousesEvery row the person may seeRead-only: Kuriko signs in as a read-only user

A row rule on a write grant decides which rows someone may add: with owner_email: $me, people only add rows as themselves. Writes are adds; tools don't change or remove rows that are already there.

Who can be granted a source

Grants name groups from , the provider your people sign in to Kuriko with. Kuriko reads someone's groups at sign-in, and only the groups policy.yaml mentions.

Sign-in providerGroups come from
Google WorkspaceGoogle groups, looked up at sign-in by Kuriko's web identity (Groups Reader)
Okta SoonOkta groups, from a groups claim on the app's sign-in token
Microsoft Entra ID SoonEntra groups, looked up at sign-in through Microsoft Graph, so people in hundreds of groups still get all of theirs
Any SAML provider SoonThe groups attribute in the SAML sign-in

This is about signing in to Kuriko. A per-person source is separate: people connect their own account at the source (HubSpot, Google Drive…) once, whichever provider they sign in to Kuriko with.

Adding a source, step by step

  1. Store the credential

    Skip this for BigQuery. For a per-person source, the credential is the OAuth app's client secret. Whoever manages credentials puts it in Secret Manager under any name (an existing secret is fine, including one in another project: projects/<project>/secrets/<name>):

    Terminal
    read -s VALUE && printf '%s' "$VALUE" | \  gcloud secrets create warehouse-readonly --project <project-id> --data-file=- && unset VALUE

    That reads the value without showing it or saving it in your shell history.

    On an install Kuriko runs for you, use kuriko secret set warehouse-readonly instead. It asks for the value hidden and stores it in your install's secret manager, through Kuriko. (It works on your own install too.)

  2. Describe it under connectors

    In the install's policy.yaml, using the section for its kind below. The id you give it (lowercase, like hubspot) is the name tools use.

  3. Grant it to a group under access

    policy.yaml
    access:  - group: sales@acme.com       # or everyone    connector: hubspot    resources: [contacts]    access: read

    Until a grant names it, nobody can use a source, admins included.

  4. Plan, then apply

    Terminal
    kuriko policy plan     # checks the file; prints anything someone else must dokuriko policy apply

    plan lists every mistake at once, and prints what only someone else can do: the Terraform that gives Kuriko a BigQuery dataset, and the OAuth redirect URI for a per-person source. apply lets the gateway read exactly the secrets the file names, and nothing else.

  5. Check it

    Prompt
    Use Kuriko's query_data to show me a few rows of hubspot contacts.

    A builder's AI tool reads it as them, masked as for them. If it works here, it works in a tool.

Shared or per-person

  • Shared. One credential, used for everyone you grant access. What each person sees is decided by their grants: masked fields, and row rules if you set any. Best for databases, warehouses and company-wide API keys.
  • Per-person (credentials: per-person). Each person connects their own account once, and tools act as them: they see exactly what that person can see there, nothing more. Best for apps people already sign in to, like HubSpot or Google Drive. The grant decides who may use the source at all; the source decides the rest.

People connect the first time a tool needs it (the tool shows a Connect button), from Your data access on Kuriko's home page, or from the link my_connections gives them in their AI tool. Their tokens are encrypted with your Cloud KMS key and bound to them: one copied to anyone else won't decrypt. Removing the source from policy.yaml deletes everyone's connection.

BigQuery

No credential. Kuriko's gateway reads as its own service account, and whoever manages the dataset gives it read access in their own Terraform, so their next terraform apply never undoes it. kuriko install asks whether you have a warehouse and writes this for you; to add one later:

policy.yaml
connectors:  bq-analytics:    name: Analytics (BigQuery)    kind: bigquery    dataset: analytics    project: data-warehouse-prod     # only if it isn't Kuriko's own projectaccess:  - group: data@acme.com    connector: bq-analytics    resources: ["*"]                 # every table and view, including new ones    access: read
  • kuriko policy plan checks whether the gateway can read each dataset yet, and if not prints the google_bigquery_dataset_iam_member (or access block) for the data team to add. Until it lands, reads say there's no access yet.
  • Plain reads are free (they list the table). Reads with row rules, and views, run a query billed to Kuriko's project.

Snowflake

Kuriko signs in as a read-only user with a key pair. kuriko install can make the key, put the private half straight into Secret Manager, and print the SQL that creates the role and user, for an ACCOUNTADMIN to run once.

policy.yaml
connectors:  snowflake:    name: Analytics (Snowflake)    kind: snowflake    secret: snowflake-kuriko-key   # the private key (unencrypted PKCS#8 PEM)    account: acme-analytics        # orgname-accountname, from Admin → Accounts    user: KURIKO_READER    role: KURIKO_READ    warehouse: COMPUTE_WH    database: ANALYTICS    schema: PUBLIC

Grant it like any other source. Resources are table and view names in that schema, or ["*"].

Postgres

Store a connection URL for a read-only database user as a secret. Resources are tables in the schema you name; row rules name columns.

policy.yaml
connectors:  app-db:    name: App database    kind: postgres    secret: warehouse-readonly     # postgres://reader:…@db.acme.com:5432/app    schema: public                 # the default

The same kind covers anything that speaks Postgres: Cloud SQL, AlloyDB, Amazon RDS, Supabase, Neon.

Amazon Redshift

Kuriko will read Redshift through the Redshift Data API as its own IAM role, the way it reads BigQuery as its own identity: no password to store, and whoever manages the cluster grants the role access in their own Terraform. It comes with Kuriko on AWS.

  • Resources will be tables and views in the schema you name, with row rules and masking as for every source.
  • Before then, Redshift also speaks Postgres's protocol, so a read-only user's URL in the postgres kind may already work. We haven't tried it yet: tell us if you do.

Databricks

Kuriko will sign in to a SQL warehouse as a Databricks service principal (OAuth machine-to-machine), with the principal's secret in Secret Manager, on any cloud. It reads like Snowflake: the same grants, row rules in the query it sends, and masking.

  • Resources will be Unity Catalog tables and views: a catalog and schema on the connector, table names in grants.
  • kuriko install will ask about it alongside BigQuery and Snowflake, and print the grants to give the principal.

Microsoft Fabric

Kuriko will read Fabric Warehouse and Synapse tables, signed in with Entra ID: as a service principal, or as its own managed identity when Kuriko runs on Azure, so there's no secret at all.

  • The same kind will cover SQL Server and Azure SQL, which speak the same protocol.
  • Resources will be tables and views in the schema you name, with row rules and masking as for every source.

Any JSON API

The api kind describes a JSON API in policy.yaml instead of in code: where it is, how Kuriko signs in, and for each resource which URL lists it, where the rows are in the answer, how to ask for the next page, and, if tools should add rows, how.

Shared credential

policy.yaml
connectors:  hubspot:    name: HubSpot    kind: api    base_url: https://api.hubapi.com    secret: hubspot-private-app-token    auth: bearer                   # or basic (the secret is user:password), or header X-Api-Key    resources:      contacts:        path: /crm/v3/objects/contacts?limit=100&properties=email,firstname,lastname        rows: results                                     # where the list is in the answer        next: { cursor: paging.next.after, param: after } # how to get the next page

An API that wants other fixed headers, like a version, takes them under headers: headers: { Notion-Version: "2022-06-28" }. They're plain settings, so plan refuses any that look like a credential; those go in a secret, sent with auth: header ….

Describing a resource

SettingValue
pathThe path under base_url, with any query string: /crm/v3/objects/contacts?limit=100.
methodGET (default), or POST for search and GraphQL endpoints. This is still a read; adding rows is add, below.
bodyWith POST: the JSON object sent.
rowsWhere the list is in the answer, dotted: results, data.items. Leave it out if the answer is the list.
nextHow to get the next page, one of the shapes below. Leave it out if there's one page.
addOptional. How tools add a row: see Letting tools add rows.
nextWhen the API…
{ cursor: paging.next.after, param: after }returns a cursor, sent back as a query parameter. Add more: has_more if it also says whether there's another page.
{ cursor: …, body: variables.after }takes the cursor in the POST body, as GraphQL APIs do.
{ url: next }returns the next page's full URL.
linkputs the next page in the Link header, as GitHub and Shopify do.
{ page: page }numbers its pages from 1 (add start: 0 if they start at 0). Stops at an empty page.
{ offset: offset }takes a row offset. Stops at an empty page.
policy.yaml: a GraphQL API
connectors:  linear:    name: Linear    kind: api    base_url: https://api.linear.app    secret: linear-api-key    auth: header Authorization    resources:      issues:        path: /graphql        method: POST        body: { query: "query($after: String) { issues(first: 100, after: $after) { nodes { id title assignee { email } } pageInfo { hasNextPage endCursor } } }" }        rows: data.issues.nodes        next: { cursor: data.issues.pageInfo.endCursor, more: data.issues.pageInfo.hasNextPage, body: variables.after }

Tools get each row as the API sends it. If an API nests its values (HubSpot's properties.email, Airtable's fields.Name), tools read them nested. Row rules can name nested fields with dots, like assignee.email: $me. An error from the API reaches the tool as its message, not a bare 500.

Letting tools add rows

Give a resource an add and tools can add rows to it, with a write grant. Without one, the resource is read-only, and kuriko policy plan refuses a write grant on it. $row is where the tool's values go:

policy.yaml
      contacts:        path: /crm/v3/objects/contacts?limit=100        rows: results        add:          path: /crm/v3/objects/contacts     # always a POST, under base_url          body: { properties: $row }         # HubSpot wants the values under properties          row: ""                            # where the new row is in the answer (default: all of it)
  • Leave body out and the values are sent as they are. For GraphQL, put $row in the variables: variables: { input: $row } with row: data.issueCreate.issue.
  • Grant it with access: write. A row rule on the grant decides which rows someone may add: with owner_email: $me, people only add rows as themselves.
  • The tool gets the new row back as the API returned it, id included, and an error from the API as its message.
  • For a per-person source, the row is added as the person, with their own account, so the API's own permissions apply too.

Each person's own account (OAuth)

Add credentials: per-person and describe the provider's OAuth app. The client secret is the connector's secret; everything else is public and lives in the file. Leave auth out: each person's token is sent as a bearer token.

policy.yaml: Google Drive, as each person
connectors:  gdrive:    name: Google Drive (yours)    kind: api    credentials: per-person    base_url: https://www.googleapis.com/drive/v3    secret: gdrive-oauth-client-secret    oauth:      authorize_url: https://accounts.google.com/o/oauth2/v2/auth      token_url: https://oauth2.googleapis.com/token      client_id: 1234567890-abc.apps.googleusercontent.com      scopes: [https://www.googleapis.com/auth/drive.metadata.readonly]      authorize_params: { access_type: offline, prompt: consent }   # Google: so tokens refresh    resources:      files:        path: /files?pageSize=1000&q=trashed=false&fields=nextPageToken,files(id,name,mimeType,modifiedTime)        rows: files        next: { cursor: nextPageToken, param: pageToken }
oauth settingValue
authorize_urlWhere people are sent to sign in and approve.
token_urlWhere Kuriko swaps the code for tokens, and refreshes them.
client_idThe OAuth app's client ID.
scopesWhat to ask for: prefer read-only scopes. Add scope_separator: "," for providers that want commas.
authorize_paramsOptional. Extra settings for the sign-in URL, like Google's access_type: offline.
client_authOptional. body (default) or basic: how the client secret is sent to token_url.
accountOptional. Where the account's name or email is in the token answer, to show who connected.

In the provider's OAuth app, register the redirect URI kuriko policy plan prints: https://kuriko-gateway-<project-number>.europe-west2.run.app/connect/callback.

What Kuriko checks

  • The credential only ever goes to base_url: https, a public hostname (not an IP address or internal name). Every next page is checked against it, and redirects aren't followed.
  • Headers that carry credentials can't be written in the file; plan refuses them and says to use a secret.
  • Adding rows goes through the same checks as reading: the tool must declare write, the person needs a write grant, and the request goes only to base_url, with no redirects followed.
  • Row rules are applied as pages arrive, and masking before anything leaves the gateway, as for every source.

Describing a new API? Give your AI tool the API's docs and this page, and have it run kuriko policy plan until the file checks out. Stuck? Tell us.