How about a version of copilot that only learns from your personal career codebase? Or perhaps only works based on a company's internal codebase? That would remove any legal ambiguity.
If these templates are as common as you suggest, it seems learning from your personal codebase should get the job done.
If these templates are as common as you suggest, it seems learning from your personal codebase should get the job done.