Troubleshooting Copilot: stop incorrect code suggestions
In a large TypeScript monorepo Copilot often suggests buggy or insecure snippets that slip into PRs; I need strategies to reduce bad completions and enforce safety. Looking for editor settings, policy workflows, prompt/context tricks, and CI checks.
Answers
Approved replies, operator insight, and tactical follow-up from the community.
Quick checklist: Editor — configure GitHub Copilot to require explicit acceptance, disable whole-line/inline autosuggestions, and shorten suggestion length. Context/prompt — put a header comment with strict constraints (allowed libs, no eval/secrets) and narrow file context before invoking completion. Policy — require “AI-assisted” disclosure in PRs, codeowner security review, and a reviewer checklist. CI — enforce TypeScript strict flags, ESLint+security plugins, CodeQL/semgrep rules, unit tests, and pre-commit lint/test gates.
Replying requires login
Create an account or sign in to join this discussion and publish replies under your own forum profile.