Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

treat a suspected stolen AI coding-assistant credential as an incident-triage problem. One failed request or service outage is not proof. Confidence rises when independent evidence agrees: an exposed key, unfamiliar token use, unknown source IP, unexpected repository or workflow changes, suspicious code, data-exfiltration signs, or API usage and spending you cannot explain.

Preserve evidence first, then validate the signal across logs and activity views, revoke the credential, rotate every connected secret, and investigate for persistence. The sequence below shows exactly what to check and how to respond.

What counts as an AI coding-assistant credential?

The credential may be more than the API key you intentionally copied into an IDE. Inventory every value that can authorize requests or act on your behalf:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Long-lived API keys created in a provider console.
  • Personal, repository, organization or fine-grained access tokens used by source-control integrations.
  • OAuth refresh tokens and application grants that let an editor or extension obtain new access tokens.
  • Session cookies or cached login tokens stored by an IDE, browser or command-line helper.
  • Short-lived federation or workload-identity tokens issued to a build runner or cloud service.
  • Repository, environment and organization secrets consumed by automation.

A credential is “stolen” when an unauthorized person or process can use one of these values. The value may be copied from a public repository, an .env file, a log, a crash report, a CI artifact, an IDE cache or a compromised workstation. You do not need proof of a successful code change before treating an exposed secret as high risk.

#1 Best Overall
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

The evidence that most reliably indicates compromise

Look for several independent signals. Record the credential name, actor, IP address, timestamp in UTC, repository and action for each finding.

Signal Where to check How to interpret it
Secret-scanning alert or exposed key Provider alerts, repository history, branches, pull requests, .env files, configuration and logs Exposure proves the secret was accessible; it does not by itself prove use, but requires prompt revocation.
Unknown token or login activity Audit log, account security history, active-session list and OAuth-app grants An actor, token ID or session you cannot explain is strong corroboration.
Unfamiliar source IP Audit events and API-request logs when source-IP disclosure is enabled Compare with corporate egress, VPN, home and CI addresses. Shared runners can create benign surprises.
Unexpected repository or workflow change Activity timeline, commits, pull requests, branch protection, workflow runs, repository creation and visibility history New files, altered workflows or a public-visibility change can indicate code injection or preparation for exfiltration.
Suspicious code or files Diffs, build scripts, dependency files, workflow definitions and generated artifacts Look for downloaders, credential collection, obfuscated commands, unusual outbound connections and persistence.
Unexplained usage or spending API usage dashboard, per-key or per-project reports, invoices and spend alerts Requests, models, regions or charges outside your normal pattern support the compromise hypothesis.
Data-exfiltration indicators Network logs, artifact stores, object-storage access, issue comments and unusual pull requests Unexpected transfers of source code, prompts, secrets or build artifacts raise the incident severity.

No single symptom is conclusive. A provider outage can cause errors, and a shared CI runner can make a familiar job appear from a new IP. Treat each item as a lead and correlate it with identity, time, repository and usage data.

Step 1: Preserve evidence before changing anything

Revoking a token is important, but deleting evidence first can make scope determination impossible. GitHub’s incident guidance specifically advises capturing screenshots, exporting logs or query results while available, and saving copies of affected files or code before cleanup. Opening a support ticket does not preserve logs or extend their retention.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Set a UTC incident start time. Use the earliest alert, suspicious request or exposure timestamp you can establish.
  2. Export alerts and logs. Download secret-scanning notifications, audit events, API-request records, session history and billing or usage data in their native format when possible.
  3. Capture context. Screenshot the alert, token name or suffix, actor, IP address, user agent, repository, workflow run and exact timestamps. Redact the secret value itself.
  4. Save suspicious content. Copy malicious-looking commits, workflow files, pull requests, issue comments, artifacts and configuration into read-only evidence storage. Preserve commit IDs and hashes.
  5. Record known-good facts. List normal developers, automation accounts, runner IP ranges, deployment windows and expected model usage so investigators can distinguish routine activity.
  6. Restrict access to evidence. Store exports where only the incident team can read them; logs may contain source code, prompts, personal data or other secrets.

Step 2: Validate the signal across independent views

Start with the credential’s identity and permissions, then correlate activity rather than relying on one dashboard.

Rank #2
Yubico - YubiKey 5C NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

Search for exposure

Search all branches and repository history, not only the default branch. Check current and deleted .env files, editor settings, build logs, CI artifacts, issue comments and paste locations controlled by your organization. A secret removed in a later commit can remain in Git history and caches. Search for the provider’s key prefix, the token name and any distinctive non-secret metadata; do not paste the secret into a third-party search service.

Review identity and audit records

Filter audit events by token ID, actor, application, repository and time window. Examine successful and failed authentication, token creation, permission changes, OAuth grants, repository access, workflow dispatch, branch-rule edits and organization-member changes. If source-IP logging is available, compare each address with documented VPN, office, cloud-runner and developer networks. A new IP is more meaningful when it appears with an unfamiliar actor or an action outside the person’s normal schedule.

Check repositories and automation

Inspect commits, pull requests, tags, branch protection, deploy keys, webhooks, scheduled workflows and self-hosted runners. Pay special attention to workflow files that add shell commands, download binaries, print environment variables, change permissions or send data to a new endpoint. Review repositories created during the window and any visibility transition from private to public.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare usage and billing

Group requests by key, project, model, region and time. Look for a sudden increase, unfamiliar model, unusually long prompts or calls after the key was supposedly unused. OpenAI advises API users to review usage, set spend thresholds and separate keys by project or feature. A charge alone is not attribution, but it becomes strong evidence when its timestamps match an unknown actor or IP.

Rank #3
Yubico - YubiKey 5 NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-A or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

Step 3: Contain the suspected credential

Containment limits additional use while you investigate other paths.

  1. Revoke or delete the suspected key or token. Use the narrowest revocation control available, and note the exact time and credential identifier.
  2. Terminate active sessions. Sign out all sessions when a browser, OAuth token or account login may be involved. If the provider supports per-session revocation, remove unfamiliar sessions first and then invalidate all sessions if uncertainty remains.
  3. Change an exposed or reused password. Change it from a known-clean device and never reuse the replacement. Reset passwords for accounts that shared the same credential or recovery path.
  4. Disable suspicious grants. Remove unknown OAuth applications, deploy keys, webhooks, organization members and new administrators.
  5. Pause risky automation. Temporarily disable workflows or runners that may still hold the credential, while preserving their logs and workspace images for investigation.
  6. Protect dependent systems. If the token could reach cloud storage, package registries, databases or deployment systems, apply temporary network and permission restrictions there as well.

Containment is not remediation. A revoked key stops future use of that value but does not remove copies, malicious commits, backdoors or credentials that were accessed with it.

Step 4: Rotate and repair every connected secret

Generate replacements only after the old values are invalid. Give each project, environment or integration its own scoped credential so one leak has a smaller blast radius.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Create a new key or token with the minimum read, write or administrative permissions required.
  2. Update repository, environment, organization and deployment secrets. Replace values in CI systems, IDE settings, local credential stores, containers and scheduled jobs.
  3. Rotate credentials in connected external systems that the assistant could access, including cloud accounts, package registries, databases, signing services and source-control deploy keys.
  4. Remove the exposed value from current files, logs, artifacts and documentation. Then inspect history and caches; rewriting history may be necessary, but coordinate it because it changes commit identifiers and does not replace revocation.
  5. Restart or redeploy processes that loaded the old value into memory. Confirm that failed requests using the old credential are rejected.
  6. Document replacement IDs, scopes, owners, creation time and planned expiry. Do not record secret values in the incident ticket.

Step 5: Investigate scope, persistence and data access

Assume the credential may have been used for more than inference requests. Determine what it could read, write, create or delegate.

Rank #4
Yubico - Security Key NFC - Basic Compatibility - Multi-Factor Authentication (MFA) Key, Connect via USB-A or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

Repositories and code

Review all repositories the identity could access, including archived and private projects. Search for unauthorized commits, force-pushes, tags, releases, pull requests, issues and comments. Compare workflow and dependency files with a known-good revision. Check whether a malicious change was merged, built or deployed even if it was later reverted.

Accounts and permissions

Audit new users, team memberships, organization owners, access grants, deploy keys, webhooks, runner registrations and application installations. Remove persistence before restoring normal permissions. Check recovery email, multi-factor settings and personal access tokens for unexpected changes.

Data and exfiltration

Identify source code, prompts, customer information, environment variables, signing keys and build artifacts accessible during the exposure window. Compare downloads and outbound network connections with normal behavior. If sensitive data may have left the environment, involve privacy, legal and security stakeholders according to your response plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cloud-token nuance

Google Cloud distinguishes long-lived API keys from short-lived federation tokens. Investigate both persistent key material and temporary tokens; revoking a long-lived key does not explain or automatically invalidate every temporary credential issued to a workload. Review the identity provider, token-exchange events, workload configuration and expiration times.

Best Value
FIDO2 U2F Security Key Passkey Two-Factor Authentication (2FA) USB Key PIN+Touch (Non-Biometric) USB-A Type TrustKey T110
  • Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
  • Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
  • Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
  • Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
  • For the driver download and user guide, please visit TrustKey Solutions Home support page.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Provider-specific checks

OpenAI API or account credentials

OpenAI’s “Keeping your OpenAI account secure” guidance says to change an exposed password, log out all sessions, delete affected API keys, review API usage and security history, and contact Support. Use environment variables or repository secrets instead of embedding keys in shipped applications. Enable automated scanning before publication, rotate keys periodically, separate keys by project or feature, and set spend thresholds. OpenAI states that keys detected on the public internet or in an app store are disabled immediately, so a sudden authentication failure can be a containment action rather than proof that someone used the key.

GitHub-based assistants and repositories

Use audit logs, activity timelines, secret-scanning alerts, repository security settings and workflow history together. GitHub’s incident workflow is organized around assessing and validating, containing, investigating, remediating, documenting and hardening. Enterprise teams should prepare audit-log streaming, API-request event streaming and source-IP disclosure where available, with retention and responder access sufficient for an investigation. GitHub warns that a credential compromise may enable malicious code injection, which can enable data exfiltration.

Cloud-hosted coding environments

Separate the investigation of persistent API keys from short-lived federation or workload tokens. Examine identity-provider logs, token exchange, runner identity, service-account permissions and expiration. A temporary token may have disappeared by the time you investigate, while its issuance and use remain visible in control-plane logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to distinguish compromise from a false alarm

Use a written hypothesis for each alert: “Credential X may have been used by actor Y between times A and B.” Test it against evidence rather than dismissing it because the first explanation seems plausible.

  • Shared runner IP: Confirm the job ID, runner pool and workflow owner. The address is benign only if the corresponding job and command are expected.
  • Automated dependency or bot activity: Match the user agent, schedule, repository and token scope to documented automation. Unexpected permissions or destinations still require containment.
  • Developer travel or VPN: Verify with the person through a separate channel and compare device, session and action details. Do not treat a verbal confirmation as a substitute for logs.
  • Provider outage: Check status information and error codes, but continue investigating if identity, repository or billing anomalies remain.
  • Secret-scanning false positive: Determine whether the detected string is a test value or revoked sample. If its validity is uncertain, revoke it and prove that dependent jobs work with a replacement.

Escalate immediately when you find unauthorized code execution, access to regulated or customer data, an administrator change, evidence of exfiltration, or activity continuing after revocation.

Controls that reduce the next incident’s impact

Control Implementation Risk reduced
Multi-factor authentication Require MFA for provider, source-control and cloud accounts; use a FIDO2 security key where the provider and account policy support it. Stolen passwords are less useful, although MFA does not replace key revocation.
Scoped, separate keys Use one credential per project, environment or feature with only required permissions. Limits blast radius and makes anomalous usage attributable.
Short lifetimes Prefer short-lived federation or workload tokens for automation when supported; set expiry and renewal ownership. Reduces the window in which a copied value works.
Secret scanning Scan commits, pull requests, repositories, artifacts and publication pipelines; alert responders and block verified secrets where practical. Catches accidental exposure before broad distribution.
Environment-based storage Keep secrets in managed environment or repository-secret stores, not source files, shipped applications, screenshots or logs. Reduces accidental disclosure through code and support channels.
Audit and retention Stream audit and API-request events, enable source-IP data where available, and retain them long enough for investigation. Provides attribution after an alert arrives.
Usage and spend thresholds Set per-project budgets, request alerts and rate limits; review anomalies by key and model. Limits financial loss and surfaces unauthorized use quickly.
Runbooks and ownership Document who can revoke, rotate, preserve logs, notify stakeholders and contact the provider. Prevents delay and destructive ad-hoc cleanup.

A compact incident checklist

  • Capture the alert, logs, screenshots, suspicious code and UTC timestamps.
  • Identify the credential, owner, scopes, repositories, workflows and connected systems.
  • Correlate token use, actors, IPs, sessions, repository events and usage or billing.
  • Revoke the suspected value and terminate risky sessions.
  • Rotate replacement credentials and every dependent secret.
  • Remove exposed values from code, logs, artifacts, history and caches as appropriate.
  • Search for malicious code, workflow changes, new access grants, persistence and exfiltration.
  • Document decisions, indicators, affected accounts and remediation.
  • Notify security, engineering, legal or privacy stakeholders when sensitive data may be involved.
  • Contact the assistant provider with preserved evidence and exact timestamps.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.