Skip to content
Code & CI · Secret guide

Leaked Greptile API Key: what to do in the first hour

High severityDetected onlyLast verified · 5 min read

A Greptile API key is the credential that lets a script or service call Greptile’s API. Greptile is an AI code review tool that indexes repositories, and its API can be used to ask questions about that indexed code. A leaked key therefore gives indirect read access to the source of the repositories it covers, through the answers the API returns. The key is not a repository token, so it will not clone your code on its own, but it can expose the contents of the code it has indexed. Replace the key first, then review which repositories it could reach.

Check your GitHub account for leaked secrets — free

Provider
Greptile
Severity
High
Impact
Source code and build access
Checked live by LeakWatch
No

What a Greptile API Key looks like

Greptile does not, as far as we could confirm, use a fixed visible prefix for its keys. The rule in LeakWatch therefore looks for a value of 48 characters from letters, digits, plus signs and slashes, and only when the word greptile appears just before it, with an assignment sign or a similar separator between the two. The masked form below shows the general shape only:

GREPTILE_API_KEY=…XXXX   variable name with a masked value

Because the value has no recognizable prefix, the name of the variable or the word Greptile near the value is what identifies it. A 48-character string of letters and digits can be almost anything, so do not assume that an unmatched value is harmless when it sits in a file that also mentions Greptile. If you are not sure whether a value is a Greptile key, check the key list in your Greptile account and compare the last characters.

How Greptile API Keys get leaked

  • Pipeline configuration. A continuous integration file that sets the key as a plain variable, instead of referencing a secret store, pushed to the repository.
  • Local environment files. A .env file used when running a review locally, committed by accident or copied into a template repository.
  • Logs. A debug step that prints the environment or the request headers when a review job fails.
  • Shared scripts. A script that calls the API for reporting, with the key hard-coded so the script can run on other machines.
  • Chat and tickets. A key pasted into a conversation with a colleague or a support request when a call returned an error.

What to do in the first hour

  1. Replace the key. Sign in to your Greptile account, open the account settings and find the API key section. Create a replacement, then remove the old key. If the integration cannot be interrupted, deploy the new value first and then delete the old one within the same hour.
  2. Store the replacement in your CI secret store or the environment of the process that uses it. Never place it in a configuration file that is committed.
  3. Review indexed repositories. Check which repositories the account has indexed. Remove any that should not be available to the key’s users, and confirm that the list matches what your team expects.
  4. Check API activity. If Greptile shows usage or request history, look at the period since the exposure. Look for requests from unfamiliar sources and for queries that cover repositories you did not expect to be asked about.
  5. Review the people who can use the key. Remove team members who no longer need access and review any integrations connected to the account.
  6. Check the code-review pipeline. Make sure the review tool itself has not been changed, for example by a pull request that edited its configuration.
  7. Clean the repository. Remove the value from current files, add the environment file to .gitignore, and rewrite history if the repository was public. See I accidentally pushed an API key to GitHub for the full order.

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 Greptile

We could not find Greptile’s own documentation for creating or revoking API keys while preparing this guide, so we cannot describe the exact steps with confidence. In general, a code review service like this manages keys from an account or organization settings page, where each key can be listed, created and deleted. Look for a section named for API keys in the account settings, and check whether the key you need belongs to your personal account or to your organization. Create the replacement before you delete the old key whenever a pipeline depends on it, and make sure the new key is stored in a secret manager. If you cannot find the key, contact Greptile support and ask them to revoke it for you.

How LeakWatch detects it

The rule is called “Greptile API Key”. It looks for the word greptile, followed by a short run of characters and an assignment sign or similar separator, then a value of exactly 48 letters, digits, plus signs or slashes, with a quote, space, semicolon or line end after it. The word requirement is what stops the rule from flagging every value of that length. The severity is high, with the identity and code impact class, because the key can reach indexed source code. This type is not checked live: LeakWatch does not send the value to Greptile, so a finding means the value and its name matched, not that the key still works. A value without the word Greptile nearby is not reported by this rule.

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 someone clone my repository with a Greptile key?

Not directly. The key authenticates to the Greptile API, which answers questions about indexed code. It is not a Git credential. The risk is that the answers can disclose parts of the code, so the response is about the indexed content as well as the key.

If the key was only in a private repository, is that enough?

Less risky, but only if access to the repository is limited to people who should see the key. Anyone who can read the repository, including every clone and CI log, can read the key, so treat it as exposed if the access list has ever been wider than you intended.

How should I store the key in the future?

In a secret store, referenced by name from the pipeline, and in the environment only for the process that needs it. Rotate it when a team member with access leaves.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Greptile.