Skip to content
FlashTowerFlashTower home

AI Security · GitHub Copilot

GitHub Copilot security: code, agents, and secrets

GitHub Copilot has grown from code completion into chat, IDE agent mode that edits files and runs commands, and a coding agent that works on issues and opens pull requests. Each step adds reach into your repositories and build systems.

Last reviewed: September 2026

Copilot's capabilities

  • Code completion and chat in the editor, using the open files and repository context.
  • Agent mode in the IDE, which can plan multi-file changes and propose or run terminal commands, subject to the developer's approval settings.
  • The Copilot coding agent, which can be assigned an issue, work in a cloud environment, push to a branch, and open a pull request for review.
  • Extensions and MCP servers that connect Copilot to other tools and data sources.

GitHub offers individual plans and organization plans (Business and Enterprise) with policy controls, content exclusion settings, and audit logging. Individual plans used on company code bypass those controls.

Verify current terms

Vendor plans, features, and contractual terms change often. Treat the descriptions on this page as a starting point and confirm the current terms, admin settings, and data-handling commitments for your specific plan directly with the vendor before relying on them.

What Copilot can access

Copilot works with the code and files available in the developer's environment and, for the coding agent, the repository it is assigned to. That can include configuration files, test fixtures with real data, infrastructure-as-code, CI/CD workflow definitions, and — too often — committed secrets.

Key risks

Secrets in context

If API keys, database credentials, or tokens exist in the repository or local files, an AI assistant can read them and may reproduce them in suggestions, logs, or pull requests. The fix is not an AI setting; it is keeping secrets out of code.

Commands executed in agent mode

When agent mode can run terminal commands, the developer's machine credentials — cloud CLI sessions, kubeconfig contexts, SSH keys — are within reach of whatever command is run. Auto-approving commands removes the human check.

Prompt injection through issues, code, and dependencies

Issue descriptions, code comments, documentation, and dependency READMEs are untrusted input. A malicious issue assigned to a coding agent can attempt to induce changes beyond the requested task.

Unreviewed changes and CI/CD

AI-authored changes to workflow files can alter what runs in CI with repository secrets. Changes to branch protection or CODEOWNERS weaken review for everything else.

Personal plans on company code

Developers using individual Copilot plans on organization repositories operate outside your policies, exclusions, and audit logs.

Recommended controls

  • Use an organization Copilot plan and set policies centrally; disallow individual plans on company repositories.
  • Enable secret scanning and push protection; rotate any secret ever committed.
  • Configure content exclusion for sensitive paths where supported.
  • Protect default branches: required reviews, CODEOWNERS for workflows and infrastructure, no bypass for bot identities.
  • Require human review of every pull request opened by the coding agent.
  • Keep production credentials off developer machines; use short-lived, least-privilege credentials.
  • Keep command auto-approval off in agent mode, or restrict it to a narrow allow-list.
  • Review which MCP servers and extensions are permitted.

How FlashTower assesses this

When you add GitHub Copilot to a FlashTower Scan, the Risk Engine evaluates how it is actually used in your organization — account type, data accessed, capabilities, autonomy, credentials, logging, and vendor terms — against a versioned, deterministic ruleset. These rules are the most relevant for GitHub Copilot. Each fires only when its stated condition is met. See how scoring works.

Sensitive Data

  • FT-DAT-012High

    Sensitive business data in a consumer AI account

    A free or personal consumer AI plan is used with personal information, financial data, customer records, or source code.

Credentials & Secrets

  • FT-CRD-001Critical

    Credentials embedded in code, configuration, or prompts

    The AI system authenticates with a key embedded in code, configuration files, or prompts.

  • FT-CRD-005High

    AI system can read passwords, keys, or secrets

    The AI system has access to credentials or secrets as data.

Identity

  • FT-CRD-003High

    AI system acts with an employee's personal credentials

    The AI system uses an individual employee's login or personal access token.

Human Oversight

  • FT-AGT-002High

    Autonomous agent with high-impact permissions is not logged

    The AI system acts on its own (within limits), holds high-impact capabilities, and its activity is not logged or logging is unknown.

Code Execution

  • FT-EXE-001Critical

    AI can execute code against production or cloud infrastructure without approval

    The AI system can execute code and reach production systems or cloud administration, without per-action human approval.

  • FT-EXE-002Medium

    Human-approved AI code execution with production reach

    The AI system can execute code with production or cloud access, and a person approves each action.

Permissions

  • FT-PRM-013Medium

    Broad permission scope

    The AI system holds six or more distinct capabilities.

Agent Risk

  • FT-CDE-001High

    AI can push code without review

    The AI system can push code or open changes to repositories without per-action human approval.

Third-Party Integrations

  • FT-3PI-001High

    Prompt-injection exposure: web access combined with sensitive data or actions

    The AI system can browse the web or call external URLs and also has sensitive data or high-impact capabilities.

Frequently asked questions

Can GitHub Copilot see our secrets?

If secrets exist in the repository or files available to it, Copilot can read them as context. Keep secrets out of code, enable secret scanning and push protection, and rotate anything exposed.

Is the Copilot coding agent safe to use?

It can be, when every pull request it opens gets human review, branch protections apply to it, and workflow and infrastructure files require code-owner approval.

Should developers use personal Copilot plans?

Not on company code. Organization plans provide policy controls, content exclusions, and audit logs that personal plans do not.