A New Relic insert key is a write-only credential for sending data into a New Relic account: events, metrics, logs or traces. It belongs to the older Insights API, which has been replaced by ingest keys in the API keys page, but old keys can still sit in code. It cannot read your data, so the main risks are different from a user API key: someone can push false or junk data into your account, pollute dashboards and alert conditions, hide a real incident behind noise, or consume your data allowance. Replace it first, then check what was sent.
Check your GitHub account for leaked secrets — free
- Provider
- New Relic
- Severity
- High
- Impact
- SaaS account access and billing
- Checked live by LeakWatch
- No
What a New Relic Insert Key looks like
A New Relic insert key starts with NRII- followed by 32 characters, which are lowercase letters, digits and dashes:
NRII-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX New Relic insert key (masked, 32 characters after the prefix)
It is sent in an X-Insert-Key header to the event API, and it appears in variables named NEW_RELIC_INSERT_KEY or NEWRELIC_INSERT_KEY, in agent and exporter configuration, and in application settings. Other New Relic keys look different. The current ingest license key is a 40-character hexadecimal string, user API keys begin with NRAK-, and browser keys begin with NRJS-. Having the NRII- prefix tells you that it is an insert key, not a user key.
How New Relic Insert Keys get leaked
- Custom event scripts. A script that posts events to the event API with the key in the header, committed with the code.
- Agent and exporter configuration. A YAML or INI file for a monitoring agent or a metrics exporter that carries the key.
- Environment files.
NEW_RELIC_INSERT_KEYin a.envor compose file that lands in a repository. - CI and deployment hooks. A pipeline step that records a deployment marker or a test result, with the key stored in the pipeline file or printed in the log.
- Old projects. Keys created for the Insights API years ago and left in repositories nobody has touched since.
What to do in the first hour
- Find the key in New Relic. Sign in and open the API keys page of the account. Insert keys that were created before the move to ingest keys may be listed with the other ingest keys, or may no longer have a place there. Match the exposed one by its name or last characters.
- Create a replacement ingest key and deploy it to the agents, exporters and scripts that used the insert key. Check that data keeps arriving.
- Delete the exposed key. New Relic documents that ingest keys are deleted from the key’s menu, and that you should update everything that depends on a key before you delete it. Then confirm the old value is rejected.
- Check the data that arrived. Query the event types and metrics your account receives for names, sources and volume you do not recognize, over the period since the exposure. Compare the data allowance used with a normal week.
- Review alerts and dashboards. False data can trigger notifications or keep an alert quiet. Check conditions that depend on the affected event types.
- Check for other keys. A file with an insert key may also hold a license key or a user API key (
NRAK-). Rotate those too, and see the guide on New Relic user API keys. - Clean up the code and look for other secrets next to the key. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at New Relic
New Relic keys are managed from the API keys page of your New Relic account, after you sign in with a user allowed to manage keys for it. According to the documentation, ingest keys are deleted from the key’s menu, keys cannot be edited, and a key is replaced by creating a new one. The original license key of an account cannot be deleted from that page, and New Relic support can regenerate it. If your insert key does not appear in the list, it may be a legacy key: contact New Relic support, and rotate any related ingest keys. A person has not confirmed the exact menu wording for this guide, and the interface can change, so look for the page where API keys are listed, and follow New Relic’s documentation.
How LeakWatch detects it
The rule is called New Relic Insert Key. It looks for the exact prefix NRII- followed by 32 lowercase letters, digits and dashes. It also needs a variable name nearby: the text new-relic, newrelic or new_relic, then an assignment sign such as =, : or =>, then the key, which must be followed by a quote, a backtick, whitespace, a semicolon or the end of the text. A bare NRII- string with no New Relic name before it, or one with a different length, is not reported. The severity is high. This type is not checked live: LeakWatch does not send any request to New Relic with the key it found, so verify in your account whether it is still active.
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 insert key read my data?
No. It is meant for writing data into an account. The risk is false data, noise and extra usage, not reading, but treat it as a leak all the same.
Is an insert key the same as a license key?
No. They are different keys with different formats, though both are used to send data. The license key is 40 hexadecimal characters. If a file contains one, replace it as well.
Why does my key not appear in the API keys page?
Insert keys come from an older API, and New Relic now manages ingest keys on that page. If you cannot find it, check the other accounts you own and ask New Relic support. Do not leave it in place just because it is not listed.