# Connect your Code

## Overview

Connecting your code repositories gives the Bluebricks agent access to your infrastructure code. Once connected, the agent can cross-reference your IaC with your cloud resources, answer questions about how your infrastructure is defined, and open pull requests when you ask them to make changes.

The agent currently supports **GitHub** repositories for code access.

## How to connect GitHub

1. Go to **Account Settings** > **Integrations** ([app.bluebricks.co/settings?tab=integrations](https://app.bluebricks.co/settings?tab=integrations))
2. Click the **GitHub** integration button
3. Click **Enable** and authorize the Bluebricks GitHub App
4. Select the organization you want to connect
5. Choose which repositories Bluebricks can access
6. Click **Save**

{% hint style="info" %}
The GitHub integration is read-only. Bluebricks does not push code or modify your repositories directly. All infrastructure changes proposed by the agent are submitted as pull requests for you to review.
{% endhint %}

## What happens after connecting

Once your repositories are connected, Bluebricks indexes your infrastructure code into the context layer. The agent can then:

* Answer questions about how resources are defined in code ("Where is the VPC for production defined?")
* Cross-reference cloud resources with their IaC definitions ("Which resources aren't managed by code?")
* Open pull requests to make infrastructure changes you request ("Add encryption at rest to all RDS instances")

Indexing typically completes within a few minutes. The agent will let you know if it needs access to additional repositories to answer a question.

## Managing connected repositories

To add or remove repositories from the integration:

1. Go to **Account Settings** > **Integrations**
2. Click **Configure** next to the GitHub integration
3. Update the repository selection in the GitHub App settings

Changes take effect immediately. Removing a repository removes the agent's access to that code.

## Using GitLab, Azure DevOps, or other providers

If your infrastructure code lives outside GitHub, you can still use Bluebricks through the orchestration platform. GitLab, Azure DevOps, and other Git providers are supported for deploying and managing infrastructure through [GitOps environments](/docs/orchestration/environments/gitops-environments.md).

* [**GitLab**](/docs/integrations/gitlab.md): run Bricks CLI commands inside GitLab CI/CD pipelines
* [**Azure DevOps**](/docs/integrations/azure-devops.md): integrate Bluebricks into your Azure DevOps pipelines
* [**GitHub Actions**](/docs/integrations/githubactions.md): run Bricks CLI commands in your GitHub Actions workflows

Agent-based code access (questions about your code, agent-opened PRs) is not yet available for these providers. The agent can still discover and analyze your cloud resources without code access.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bluebricks.co/docs/getting-started/connect-your-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
