Protecting Code
To avoid sending sensitive information to an LLM, you can use the AI Assistant protect file. Each line in the protect file defines a pattern, specifying which files should or should not be protected. Content from protected files will be omitted from @snippet and #symbol expansion.
Attention
Content that is pasted or manually entered into the chat will not be safeguarded by this mechanism.
AI Assistant looks for the protect file in:
<project>/.dvt/ai/protect.
Pattern Format
Patterns match agains either absolute or relative paths. Those beginning with a /
on Linux and MacOS, or a drive specifier on Windows, will match agains the absoult path. All other patterns will match agains the project relative path.
|
Matches zero or more characters without crossing directory boundaries. |
|
Matches zero or more characters crossing directory boundaries. |
|
Matches exactly one character. |
|
Matches a single character out of a set of characters. For example, Hyphen Exclamation mark |
|
Groups patterns separated by comma |
|
Expands to environment variable value. |
|
Negates the pattern. Any matching path protected by a previous pattern will become unprotected again. |
|
Comment lines and empty lines are ignored. |
Examples
Protect files from specific directories and their descendents:
# protect all files from a specific directory relative to the project root lib/ip1/rtl/** # protect all files from a specific directory in the filesystem /path/to/ip/store/ip1/rtl/** # protect all files in any directory named 'secret' **/secret/** # protect all files in the user home directory $HOME/**
Protect everything except files inside a specific directory and its descendents:
# protect all files ** # do not protect files inside 'public' directory !/path/to/public/**
Protect all files except those with specific extensions:
# protect all files ** # do not protect files with these extensions !**/*.{sv,svh}