> For the complete documentation index, see [llms.txt](https://docs.zenlytic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zenlytic.com/authentication-and-security/connecting_to_github_with_a_deploy_key.md).

# Connecting To Github With A Deploy Key

Connect Zenlytic to GitHub with a deploy key so it can read your model repository.

## Commit identity and repository rules

Zenlytic writes to your repo every time a user saves model files from Context Manager. Every commit Zenlytic creates uses a fixed identity:

* **Author:** the email of the Zenlytic user who made the change
* **Committer:** `Zenlytic <hello@zenlytic.com>` on every commit, regardless of who made the change
* **Signature:** none — Zenlytic does not sign its commits

{% hint style="warning" %}
If your organization enforces rules on commit metadata, allow `hello@zenlytic.com` **before** you connect. Otherwise branch creation will succeed but every save will fail — these rules apply to every branch, not only protected ones. That's why creating a branch from Context Manager can succeed (no commit is created yet) while the first save fails (a commit is created).
{% endhint %}

Check these settings in GitHub, at both the organization and repository level (a clean repo-level ruleset doesn't rule out an organization-level one):

| Setting                                    | Where to find it                       | What to do                 |
| ------------------------------------------ | -------------------------------------- | -------------------------- |
| Restrict commit metadata (committer email) | Rulesets                               | Allow `hello@zenlytic.com` |
| Require signed commits                     | Rulesets, or classic branch protection | Disable for this repo      |

Metadata restrictions (including committer email pattern) require **GitHub Enterprise Cloud or Enterprise Server** — this option won't appear under Rulesets on GitHub Free, Pro, or Team.

The push itself still authenticates with the deploy key you install below — your access control is unchanged. Only the commit metadata carries the Zenlytic service identity.

**Symptom if this isn't configured:** "Save Model Files Unsuccessful / Failed to save model" in Context Manager on every branch. The underlying push is rejected with a rule violation naming the committer email `hello@zenlytic.com`.

## Connecting your repository

**Step 1:** In Zenlytic, open **Workspace** **Settings**, then select Workspace.

![Github Deploy Key 1](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2FCdxyeBcDYVX4nuO7evMp%2Fgithub-deploy-key-1.png?alt=media\&token=54e09533-be86-49e3-a999-3da9c0389233)

**Step 2:** Next, find your git repo details (these will be in Github).

Make sure to use the "SSH" format of the git URL. The format looks like `git@github.com:<YOUR_ORGANIZATION>/<YOUR_REPO>.git`, and you can find it here in your Github repo under the "Code" button with the SSH tab as shown below.

![Github Deploy Key 2](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2Fgit-blob-8f62446ebcf935968e71ad92be055ca2145bf153%2Fgithub-deploy-key-2.png?alt=media)

**Step 3:** Now that you have that URL and the branch you want to use as your production branch, return to Zenlytic. In this example, we pasted our Github repo url (SSH format) and our production branch, which was: `master`.

![Github Deploy Key 3](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2F0NWpI2ZY0BN9p7Qe9RaQ%2Fgithub-deploy-key-3.png?alt=media\&token=cc53e0f4-6aa3-46be-80f6-0e5c0ea35f18)

**Step 4:** Next we need to generate the SSH key we'll use to connect. Hit the "Generate Deploy Key" button, then the "Confirm" button, and copy the public SSH key generated.

![Github Deploy Key 4](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2Fgit-blob-28f16927122b0cbfc75e54944535b613b68f7280%2Fgithub-deploy-key-4.png?alt=media)

**Step 5:** Then hit Copy Deploy Key.

![Github Deploy Key 5](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2Fgit-blob-c05a472678fe6901a46c8bb69efb12017cf9a35c%2Fgithub-deploy-key-5.png?alt=media)

**Step 6:** Now that you have the deploy key copied return to Github and go to "Settings."

![Github Deploy Key 6](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2Fgit-blob-9418c609cc850a4b3fe450eca27f6552d5c77f9b%2Fgithub-deploy-key-6.png?alt=media)

**Step 7:** Then go to Deploy Keys in the left-hand menu.

![Github Deploy Key 7](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2Fgit-blob-e16beb294fb0f990c03fcc4355752ce08a0d1443%2Fgithub-deploy-key-7.png?alt=media)

**Step 8:** Then, click "Add new" and give your deploy key a name. Finally, paste that SSH key and click "Add Key."

![Github Deploy Key 8](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2Fgit-blob-863d3abf949ee778c9006ca662f339072c9cd8e1%2Fgithub-deploy-key-8.png?alt=media)

**Step 9:** Return to Zenlytic. The GitHub repo URL and production branch save automatically when you leave those fields. If they save without an error, you're fully connected to Github!

![](https://1577702444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT9EV2yuH6oO9jfgfgYUW%2Fuploads%2F0NWpI2ZY0BN9p7Qe9RaQ%2Fgithub-deploy-key-3.png?alt=media\&token=cc53e0f4-6aa3-46be-80f6-0e5c0ea35f18)


---

# 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://docs.zenlytic.com/authentication-and-security/connecting_to_github_with_a_deploy_key.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.
