# Leaked Octopus Deploy API Key? Revoke It

> Octopus Deploy API key exposed on GitHub? Revoke it in your profile, then audit deployments and variables. Step-by-step guide.

Source: https://leakwatch.net/secrets/octopus-deploy-api-key

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Octopus Deploy API Key

Code & CI · Secret guide

# Leaked Octopus Deploy API Key: what to do in the first hour

High severityDetected onlyLast verified October 30, 2026 · 4 min read

An Octopus Deploy API key acts as the user or service account that owns it. It can call the Octopus REST API with that identity: create releases, trigger deployments, read projects and, depending on permissions, read or change variables, accounts and environments. Because Octopus deploys software to production servers and cloud accounts, a leaked key can mean running code where your application runs, and reading the credentials stored for those deployments. Revoke the key first, then audit what it did.

[Check your GitHub account for leaked secrets — free](/)

Provider

Octopus Deploy

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

No

## What an Octopus Deploy API Key looks like

An Octopus API key starts with `API-` followed by 26 uppercase letters and digits:

```text
API-XXXXXXXX…   (prefix + 26 uppercase letters and digits, masked here)
```

It is sent in the `X-Octopus-ApiKey` HTTP header, passed as `--apiKey` to the Octopus CLI, or stored in a variable such as `OCTOPUS_API_KEY` or in a CI step that creates releases. Octopus shows the key only once at creation and keeps just a one-way hash, so a key you can read in a file was copied out at that moment. Keys can belong to a person or to a service account. A service account key is usually meant for automation and may have wide rights, so check which one leaked.

## How Octopus Deploy API Keys get leaked

-   **CI pipeline files.** A build that creates releases with `--apiKey` written inline in a workflow or script.
-   **Committed environment files.** `OCTOPUS_API_KEY` in a `.env` file or a Docker compose file.
-   **Terraform and scripts.** Provider configuration or PowerShell scripts that pass the key in clear text.
-   **Build logs.** A verbose CLI run that echoes the command line, including the key.
-   **Shared documentation.** A runbook or support ticket with a working curl example for the REST API.

## What to do in the first hour

1.  **Revoke the key.** Sign in to Octopus, open the profile of the user or service account that owns it, and delete the key from the list of API keys. See the revoke section below.
2.  **Create a new key** for the pipeline that needs it, preferably on a service account with limited permissions, and set an expiry date if you can.
3.  **Update your CI secrets** and run a test deployment.
4.  **Check the audit trail.** Octopus keeps an audit log of changes and deployments. Filter it by the user who owned the key and look at the period of exposure.
5.  **Look at what could have been created or changed.** New releases, deployments to production, edited variables, new accounts or targets, new users and API keys, and changes to teams.
6.  **Rotate the secrets stored in Octopus.** If the key could read or export variables and accounts, treat cloud credentials and passwords kept there as exposed and replace them.
7.  **Clean up the code** and the history. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

Not sure what else leaked from the same repository? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Octopus Deploy

Octopus can be used as Octopus Cloud or self-hosted, so the address depends on your instance. According to the Octopus documentation, you create keys from your profile: click your profile image, choose Profile, then My API Keys. A third-party source says keys are revoked from that same page, which this guide could not confirm in Octopus’s own documentation. Open the Octopus profile page of your instance and look for the section where API keys are listed. A person has not confirmed the exact menu wording for this guide, and the interface can change, so follow the Octopus documentation on creating an API key if it differs. For a service account key, an administrator opens the service account in the user management area.

## How LeakWatch detects it

The rule is called Octopus Deploy API Key. It accepts the literal prefix `API-` in capitals, followed by exactly 26 uppercase letters or digits, as a whole word, and the value must end with a quote, whitespace, a semicolon or the end of the line. Lowercase values, shorter or longer bodies and strings where the key is glued to other letters are not reported. The pattern has no vendor word nearby, so a value that has this exact shape by chance can be reported. The severity is **high**. This type is not checked live: LeakWatch does not send any request to Octopus with the key it found.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Can an Octopus API key deploy to production?

Yes if the owner has deployment permission on those environments. The key has the same rights as its owner, so the scope depends on the team roles of that user or service account.

Does Octopus store my key so I can look it up?

No. It keeps a one-way hash only, so a lost key cannot be retrieved. If you cannot find where a leaked key came from, compare the end of the value with your keys list.

Should I use a service account for automation?

Yes, ideally with only the permissions the pipeline needs. A leak then reaches less than a personal key would.

## Related

-   [CircleCI Personal Access Token](/secrets/circleci-personal-access-token)
-   [Terraform Cloud API Token](/secrets/terraform-cloud-api-token)
-   [Artifactory API Key](/secrets/artifactory-api-key)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Octopus Deploy.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
