Skip to main content
GitHub Copilot Security Guide
Q&AGitHub Copilot

Can GitHub Copilot leak secrets?

Copilot can suggest code containing hardcoded API keys, passwords, and tokens that it learned from public repositories. While GitHub has filters to reduce secret exposure, Copilot may still suggest patterns like placeholder credentials that developers replace with real values but forget to move to environment variables. It can also suggest code that reads secrets from insecure locations or logs sensitive information. The broader risk is that Copilot normalizes insecure credential handling patterns. UNPWNED scans your deployed application for exposed secrets, API keys, and credentials in client-side code, configuration files, and API responses.

Check your GitHub Copilot app now

Run free security scan

Last reviewed: 2026-04-07. Based on publicly available security research and UNPWNED scan telemetry.