AI Learning Hub › Learn AI › Self-Paced Courses › VS Code: Files, Changes, and AI Agents › Extensions, and What You Are Trusting
Module 8 ยท Intermediate
Extensions, and What You Are Trusting
An extension is software you chose to run inside your project. Workspace Trust is the product's answer to opening a folder someone else wrote, and .gitignore is not an access-control setting.
By the end
- Explain what installing an extension actually changes
- Find a publisher and say why it is worth looking at
- Describe what Workspace Trust and Restricted Mode are for
- Say what
.gitignoredoes and does not do - Decide what should not be in a folder you are about to open for a tool
Two decisions get made early and quietly: what software you installed into your editor, and which folders you told it to trust. Neither feels like a decision at the time. This module makes both visible.
The tone here is deliberate. Extensions are normal, useful and worth having, and Workspace Trust is a sensible feature rather than a warning sign. The aim is informed control, not caution for its own sake.
What an extension is
An extension is software written by someone else that you added to VS Code to give it a capability it did not have — language support, a linter, an AI assistant. It runs inside the editor, and it generally has access to the project folder you have open.
Three things on that screen are worth reading before you install anything. The publisher is named under each extension, and some publishers carry a verification badge indicating the Marketplace has confirmed who they are. The install count and rating give you a rough sense of how widely used something is. And Microsoft describes the Marketplace as applying “publisher trust” and malware scanning, which is a real protection and not a guarantee.
An unverified publisher is not a red flag by itself — plenty of good extensions come from individuals. It is one more thing to weigh, alongside how many people use it and whether you actually need it.
Two practical notes. An extension you want to stop using can be disabled rather than uninstalled, which keeps it available without letting it run. And after installing or disabling one, if the change does not seem to take effect, Developer: Reload Window from the Command Palette is the cheap thing to try.
Workspace Trust
Opening a folder means letting the editor, its extensions and anything else in the window read what is inside — and in some cases run what is inside. That is fine for a project you wrote. It is a more interesting question for a folder somebody sent you.
Workspace Trust is Microsoft’s answer. The documentation describes a Restricted Mode intended “to prevent automatic code execution while you review the contents.” When a workspace is not trusted, the documentation lists tasks, debugging, the terminal, some workspace settings and some extensions as disabled or limited, and notes that AI agents do not run. Text editing always works, so you can read the project before deciding anything.
VS Code’s own Workspace Trust screen puts the contrast plainly. In a trusted folder: tasks are allowed to run, debugging is enabled, all workspace settings are applied, all enabled extensions are activated. In Restricted Mode: tasks are not allowed to run, debugging is disabled, and some settings and extensions are not applied. You can see this for yourself at any time through the Command Palette with Workspaces: Manage Workspace Trust.
A limitation worth stating. This course could not reproduce Restricted Mode during its development, so it does not describe what you will see when you first open an unfamiliar folder, and it carries no screenshot of it. What is above comes from Microsoft’s documentation and from VS Code’s own Workspace Trust screen. Open that screen on your own machine to find out what your installation is doing.
One behavior is worth knowing because of how far it reaches. The Workspace Trust screen describes the folders you trust as covering “the following folders, their subfolders, and workspace files.” Trust runs downward. Trusting a folder high up in your home directory therefore trusts everything beneath it, including projects you have not downloaded yet.
Files that configure things
Some files in a project are not content at all. They tell tools how to behave, and they are easy to miss because their names often start with a dot and the operating system hides them. VS Code does not, which is one of the quieter advantages of the Explorer.
.gitignore- A list of files Git should normally leave untracked.
.env- Configuration values for a project. Often harmless, sometimes holding credentials or API keys.
AGENTS.md,CLAUDE.md,.claude/,.github/- Instructions and configuration for particular tools. You do not need to learn any one tool’s format. You need to recognize that files like these can change how a tool behaves in this project.
The general point is the useful one: a project may contain files that influence what a tool does, even though they are not part of the page or document you are editing.
What .gitignore is not
This one is worth being precise about, because the misconception is common and consequential.
Git’s manual defines a .gitignore file as one that “specifies intentionally untracked files that Git should ignore,” and notes that files already tracked “are not affected.” That is the whole of what it describes: which files Git keeps out of its own history.
The manual describes no hiding, no encryption and no access control, because it does not do any of those things. A file listed in .gitignore is an ordinary file sitting in your folder. Anything with access to that folder — an extension, a command, an AI agent — can read it exactly as it could read any other file.
.gitignore tells Git which untracked files to leave alone. It is not an access-control setting for VS Code or for an AI tool. If a file should not be read by something you are about to give access to your project folder, keeping it out of Git is not the mechanism that achieves that.
Before you open a folder for a tool
This is the practical version of “be careful with AI,” and unlike that phrase it names things you can actually do.
- Check which folder you are opening. Module 2’s question, with higher stakes.
- Do not open your whole home directory. Open the project. A folder containing every document you own is a much larger surface than the one you need.
- Look at what is in there first. Downloaded files, old exports, a
.envfrom a different project — things accumulate in working folders. - Move sensitive material out rather than relying on it being ignored by Git.
- Do not paste credentials into prompts. Separate from the folder question, and worth saying.
None of this says an agent will read everything in reach, or that any particular tool does. What any given tool can see depends on the tool and on the permissions it was given. The point is that the folder you open sets the outer boundary, and that boundary is yours to choose.
A note on Profiles
VS Code has a feature called Profiles that keeps separate sets of settings, extensions and layout, and associates them with particular folders. If you find yourself wanting an experimental setup that does not disturb your working one, that is what it is for. It is a convenience for keeping things apart, not a security boundary, and you do not need it to finish this course.
Exercise: audit what you are already trusting
- Open the Command Palette and run Workspaces: Manage Workspace Trust.
- Read the two columns describing a trusted folder and Restricted Mode. Which specific capabilities does trust switch on?
- Find the list of folders you trust. Is anything on it broader than you intended — a whole home directory, or a drive?
- Open the Extensions view. How many extensions are installed? Pick one and find its publisher.
- Ask yourself one question about it: if this extension could read everything in the project folders you open, would that be fine?
What counts as a reasonable answer
For most people, for most extensions, the answer is yes and that is the end of it. A language extension from a well-known publisher reading your HTML is not something to worry about.
The question earns its place in the cases where the answer is less automatic: an extension you installed once for a single task and forgot, or something from a publisher you cannot identify, sitting in a profile you use for work folders.
And if your trusted list turns out to be broader than you expected, that is worth knowing. Trust is inherited downward, so a single broad entry can cover a great deal more than the folder you were thinking about when you granted it.