Ask what the string unlocks#
Secret detectors and AI reviewers match on shape: a long random-looking string, an AKIA prefix, a variable called api_key. Shape tells you where to look. It does not tell you whether the string works. Sort the flagged value into one of these before you reply:
- A live credential: it authenticates today, in any environment, including a vendor's test mode.
- A documented example: AWS's IAM guide uses
AKIAIOSFODNN7EXAMPLEas its sample access key ID, and code that quotes it unlocks nothing. AWS access keys - A placeholder such as
YOUR_API_KEY. - An identifier the vendor publishes to clients by design. Check the vendor's own documentation before you rely on this; the name
public_keyis not evidence. - A shared default: a value that ships in a template and works in every install that never changed it.
The last group is the one a quick dismissal gets wrong. The string is public, so it looks harmless, but it is also the key on every deployment that kept the default.
A placeholder flagged as a key#
In October 2026, a pull request to Google's Agent Development Kit documentation added an example of McpInstructionProvider that connects to an MCP server with headers={"Authorization": "Bearer YOUR_MCP_API_KEY"}. Gemini Code Assist flagged it. Its inline comment, now resolved and hidden on the page, warned that a hardcoded placeholder in a documentation example can lead developers to commit real credentials. The review summary suggested "retrieving the API key from environment variables instead of using a hardcoded placeholder." Review
The pull request merged on 22 October 2026 with the placeholder unchanged, beside a new caution to "protect any credentials used in the connection parameters." Merged diff No credential was present, so there was nothing to rotate. What remained was a documentation style choice: reading the key from an environment variable in the example teaches a better habit, and some teams adopt it. Either answer holds up, provided the reply says the string is a placeholder. Leaving such a comment unanswered teaches the next reader that the bot found a key.
A shared default that every install kept#
A human-filed Supabase pull request from May 2026 shows the shared-default case and how a maintainer weighed it. The self-hosted docker-compose.yml hardcoded Realtime's DB_ENC_KEY, and the description argued that "Every self-hosted Supabase instance in the world shares the same encryption key". Pull request
The maintainer checked what the key protects: "This key only encrypts data at rest in the _realtime schema, which in self-hosted lives in the same Postgres." and "If an attacker can read those tables, there's already a much bigger problem". The verdict was "Good defensive fix, but not a critical exposure". Maintainer's reply The change merged on 1 July 2026, moving the value to .env as REALTIME_DB_ENC_KEY.
That reply is the analysis a hardcoded-secret comment needs: what the key unlocks, who can already reach that data, and whether the fix is cheap. It also shows that moving a value into configuration raises its own review points. CodeRabbit flagged that the new setting "currently uses an optional expansion of REALTIME_DB_ENC_KEY and can be empty", and the maintainer noted the key "must be exactly 16 bytes (AES-128-ECB)".
When the string is live#
If the value works, the pull request is the wrong place to start. GitHub's remediation guide warns that "Automated scanners can locate publicly exposed secrets in minutes" and recommends revoking the secret first, after creating a replacement if downtime matters. Remediating a leaked secret OWASP's incident steps put revocation first and rotation second, and note that squashing history to remove the secret "rewrites git history and will break any other links to a given commit." OWASP Secrets Management Cheat Sheet
So the order is: revoke or rotate, then move the value to the secret store the code already uses, then decide whether rewriting history is worth its side effects. A test-mode key belongs here too when it still authenticates, since it reaches the vendor account it was issued for. Dismiss a test fixture only after you have checked that it cannot authenticate, for example because it was generated for the test or its account is gone.
Decide from what the string does#
| What the string is | Evidence to check | Response |
|---|---|---|
| A live credential, in any environment | It authenticates, or you cannot show it does not | Revoke and rotate now, then change the code |
| A documented example key | The vendor's documentation shows the same value | Dismiss, linking the documentation |
| A placeholder | No real value could match it | Dismiss; adopt the suggested pattern only if you want it |
| A public identifier by design | The vendor's documentation says it is meant for clients | Dismiss, linking the documentation |
| A shared default in a template | What it protects and who can already reach that | Change, usually to required configuration; severity follows what it protects |
| A test fixture | Whether it can authenticate anywhere | Dismiss if it cannot; otherwise treat it as live |
When the bot repeats a placeholder finding on later pushes, a rule in its instructions saves the next reply; the guide to custom review rules covers writing one. Record each dismissal with the evidence you checked, as in the guide to dismissed findings.