Sources
Last updated
Was this helpful?
Last updated
Was this helpful?
You can use Terraform to provision Kubiya sources. By doing so, you connect tools from source control repositories, like GitHub, GitLab or Bitbucket to the Kubiya platform so that they can be connected to AI Teammates.
Want to know more about Sources in Kubiya?
Provides a Kubiya Source resource. This allows sources to be created, updated, and deleted on the Kubiya platform.
Sources in Kubiya are repositories containing tools and workflows that can be used by your AI Teammates (agents). Sources are required for agents - every agent must have at least one source connected to it.
When you add a source, Kubiya discovers the tools and workflows contained in the repository, making them available for use by your agents. Tools provide the functionality that agents can use to perform tasks, while workflows define sequences of operations.
Kubiya uses a container-first architecture where every tool is backed by a Docker image. This eliminates the need to write complex business logic from scratch and ensures secure, isolated execution environments for your tools.
Tools can be implemented in any language, with the Kubiya SDK providing first-class support for Python and JavaScript. When an agent invokes a tool, the execution happens in a containerized environment with predictable, secure results.
The following arguments are supported:
name
- (Required) The name of the source.
description
- (Required) A description of the source.
runner
- (Required) The runner that will be used for tool execution.
url
- (Optional) The URL of the repository containing tools and workflows. Required unless using inline tools.
branch
- (Optional) For Git sources, the branch to use. Defaults to "main" or "master" depending on the repository.
auth_method
- (Optional) Authentication method for private sources. Values: "ssh_key", "token", etc.
dynamic_config
- (Optional) JSON-encoded configuration data to pass to the tools in the source. This is often used to configure tools with specific parameters or credentials.
inline_tools
- (Optional) JSON-encoded array of tool definitions to be created directly in the source instead of from a repository. Each tool definition includes name, description, parameters, and code.
inline_workflows
- (Optional) JSON-encoded array of workflow definitions to be created directly in the source. Each workflow definition includes name, description, and a series of steps that use tools.
In addition to the arguments above, the following attributes are exported:
id
- The ID of the source.
status
- The current status of the source.
last_updated
- The timestamp when the source was last updated or synchronized.
Sources in Kubiya provide two main types of components:
Tools: Functions that agents can use to perform specific tasks, such as interacting with AWS, managing Kubernetes clusters, or querying databases. Tools can be defined in a repository or inline.
Workflows: Sequences of tool calls that define a process. Workflows allow chaining tools together with conditional logic and variable passing between steps.
When Kubiya processes a source, it discovers all tools and workflows available in the repository or defined inline, making them available to any agent that has that source attached.
While you can define tools directly in Terraform using the inline_tools
parameter, Kubiya also offers a Python SDK for creating more complex tools. The SDK provides a way to define tools that will run in a containerized environment:
The dynamic_config
parameter allows you to pass configuration data to the tools in a source. This is useful for setting default parameters, credentials, or environment-specific values that the tools will use during execution.
For example, if your source contains AWS tools, you might want to set the default region and role to use:
Sources can be imported using the id
:
After creating a source, you need to connect it to an agent to make its tools and workflows available. This is done using the sources
attribute in the agent resource:
Remember that every agent must have at least one source - this is a mandatory requirement.
These tools can be packaged into a repository and then referenced by the url
parameter in your kubiya_source
resource. The Kubiya platform provides a growing repository of pre-built tools for common enterprise tasks at .