Official Terraform Provider

Your AI agents,
as infrastructure
as code

Declare bots, datasets, skills, secrets, and every channel they speak on in HCL. Version it in git, review it in pull requests, and ship an entire agent fleet with one terraform apply.

Infrastructure as Code

The whole agent, declared

Other platforms hand you a dashboard and hope you remember what you clicked. ChatBotKit turns every part of an agent into a declarative resource, so the brain and behavior live in the same workflow as the rest of your infrastructure.

The brain

A bot resource carries the backstory, model, and personality. Drive the backstory from a file() so prompts live in your repo, not a textarea.

The tools

Skillsets and abilities give agents actions — search, fetch, shell, MCP servers, and your own APIs — each one a reviewable resource.

The memory

Datasets and files become searchable knowledge. Link a dataset to a bot and search functions are wired up automatically.

The workspace

A space gives the agent a sandboxed filesystem and shell. Upload skills and scripts with fileset and for_each.

The credentials

Secrets hold shared service tokens or per-user OAuth. Template-based secrets wire up Google, Notion, and more without raw tokens in state.

The channels

Seventeen integrations — Slack, WhatsApp, Telegram, Teams, Email, Twilio, Widget, and more — connect the agent to the world, declaratively.

What others can't do

Beyond ClickOps

When the agent itself is a resource graph, patterns that are impossible to click together become a few lines of HCL. These are real reference architectures that ship with the provider.

run_as

A fleet of tenants from one token

Deploy a separate, isolated agent into every customer sub-account using one master token and the run_as attribute — the same model as the AWS provider assume_role. One apply ships to everyone, no per-customer tokens.

self-improving

Agents that rewrite themselves

Declare the starting state, then give the agent read and write abilities over its own backstory file. It learns from every interaction and updates its own memory while Terraform owns the baseline.

dynamic MCP

Tools discovered at runtime

Provision an agent that searches an MCP registry and installs new tool servers on demand. The capability surface grows itself — something a static dashboard config simply cannot express.

multi-agent

Agents that build for other agents

Compose a Workflow Architect that writes scripts and a Task Runner that executes them, with asymmetric access to a shared space. Separation of concerns, all in one state.

agent-as-files

An agent authored as a project

Keep instructions.md, skills/*/SKILL.md, and heartbeat.md in your repo. Terraform uploads the whole project into a workspace and wires up the tools, channels, and schedules around it.

on-behalf-of

Machine and human identity together

One ability can present a shared service token to clear an internal gateway and a personal OAuth secret to act as the signed-in employee — so your backend enforces the same access control it always does.

The Workflow

Write, plan, apply

A standard Terraform provider that drops into the workflow you already use. No new tooling, no bespoke pipeline.

1

Write

Declare your bot, its datasets, skillsets, secrets, and integrations in HCL. Reference one resource from another and let Terraform resolve the graph.

2

Plan

Run terraform plan to see exactly what will change before anything happens. Review it in a pull request like any other infrastructure change.

3

Apply

One terraform apply provisions the entire agent through the ChatBotKit API. Promote the same config across dev, staging, and production unchanged.

4

Evolve

Iterate in git, import existing resources, and let runtime-capable agents extend themselves while Terraform keeps the baseline reproducible.

The Catalog

Every primitive, 29 resources

From the bot itself down to a single ability or an OAuth secret, the whole platform is addressable as code — plus four data sources for reading what already exists.

core

The agent and its building blocks.

chatbotkit_botchatbotkit_blueprintchatbotkit_skillsetchatbotkit_skillset_ability

knowledge

Searchable memory and documents.

chatbotkit_datasetchatbotkit_filechatbotkit_file_content

workspace

Sandboxed filesystem and state.

chatbotkit_spacechatbotkit_space_storage_file

security

Credentials, access, and surfaces.

chatbotkit_secretchatbotkit_policychatbotkit_portal

channels

17 integrations, all declarative.

slackdiscordtelegramwhatsappmessengerinstagrammicrosoftteamsgooglechatemailtwilionotionsitemapsupporttriggerwidgetmcpserverextract

data sources

Reference resources you already have.

data.chatbotkit_botdata.chatbotkit_datasetdata.chatbotkit_blueprintdata.chatbotkit_skillset

Reference Architectures

Apply, then adapt

The provider repository ships with more than a dozen complete architectures. Clone one, set your API key, run apply, and reshape it into your own product.

Multi-tenant SaaS

Deploy an isolated agent into every customer sub-account from one shared module and one master token, with run_as targeting each tenant.

run_asProvider aliasesModules

AI Employee

A digital team member with a sandboxed workspace, shell execution, Gmail and Notion via OAuth, and skillsets it loads on demand.

SpaceShellOAuth

Second Brain

A personal knowledge system with a persistent workspace, Notion and Google Calendar integrations, and a Telegram bot for mobile access.

NotionCalendarTelegram

Workflow Orchestrator

Multi-step automation with three specialized skillsets, dynamic skillset loading, persistent state, and full execution tracing.

Dynamic skillsStateTracing

Dual-Agent Workflows

A Workflow Architect programs scripts while a Task Runner executes them, sharing a space with asymmetric read and write access.

Multi-agentShared spaceSchedules

MCP Factory

A factory-style agent wired to multiple independent MCP servers, each its own skillset, with clean service boundaries.

MCPSkillsetsIsolation

Your Entire Fleet, in One Repository

Stop clicking the same agent together in three environments. Declare it once, commit it, and let terraform apply reproduce it everywhere — identically, every time.

0
resources

platform primitives you can declare and version

0
channels

messaging and service integrations as code

0
data sources

for referencing resources you already built

0%
in git

reproducible across every environment you run

Architecture

How it fits

The provider is a thin, typed layer between your configuration and the ChatBotKit API. Everything resolves through one API, so the same workflow that manages your cloud manages your agents.

Your HCLmain.tf, modules, variables, instructions.md, SKILL.md
ChatBotKit Providerchatbotkit/chatbotkit on the Terraform Registry
ChatBotKit APIA single GraphQL API with run_as for sub-accounts
The PlatformBots, datasets, skills, spaces, secrets, channels

Clicking vs. Declaring

The cost of the dashboard

Building agents by hand feels fast until you need a second environment, an audit trail, or fifty tenants. Then the dashboard becomes the bottleneck.

Building in a dashboard
  • No record of what you changed, when, or why — the config lives only in the UI
  • Rebuild the same agent by hand in dev, staging, and production and hope they match
  • Onboarding a new customer means clicking through the whole setup again
  • No pull request, no review, no rollback when a prompt or skill change goes wrong
  • Secrets pasted into forms with no single place to rotate or audit them
  • Every new environment multiplies the manual work instead of reusing it
With the Terraform provider
  • Every agent, skill, and secret is in git with full history and blame
  • One config promotes unchanged across every environment with terraform apply
  • Onboard a tenant by adding a module call — the whole agent ships in one apply
  • Changes land as pull requests with a plan to review and a clean path to revert
  • Secrets are first-class resources, templated for OAuth and rotated in one place
  • New environments and tenants reuse the same modules instead of repeating the work

FAQs

What is the ChatBotKit Terraform provider?

It is the official Terraform provider for ChatBotKit. It lets you declare your entire AI agent stack — bots, datasets, skillsets, abilities, files, spaces, secrets, policies, portals, and channel integrations — as code. You run terraform apply and the platform provisions everything for you. The provider is published on the Terraform Registry at chatbotkit/chatbotkit.

How is this different from other AI platforms?

Most AI platforms only give you a dashboard. You click around to build an agent, and there is no reproducible record of what you did. With ChatBotKit the agent itself — its backstory, its tools, its memory, its credentials, and the channels it speaks on — is a declarative resource graph. You version it in git, review changes in pull requests, promote it across environments, and tear it down cleanly. The agent's brain and behavior live in the same workflow as the rest of your infrastructure.

What can I actually manage as code?

29 resource types and 4 data sources. That covers bots, datasets, blueprints, skillsets and individual abilities, files and file content, spaces and space storage, secrets, policies, portals, and 17 channel integrations including Slack, Discord, Telegram, WhatsApp, Messenger, Instagram, Microsoft Teams, Google Chat, Email, Twilio, Notion, Sitemap, Support, Trigger, Widget, MCP Server, and Extract.

How do I deploy a separate agent for every customer?

Use one master token plus the provider's run_as attribute, which sends the X-RunAs-UserId header — the same pattern as the AWS provider's assume_role. Each provider alias targets a customer's sub-account, and a shared module deploys the same agent into every sub-account in a single terraform apply. No per-customer tokens and no for_each gymnastics. Each tenant gets a fully isolated agent and resources.

Can agents change themselves at runtime if everything is declared in code?

Yes, and the two models compose cleanly. You declare the agent's structure and starting state in Terraform, then give it abilities that let it evolve — a self-improving agent rewrites its own backstory file, a workflow agent discovers and installs skillsets on demand, and an MCP-aware agent searches a registry and installs new tool servers as it needs them. Terraform owns the baseline; the agent owns its growth from there.

How are credentials and OAuth handled?

Through the chatbotkit_secret resource. Secrets can be shared (a single machine-to-machine service token used by the agent itself) or personal (each end user signs in once through your SSO, and the agent then acts on their behalf with their own permissions). Template-based secrets wire up OAuth for platforms like Google, Notion, and others without you ever handling raw tokens in state.

Does it work with my existing Terraform workflow?

Yes. It is a standard Terraform provider, so it works with plan, apply, destroy, import, modules, variables, outputs, remote state, and workspaces. It drops straight into your CI/CD pipeline alongside your AWS, GCP, Cloudflare, or Kubernetes resources. Reviewing an agent change becomes a normal pull request with a normal plan.

Can I import agents I already built in the dashboard?

Yes. Use terraform import to bring existing bots, datasets, skillsets, and other resources under Terraform management, then continue managing them as code. You do not have to start from scratch to adopt infrastructure as code.

Is the provider open source?

Yes. The provider is open source and the repository ships with more than a dozen reference architectures — multi-tenant SaaS, AI employees, second-brain assistants, workflow orchestrators, dual-agent systems, MCP factories, and self-improving agents — that you can copy, apply, and adapt.

How do I get started?

Add the chatbotkit/chatbotkit provider to your configuration, set the CHATBOTKIT_API_KEY environment variable, write a chatbotkit_bot resource, and run terraform init followed by terraform apply. Your first agent is live in minutes, fully reproducible and under version control.

Built With ChatBotKit

From multi-tenant SaaS to autonomous AI employees, our customers provision entire agent fleets as infrastructure as code.

FormShare

FormShare

AI-powered form builder that qualifies leads and collects data through natural conversation.

AfterDark

AfterDark

AI research agent that monitors and summarizes information from emails, news, and web sources.

HeroShot

HeroShot

Creative AI assistant that generates product photos and marketing visuals in seconds.

MuseumAI

MuseumAI

AI guide that provides interactive tours, answers visitor questions, and enhances cultural experiences.

FashionAI

FashionAI

Personal styling agent that recommends outfits and helps customers find products they love.

PeopleAI

PeopleAI

Educational AI that brings historical figures to life for interactive learning experiences.

Platform Features

Every ChatBotKit capability you provision with Terraform, from agents and datasets to skills and secure integrations.

Conversation Streaming

Deliver Real-Time Responses With Typed Streaming Events

Custom Datasets

Turn Your Knowledge Into AI-Powered Search

Custom Skillsets

Equip Your AI with Real Capabilities - From Email to APIs

Customer Stories

Case studies from teams shipping AI

See how organizations use ChatBotKit to launch production AI assistants, validate new products, support customers, and create richer digital experiences.

Enterprise search

Quench

Discover Quench.ai, the enterprise search company founded by Husayn Kassai, the serial entrepreneur behind Onfido. Quench helps large organizations unify and discover their internal knowledge through natural language search. Built on ChatBotKit's Forward Deployment platform - the environment powering the "Quench Sandbox" - Quench prototypes, runs discovery, and validates AI products with real customers in days rather than quarters. Learn how this approach delivered 10x faster prototyping and won major enterprises including Yum Brands, MotorK, Podium, and numerous Fortune 500 companies, turning rapid customer iteration into a sustainable competitive advantage.

Forward deploymentFortune 500
Read case study

Healthcare charity

Debra

DEBRA UK is the leading charity for individuals with epidermolysis bullosa (EB), a rare genetic skin condition. Committed to providing lifelong care and seeking cures, DEBRA supports nearly 4,000 members across the UK. With over £22 million invested in research, DEBRA is the largest UK funder of EB studies. The organization addresses the complex information needs of patients and caregivers by offering reliable resources and support. Learn about DEBRA's innovative chatbot, providing 24/7 assistance for inquiries about EB, fundraising, and support services, ensuring accurate and compassionate communication. Explore DEBRA's mission to improve lives and advance research for those affected by EB.

Medical informationWebsite assistant
Read

Education wellbeing

Elggo

Discover Elggo, the MENA and Southeast Asia region's first AI-powered wellbeing platform for K–12 schools. Founded after the COVID-19 pandemic to close a gap in culturally relevant mental-health resources, Elggo delivers evidence-based curricula designed by regional psychologists and educators. By integrating ChatBotKit's conversational AI, embeddable widget, and multilingual support, Elggo provides students and teachers with always-on, personalized guidance on emotional literacy, decision-making, and growth mindset. Learn how a controlled trial of 12,000 students across 32 schools saw a 30% increase in student wellbeing, and how the platform scaled across seven countries while keeping content culturally responsive and data-driven.

K-12 schoolsMultilingual widget
Read

Cultural heritage

Faro

Discover FARO, the Flemish government's cultural heritage organization, which enhances access to heritage collections through its innovative ErfgoedApp. Launched in 2015, the app utilizes augmented reality, IoT, and AI to provide on-site, multilingual guidance for museums and heritage sites. In celebration of its 10th anniversary, FARO has partnered with ChatBotKit to introduce AI chatbots, transforming the app into an on-demand heritage guide. Visitors can ask questions about artworks and historic landmarks at any time, while geofencing technology provides location-aware storytelling. With plans to expand this interactive experience across more sites, FARO is committed to making heritage discovery intuitive and personalized for everyone.

Location-awareMuseum guide
Read

Customer service

Intelliway

Discover Intelliway, a Brazilian technology firm building AI-powered customer service solutions for businesses across Brazil and Latin America. Using ChatBotKit's API-first platform as their backend, Intelliway builds custom-branded interfaces on top of powerful conversational AI while retaining full control over the customer experience. Learn how native Brazilian Portuguese understanding, scalable cloud infrastructure, and advanced language models help Intelliway serve hundreds of clients across multiple industries, with one major retail client reporting a 40% increase in positive customer feedback. Explore how the platform-as-a-backend approach positions Intelliway to lead conversational AI across the Americas.

API and SDKsPortuguese support
Read

Ship your agents as infrastructure as code

Talk to our team. We will help you model your agents in HCL, set up multi-tenant patterns, and wire the provider into your existing pipeline.