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.
Best tools for this use case
Based on the workflow in this discussion, these tools are useful starting points to review.
GitHub Copilot
Leading coding assistant for day-to-day developer acceleration.
Claude
Excellent for careful reasoning, long-form thinking and structured analysis.
Cursor
AI-native coding environment built for deeper assisted development across real codebases.
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.