> 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/container-image-scanning/configuration/link-containers-to-code-repositories-via-kubernetes-annotations.md).

# Link Containers to Code Repositories via Kubernetes Annotations

{% hint style="info" %}
This feature is currently behind a feature flag. Reach out to Aikido to have it enabled for your account.
{% endhint %}

Linking containers to code repositories keeps related vulnerabilities in one place. This is useful when you manage many repositories and images.

Aikido can link containers automatically by reading a specific label or annotation on your Kubernetes workloads.

#### Standard annotation

Add this label or annotation to your Kubernetes workload, using the key `aikido.dev/repository`. Set the value to your own repository's URL, for example:

```
aikido.dev/repository: 
https://github.com/AikidoSec/demo-app-1
```

{% hint style="info" %}
If both a label and an annotation with this key are set on the same workload, the annotation value is used.
{% endhint %}

#### Custom annotation

If your organization already has its own convention (for example, `repo-url`), Aikido can map that key to the standard one for you, so you don't need to change your workload manifests.

{% hint style="info" %}
To use a custom annotation key, reach out to Aikido support to have it mapped for your account.
{% endhint %}

#### How it works

* Aikido reads the relevant label or annotation off the Kubernetes workload (standard key, or your mapped custom key).
* Aikido uses this tag to automatically link the container to the matching code repository.
* If the container is already linked to a repository, this won't override it.


---

# 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/container-image-scanning/configuration/link-containers-to-code-repositories-via-kubernetes-annotations.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.
