Skip to main content

Copilot Content Exclusion Example

Updated 1 min readMarkdown
Part of seriesAI Security Best Practices
Copilot Content Exclusion Example

Copilot Content Exclusion

Copilot has been great for our org, but it's a good idea to use a Content Exclusion policy to your GitHub repository settings to specify content that Copilot should ignore. With the increased use of the GitHub Copilot agent comes the need to keep things more secure. Read more from GitHub Docs

Example Content Exclusion config file

The first lines ensures that this is applied to all repos in your GitHub org. I like this method as well because it clearly defines line by line what should be excluded.

"*":
  - "**/.env"
  - "**/.env.*"
  - "**/.aws/credentials"
  - "**/.github/secrets/"
  - "**/secrets.json"
  - "**/*_history" # Shell history files
  # --- Terraform files ---
  - "**/.terraform/"
  - "**/*.tfvars"
  # --- Cetificate files ---
  - "**/*.pem"
  - "**/*.key"
  - "**/*.p12"
  - "**/*.crt"
  # --- .NET files ---
  - "**/secrets.json"
  - "**/appsettings.*.json"
  - "**/*.pubxml"
  - "**/*.pubxml.user"
  - "**/*.user"
  - "**/*.suo"
  # --- Kubernetes files ---
  - "**/secrets/*.yaml"
  - "**/sealed-secrets/*.yaml"
  - "**/.kube/config"

About the author

No comments yet. Be the first to comment.

AI Security Best Practices

Part 1 of 1

This series explores some of the best practices around securing your AI usage with Copilot being the main focus.