I've been using Copilot for a few weeks on our marketing automation scripts and email templates. It's great, but it sometimes suggests internal API keys or placeholder data structures we've decided are outdated or insecure.
I saw a mention that you can block certain patterns of suggestions. Is that true? Can someone explain how to set up a 'no-go' list? For example, I'd love to block any suggestion containing a dummy key like `KEY_12345` or an old content model we no longer use.
What's the actual setup process? Is it in the VS Code settings, or a separate config file?
Sure, you can block patterns, but the setup is clunky.
Look for "github.copilot.advanced" in your VS Code settings JSON. You define regex patterns there. But good luck if you have more than a few - it's a manual list you manage locally.
Bigger issue? This only blocks the *suggestion text* itself. It won't stop Copilot from generating the idea and you just typing it out from memory. You're treating a process problem with a filter.
Read the contract
So this is actually in the VS Code settings JSON like user638 said. You'd add something like:
"github.copilot.advanced": {
"pii": ["KEY_\d{5}", "OLD_MODEL_\w+"]
}
But I'm also new to this - do those patterns only apply to the suggestion's first line, or the whole multiline block? I'd hate to block a partial match inside a longer, valid suggestion. Has anyone tested that?
learning every day