> 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/~/revisions/KY3QqEqZPV6ifxqjwoLa/aikido-autofix/connect-private-packages/nuget-private-packages.md).

# NuGet - Private packages

When letting Aikido update your dependencies in repositories with private NuGet packages, Aikido would need to also have access to the private packages so we can properly update your lockfiles. You can now provide private NuGet registry configuration in Aikido for this.

Aikido supports 2 ways of configuring connections with your private NuGet registry:

1. Via a nuget.config file
2. Via credentials for the dotnet cli

## 1. Configuration via nuget.config file <a href="#id-1-configuration-via-nugetconfig-file" id="id-1-configuration-via-nugetconfig-file"></a>

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

For private NuGet packages, Aikido uses a nuget.config file to authenticate with the private registry. This file will overwrite the nuget.config in root of the scanned repository. It is possible to configure multiple private registries in this file.

Example nuget.config for accessing private packages on GitHub's NuGet registry:

```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="github" value="https://nuget.pkg.github.com/AikidoSec/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <github>
      <add key="Username" value="AikidoSec" />
      <add key="ClearTextPassword" value="ghp_ABC123...XYZ" />
    </github>
  </packageSourceCredentials>
</configuration>
```

Take a look at the following docs for more information on authenticating with private NuGet registries.

* [Microsoft - Consuming packages from authenticated feeds](https://learn.microsoft.com/en-us/nuget/consume-packages/consuming-packages-authenticated-feeds)
* [GitHub - Working with the NuGet registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry)

## Configuration in Aikido <a href="#configuration-in-aikido" id="configuration-in-aikido"></a>

Once the prerequisites are fulfilled, you can configure Aikido to authenticate with your private NuGet registry when updating the dependencies by following the steps below:

1. Go to your account's settings page for the Autofix in Aikido, [here](https://app.aikido.dev/settings/integrations/autofix).
2. Click on "Manage Private Registry Connection", the configuration modal will now be shown
3. Select "nuget.config" as package manager

   <img src="https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-3d849f660e648ded1e4e2840720423d56af16309%2Fnuget-private-packages_88190850-9579-4cbc-9520-58f1836b8146.png?alt=media" alt="Connect to a private package registry by uploading your configuration file for dependency scanning." width="563">
4. Fill in your nuget.config with authentication information. Aikido securely encrypts your configuration file until just before they are used.
5. Click "Apply Changes" to save the configuration

## 2. Configuration via .NET's nuget CLI <a href="#id-2-configuration-via-nets-nuget-cli" id="id-2-configuration-via-nets-nuget-cli"></a>

For the CLI config, Aikido needs to have the registry's URL, username and password which can be used to authenticate with the private registry. Once you have this information, you can configure it following the steps below:

1. Go to your account's settings page for the Autofix in Aikido, [here](https://app.aikido.dev/settings/integrations/autofix).
2. Click on "Manage Private Registry Connection", the configuration modal will now be shown
3. Select "Nuget CLI"

   <img src="https://3149773201-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-67280c19f8c477297194a6f8db23226228098221%2Fnuget-private-packages_66f51295-84d3-4903-84e6-329996f31764.png?alt=media" alt="Connect to a private package registry by entering Nuget CLI credentials and URL." width="563">
4. Enter the details in the input fields and click on "Apply Changes" to save the configuration


---

# 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 dynamically by asking a question.

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

```
GET https://help.aikido.dev/~/revisions/KY3QqEqZPV6ifxqjwoLa/aikido-autofix/connect-private-packages/nuget-private-packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
