> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/autofix-and-remediation/configure/autofix-for-gitlab-with-deploy-keys.md).

# AutoFix for Gitlab with Deploy Keys

Configure deploy keys so AutoFix pushes to your GitLab repositories over SSH instead of using your Personal Access Token (PAT).

## Why use deploy keys?

Deploys keys are required when your GitLab group enforces both signed commits and uses Single Sign-on (SSO). With SSO enforced, GitLab requires your PAT to be re-authorized periodically for git pushes. Deploy keys aren’t tied to an SSO session, so AutoFix keeps working.

## How it works

For each repository you select, Aikido generates a dedicated SSH key pair and registers the public key on that GitLab project as a deploy key named aikido-autofix-deploy-key, with write access. The private key is stored encrypted by Aikido. AutoFix then uses the deploy key to push its commits.

Your PAT is still required. Aikido uses it to add and remove the deploy keys through the GitLab API and to create merge requests.

## Prerequisites

* You are an Aikido admin.
* A valid AutoFix Personal Access Token (PAT) is configured.
* The PAT's GitLab user has permission to add deploy keys to the projects you select.

### Enable deploy keys

1. In Aikido, go to [GitLab token settings](https://app.aikido.dev/onboarding/gitlab/update-workspace-access-token), open the AutoFix tab, and expand Advanced.

<img src="https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2FpXaNW6lhy8ryRUdxElte%2Funknown.png?alt=media&amp;token=71817876-e83f-4021-aaca-e1f2fd92c6ea" alt="" height="254" width="856">

2. Under Deploy Key, open the Repositories field and select the repositories AutoFix should push to over SSH using the deploy keys.
3. Click Add deploy key on repos.

Wait for the Updating Repositories dialog to finish.

## Remove deploy keys

1. In Aikido, go to [GitLab token settings](https://app.aikido.dev/onboarding/gitlab/update-workspace-access-token), open the AutoFix tab and expand Advanced.
2. Unselect the repositories you want to remove.
3. Click Remove deploy key from repos and confirm.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/autofix-and-remediation/configure/autofix-for-gitlab-with-deploy-keys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
