> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Manage dbt platform accounts from Guild agents

> Connect Guild agents to dbt to manage projects, environments, connections, repositories, users, groups, service tokens, and webhooks.

Integrations · dbt

A Guild agent can set up and maintain dbt platform accounts: create projects and environments, wire up connections and repositories, and manage users, groups, and tokens. Guild stores your dbt token server-side and injects it at request time, so agent code never sees the secret. Credential policies let you restrict which operations each agent may call, and every request is logged for audit.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use dbt.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect dbt to your first agent.

## What the dbt integration exposes

The integration package `guildai~dbt` wraps the dbt platform Admin API (v3). Its tools cover accounts, projects, environments and environment variables, connections and credentials, repositories, users, groups and permissions, service tokens, personal access tokens, webhooks, IP restrictions, SCIM, and audit logs. Tools follow the `dbt_` naming prefix.

The integration manages account configuration. It doesn't trigger jobs or read run results, because those endpoints are in the v2 API, which this integration doesn't include.

## How it works

**1. Create a dbt token**

In dbt, open **Account settings** and create a service token with the permissions your agents need. A personal access token also works, and acts as you.

**2. Connect the credential in Guild**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **dbt**, and paste the token into **API Key**.

**3. Add DbtTools to your agent**

Import `DbtTools` from `@guildai-services/guildai~dbt` and spread it into your agent's `tools` object. Most tools take your dbt account ID, which `dbt_list_accounts` returns.

## Why dbt access needs governing

A dbt token with admin permissions can delete projects and environments, rotate or destroy service tokens, change warehouse credentials, and change group permissions across the account. Guild stores the token server-side and injects it through its credential proxy, so the token never appears in agent code or logs.

[Credential policies](https://docs.guild.ai/platform/credential-policies.md) let you write ALLOW and DENY rules that the proxy enforces before any request leaves Guild. You can restrict an agent to read-only calls with a GET-only methods rule, or block destructive tools such as `dbt_destroy_project` and `dbt_destroy_service_token` by name or pattern. Credentials can be scoped to an account, a single workspace, a specific member, or one agent. The permission set on the dbt token is a second limit: a token with read-only permissions can't make changes whatever the policy allows.

## About the dbt integration

Agents can list and configure dbt projects, environments, connections, and repositories, and manage the users, groups, and tokens that reach them. They can also manage webhook subscriptions, IP restrictions, and SCIM, and export audit logs. The integration is `guildai~dbt`.

The integration calls `cloud.getdbt.com`. Accounts that use a different access URL, such as a regional or single-tenant host, aren't supported yet.

## Authentication

* **Type:** API key
* **Header:** Guild sends the token as a bearer token in the `Authorization` header

### Setup

**1. Get a token**

Create a service token (**Account settings > Service tokens**) or a personal access token in dbt.

**2. Connect dbt**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **dbt**, and paste the token into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { DbtTools } from "@guildai-services/guildai~dbt"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You manage our dbt platform account.",
  tools: { ...DbtTools },
})
```

### Selecting specific tools

Tools are named with the `dbt_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~dbt`:

> [accordion] All 141 tools
>
> | Tool | What it does |
> | - | - |
> | `dbt_assign_group_permissions` | assign\_group\_permissions |
> | `dbt_assign_user_to_groups` | assign\_user\_to\_groups |
> | `dbt_create_account_connection` | Create a new Account Connection. |
> | `dbt_create_account_scoped_pat` | create\_account\_scoped\_pat |
> | `dbt_create_adapter` | Create a new adapter for a project. |
> | `dbt_create_connection` | Create a new Connection |
> | `dbt_create_credentials` | Create a new set of credentials to associate with a user or environment. |
> | `dbt_create_environment` | Create a new Environment |
> | `dbt_create_extended_attributes` | Create a new Extended Attributes record. |
> | `dbt_create_group` | create\_group |
> | `dbt_create_license_map` | create\_license\_map |
> | `dbt_create_lineage_integration` | create\_lineage\_integration |
> | `dbt_create_managed_repository` | Create a new dbt Cloud managed repository. |
> | `dbt_create_o_auth_configuration` | Create a new OAuthConfiguration |
> | `dbt_create_private_endpoint` | Create a new Private Endpoints List Alias View. |
> | `dbt_create_profile` | Create a new profile. |
> | `dbt_create_project` | Create a new Project |
> | `dbt_create_projects_environment_variable` | create\_projects\_environment\_variable |
> | `dbt_create_projects_environment_variables_bulk` | create\_projects\_environment\_variables\_bulk |
> | `dbt_create_repository` | Create a new repository for the given project |
> | `dbt_create_scim_configuration` | Create SCIM configuration for the account |
> | `dbt_create_scim_token` | Create a SCIM token |
> | `dbt_create_service_token` | This endpoint is used to generate a new service token for the account. |
> | `dbt_create_user_credentials` | Associate a set of development credentials with a given user. |
> | `dbt_create_webhooks_subscription` | Create a new webhook subscription |
> | `dbt_delete_account_connection_delete` | Delete an existing Account Connection Delete. |
> | `dbt_delete_account_scoped_pat` | delete\_account\_scoped\_pat |
> | `dbt_delete_credentials` | Delete a set of credentials. |
> | `dbt_delete_environment_sao_cache` | Clear the environment SAO (State Aware Orchestration) cache in Redis for the given environment |
> | `dbt_delete_ip_restriction` | delete\_ip\_restriction |
> | `dbt_delete_lineage_integration` | delete\_lineage\_integration |
> | `dbt_delete_private_endpoint` | - |
> | `dbt_delete_profile` | Delete an existing profile. |
> | `dbt_delete_scim_group` | Delete a group via SCIM |
> | `dbt_delete_scim_token` | Delete the specified SCIM token |
> | `dbt_delete_scim_user` | Delete a user via SCIM. |
> | `dbt_delete_user_credentials` | Delete a development credentials / user association. |
> | `dbt_destroy_adapter` | Delete an adapter. |
> | `dbt_destroy_connection` | Delete a Connection |
> | `dbt_destroy_environment` | Delete an Environment |
> | `dbt_destroy_extended_attributes` | Delete an existing Extended Attributes record. |
> | `dbt_destroy_license_map` | destroy\_license\_map |
> | `dbt_destroy_o_auth_configuration` | Delete an OAuth Configuration |
> | `dbt_destroy_project` | Delete Project |
> | `dbt_destroy_projects_environment_variable` | destroy\_projects\_environment\_variable |
> | `dbt_destroy_projects_environment_variables_bulk` | destroy\_projects\_environment\_variables\_bulk |
> | `dbt_destroy_repository` | Delete a repository |
> | `dbt_destroy_service_token` | destroy\_service\_token |
> | `dbt_destroy_webhooks_subscription` | Delete a specific subscription |
> | `dbt_download_bulk_audit_log_export` | Download a bulk export of audit log events. |
> | `dbt_enable_ip_restrictions` | Toggle the enablement of the IP restriction feature. |
> | `dbt_get_account_scoped_pat` | get\_account\_scoped\_pat |
> | `dbt_get_bulk_audit_log_export_status` | Check the status of a bulk export request. |
> | `dbt_get_credentials` | Fetch a specific set of credentials. |
> | `dbt_get_lineage_integration` | get\_lineage\_integration |
> | `dbt_get_recent_audit_log_events_csv` | Generate audit log CSV |
> | `dbt_get_user_credentials` | Get a development credentials association for a given user. |
> | `dbt_list_account_connections` | List all Account Connections. |
> | `dbt_list_accounts` | List the Accounts that your API Token is authorized to access. |
> | `dbt_list_account_scoped_pa_ts` | list\_account\_scoped\_pa\_ts |
> | `dbt_list_collections_from_bi_tool` | list\_collections\_from\_bi\_tool |
> | `dbt_list_collections_from_bi_tool_2` | list\_collections\_from\_bi\_tool\_2 |
> | `dbt_list_connections` | List Connections |
> | `dbt_list_credentials` | List the credentials for a given project. |
> | `dbt_list_environments` | List Environments |
> | `dbt_list_favorite_asset_responses` | List all Favorite Asset Responses. |
> | `dbt_list_groups` | list\_groups |
> | `dbt_list_ip_restrictions` | list\_ip\_restrictions |
> | `dbt_list_license_maps` | list\_license\_maps |
> | `dbt_list_lineage_integrations` | list\_lineage\_integrations |
> | `dbt_list_o_auth_configurations` | List OAuthConfigurations |
> | `dbt_list_private_endpoints` | List all Private Endpoints. |
> | `dbt_list_profiles` | List profiles. |
> | `dbt_list_projects` | List Projects |
> | `dbt_list_recent_audit_log_events` | Fetch paginated audit log events. |
> | `dbt_list_repositories` | List repositories for the given project |
> | `dbt_list_semantic_layer_credentials` | list\_semantic\_layer\_credentials |
> | `dbt_list_service_tokens` | list\_service\_tokens |
> | `dbt_list_user_credentials` | List the development credentials associated with a given user. |
> | `dbt_list_users` | List users for a given account. |
> | `dbt_list_webhooks_event_receipts` | Get all receipts for a given event id. |
> | `dbt_list_webhooks_events` | Get all events for a specific subscription |
> | `dbt_list_webhooks_subscription_event_receipt` | Get the receipt for a given subscription id and event id. |
> | `dbt_list_webhooks_subscriptions` | Given an account id list all webhook subscriptions |
> | `dbt_partial_update_credentials` | Partially update a set of credentials. |
> | `dbt_retrieve_account_connection` | Retrieve details of a specific Account Connection. |
> | `dbt_retrieve_adapter` | Get an adapter by ID. |
> | `dbt_retrieve_adapter_schema` | ". |
> | `dbt_retrieve_connection` | Retrieve a Connection |
> | `dbt_retrieve_environment` | Retrieve an Environment |
> | `dbt_retrieve_extended_attributes` | Retrieve an existing Extended Attributes record. |
> | `dbt_retrieve_group` | retrieve\_group |
> | `dbt_retrieve_ip_restriction` | retrieve\_ip\_restriction |
> | `dbt_retrieve_license_map` | retrieve\_license\_map |
> | `dbt_retrieve_o_auth_configuration` | Retrieve an OAuth Configuration |
> | `dbt_retrieve_private_endpoint` | Retrieve details of a specific Private Endpoint. |
> | `dbt_retrieve_profile` | Retrieve a specific profile. |
> | `dbt_retrieve_project` | Retrieve a Project |
> | `dbt_retrieve_projects_environment_variables_environment` | retrieve\_projects\_environment\_variables\_environment |
> | `dbt_retrieve_projects_environment_variables_job` | retrieve\_projects\_environment\_variables\_job |
> | `dbt_retrieve_projects_environment_variables_user` | retrieve\_projects\_environment\_variables\_user |
> | `dbt_retrieve_projects_managed_repositories_download` | Download a managed repository as a ZIP archive |
> | `dbt_retrieve_repository` | Get a repository by ID |
> | `dbt_retrieve_scim_configuration` | Retrieve the SCIM configuration for the account |
> | `dbt_retrieve_scim_token` | Retrieve the specified SCIM token |
> | `dbt_retrieve_scim_tokens` | Retrieve all SCIM tokens |
> | `dbt_retrieve_scim_v2_serviceproviderconfig` | Get the SCIM Service Provider Config |
> | `dbt_retrieve_service_token` | retrieve\_service\_token |
> | `dbt_retrieve_service_tokens_permission` | List permissions of a given ServiceToken for an account. |
> | `dbt_retrieve_user` | retrieve\_user |
> | `dbt_retrieve_webhooks_event` | Get a specific event given an event\_id. |
> | `dbt_retrieve_webhooks_receipt` | Get a specific receipt given its id. |
> | `dbt_retrieve_webhooks_subscription` | Get a specific subscription with a subscription id |
> | `dbt_rotate_account_scoped_pat` | rotate\_account\_scoped\_pat |
> | `dbt_save_ip_restriction` | Save net-new ip restriction rule |
> | `dbt_send_user_invites` | Send email invites to users who you wish to add to this account |
> | `dbt_submit_bulk_audit_log_export_request` | Submit a bulk export request. |
> | `dbt_test_webhooks_subscription` | Test the client endpoint for a given subscription |
> | `dbt_update_account_connection` | Update an existing Account Connection. |
> | `dbt_update_adapter` | Update an adapter. |
> | `dbt_update_connection` | Update a Connection |
> | `dbt_update_credentials` | Update a set of credentials. |
> | `dbt_update_environment` | Replace an Environment. |
> | `dbt_update_extended_attributes` | Update an existing Extended Attributes record. |
> | `dbt_update_group` | update\_group |
> | `dbt_update_ip_restriction` | Update an existing ip restriction rule |
> | `dbt_update_license_map` | update\_license\_map |
> | `dbt_update_lineage_integration` | update\_lineage\_integration |
> | `dbt_update_lineage_integration_selections` | update\_lineage\_integration\_selections |
> | `dbt_update_o_auth_configuration` | Update an OAuthConfiguration |
> | `dbt_update_private_endpoint` | - |
> | `dbt_update_profile` | Update an existing profile. |
> | `dbt_update_project` | Update a Project |
> | `dbt_update_projects_environment_variable` | update\_projects\_environment\_variable |
> | `dbt_update_projects_environment_variables_bulk` | update\_projects\_environment\_variables\_bulk |
> | `dbt_update_repository` | Update a repository |
> | `dbt_update_service_token` | update\_service\_token |
> | `dbt_update_user_credentials` | Update which development credentials are associated with a specific user. |
> | `dbt_update_webhooks_subscription` | Edit a subscription given a subscription id |
> | `dbt_validate_client_ip_against_ip_restrictions` | This endpoint returns whether the client ip is acceptable based on the configured ip restriction rules associated to the rule set. |
> | `dbt_validate_client_ip_against_ip_restrictions_excluding_specified_ip_rule` | This endpoint returns whether the client ip is acceptable based on the configured ip restriction rules associated to the rule set - excluding the ip rule id passed into the url |

## Frequently asked questions

> [accordion] Can an agent trigger a dbt job or read run results?
>
> No. Jobs and runs are in the dbt Admin API v2, which this integration doesn't include. It manages account configuration: projects, environments, connections, users, groups, tokens, and webhooks.

> [accordion] Should I use a service token or a personal access token?
>
> Use a service token for agents. It isn't tied to a person, and its permission set limits what the agent can do. A personal access token acts with your own permissions.

> [accordion] Where does an agent get the account ID?
>
> Most tools take the dbt account ID as a parameter. The agent can call `dbt_list_accounts` to find it, or you can put it in the agent's system prompt.

> [accordion] Does it work with dbt accounts on a regional or single-tenant host?
>
> Not yet. The integration calls `cloud.getdbt.com`, so it reaches accounts on that host only.

> [accordion] Does Guild expose the dbt token to the agent?
>
> No. Guild stores the token server-side and injects it through its credential proxy. Agent code never sees the secret, and the proxy enforces any credential policies before the request reaches dbt.

## Put a governed agent on dbt this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use dbt.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect dbt to your first agent.

## Related

**Also runs on Guild:** [BigQuery](https://docs.guild.ai/integrations/bigquery.md) · [Hex](https://docs.guild.ai/integrations/hex.md) · [CockroachDB](https://docs.guild.ai/integrations/cockroachdb.md) · [Neon](https://docs.guild.ai/integrations/neon.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
