> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/artifact-registry/3.0/support/best-practices.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Best practices

Naming, scope, security, and automation recommendations for building a scalable, governable Harness Artifacts structure as it grows.

These practices cover registry structure, naming conventions, and governance strategies for Harness Artifacts.

## How should I structure and name registries?

Registry names must start with a letter and can only contain lowercase letters, numbers, underscores (`_`), hyphens (`-`), and periods (`.`). Names are unique per scope; reusing a name like `docker-dev` in a different organization or project is allowed, but a pipeline can only push to or pull from registries in its **current scope and parent scopes**, never a sibling project.

### Recommended naming convention

Use `<scope>-<team>-<package-type>-<environment>` to keep names globally meaningful:

| Component                  | Values / Examples                                   | Description                                        |
| -------------------------- | --------------------------------------------------- | -------------------------------------------------- |
| **Scope indicator**        | `acct`, `org`, `proj`                               | Registry scope: account, organization, or project. |
| **Team indicator**         | `platform`, `mobile`, `backend`, `frontend`, `data` | The owning or producing team.                      |
| **Package type**           | `docker`, `helm`, `maven`, `npm`, `python`, `proxy` | The artifact format the registry stores.           |
| **Environment** (optional) | `dev`, `test`, `prod`                               | The artifact lifecycle stage.                      |

Good: `acct-platform-docker-dev`, `org-backend-maven-prod`, `proj-mobile-npm-test`.

Avoid: `docker-dev` (no scope or team context), `api` or `frontend` (too generic), and names so long they are hard to read in a pull command.

### Scope strategy

| Scope            | Use for                                       | Typically managed by    |
| ---------------- | --------------------------------------------- | ----------------------- |
| **Account**      | Shared tools, base images, upstream proxies   | Platform or DevOps team |
| **Organization** | Team-shared libraries and internal components | Team leads              |
| **Project**      | Environment- or service-specific builds       | Development teams       |

Place anything multiple projects depend on at the organization or account level; a registry created inside one project is invisible to pipelines in sibling projects.

## Set visibility deliberately

Every registry has a **Visibility** setting: **Private** or **Public**. Private is the default and the right choice for internal images, proprietary libraries, and anything in a compliance-regulated environment. Reserve **Public** for artifacts you intend anyone to pull without authentication, and confirm the feature flag and account setting it requires. Go to [Registry visibility: private and public](https://developer.harness.io/artifact-registry/3.0/concepts/registry-visibility.md) for the full access model.

## Upstream proxy strategy

Create upstream proxies at **account or organization level** so every project benefits from the same cache of Docker Hub, Maven Central, PyPI, or other external sources. A shared proxy improves build reliability during an upstream outage and gives you one place to apply Dependency Firewall policies to every package your organization pulls from the internet.

You do not need a separate proxy per environment; one proxy per external source, shared across `dev`, `test`, and `prod`, is sufficient. Including `proxy` in the name (for example, `acct-docker-proxy`) makes the registry's role clear at a glance.

To set one up, go to [Create an upstream proxy](https://developer.harness.io/artifact-registry/3.0/registries/create-an-upstream-proxy.md). To chain more than one source behind a single registry, go to [Add and prioritize upstream proxies](https://developer.harness.io/artifact-registry/3.0/registries/add-and-prioritise-upstream-proxies.md).

## Harden your supply chain

* **Enable Dependency Firewall on every upstream proxy**. Start with the Malicious Package template, which has no legitimate reason to be off, then layer CVSS Threshold and License Policy to fit your risk tolerance. Go to [Dependency Firewall overview](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/overview.md) and [Built-in policy templates](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/built-in-policy-templates.md).
* **Choose a scanner deliberately**. Aqua Trivy and Grype both scan Docker and Helm images on push; pick based on the detection characteristics that matter for your stack rather than defaulting to whichever is listed first. Go to [Choose a scanner: Aqua Trivy or Grype](https://developer.harness.io/artifact-registry/3.0/security-and-compliance/scanner-selection.md).
* **Sign production images**. To set up and manage the keys used to sign and verify artifacts, go to [Signing Keys](https://developer.harness.io/artifact-registry/3.0/security-and-compliance/signing-keys.md).
* **Scope RBAC to the minimum each principal needs**. Grant Viewer by default, Contributor only to pipelines and services that push, and Admin to a small set of registry owners. Go to [RBAC and permissions](https://developer.harness.io/artifact-registry/3.0/reference/rbac-and-permissions.md).

## Automate retention and cleanup

Artifacts accumulate quickly in active registries. Rather than deleting manually, define lifecycle rules once:

* **Cleanup rules** remove old or untagged versions on a schedule.
* **Retention rules** keep a minimum number of versions or a minimum age window, regardless of what a cleanup rule would otherwise remove.

Run a dry run before enforcing either rule type in a registry with artifacts you cannot easily rebuild. Go to [Lifecycle management overview](https://developer.harness.io/artifact-registry/3.0/lifecycle-management/overview.md).

## Automate with webhooks

Use webhooks instead of polling to react to registry activity. Trigger a deployment pipeline on a new image push, post to a notification channel, or feed an audit log, all from the **Artifact Creation** and **Artifact Deletion** events. Go to [Webhooks](https://developer.harness.io/artifact-registry/3.0/registries/webhooks.md).

## Plan ahead

* Inventory the teams and artifact types that need registries before creating them one at a time.
* Align naming with scope and lifecycle from the start; renaming a registry later means recreating it.
* Reserve namespace for known future needs (for example, an `-arm64` or `-fips` variant).
* Decide who owns registry creation and who approves scope changes before registry sprawl makes that decision for you.

## Frequently asked questions

<details>

<summary>Why does creating a registry with a name that already exists in another project fail?</summary>

It does not fail. Registry names are unique per scope, so the same name can exist in different organizations or projects. A pipeline can only push to or pull from registries in its current scope and parent scopes, so a naming collision in a sibling project has no effect on your pipeline.

</details>

<details>

<summary>What is the difference between account, organization, and project scope for a registry?</summary>

Account scope makes a registry visible across the entire account, organization scope limits it to one organization, and project scope limits it to one project. Place anything multiple projects depend on, such as shared base images or upstream proxies, at the organization or account level.

</details>

<details>

<summary>Do I need a separate upstream proxy for each environment?</summary>

No. One upstream proxy per external source, shared across `dev`, `test`, and `prod`, is sufficient. Creating a proxy per environment only adds configuration to maintain without improving caching or security.

</details>

## Next steps

* [Create a registry](https://developer.harness.io/artifact-registry/3.0/registries/create-a-registry.md)
* [Platform integrations](https://developer.harness.io/artifact-registry/3.0/platform-integrations.md)
* [Dependency Firewall overview](https://developer.harness.io/artifact-registry/3.0/dependency-firewall/overview.md)
* [Lifecycle management overview](https://developer.harness.io/artifact-registry/3.0/lifecycle-management/overview.md)

{% @harness-feedback/feedback %}
