ℂacheℝefresh's AI-Paladin for VS Code
Chat with your on-prem AI-Paladin router from the VS Code side bar, review
the edits it proposes as diffs, and see its egress posture in the status
bar.
The router does the enforcing: the keyword gate, the model rules and the
egress guard all live in its own process. This extension shows what the
router says, and applies an edit to a file only when you accept it.
What you get
| Where |
What |
| Side bar (the shield icon) |
The AI-Paladin chat. Settings and Metrics are folded away until you open them. |
| Editor |
A diff for each change the on-prem model proposes, with Accept and Reject. |
| Status bar |
The router's posture: SEALED, the mode name, guard unverified, or not running. |
🛡 AI-Paladin: SEALED ← perimeter armed, loopback only
🛡 AI-Paladin: slow ← egress available
⚠ AI-Paladin: guard unverified
⊘ AI-Paladin ← router not running
Starting here
You can install this extension first. It talks to a router running on the
same machine, and when none is running the side bar walks you through it:
| Step |
What happens |
Who does it |
| 1. Install the router |
Shows you the exact command, and after you confirm runs it in a VS Code terminal, as you, without sudo. By default: a virtual environment in ~/.local/share/ai-paladin/venv and pip install ai-paladin into it. |
This extension, on your click |
| 2. Start it |
Runs ai-paladin --no-window in a terminal named AI-Paladin. Stop it there with Ctrl+C. |
This extension, on your click |
| 3. Set up Ollama and the models |
The side bar shows the router's setup page: hardware, Ollama (installed for your user if missing), a model for each bot. Each download asks first. |
The router, behind its own checks |
| 4. Chat |
The chat replaces the setup page. |
|
The same steps are in the AI-Paladin Welcome tab, which opens once the
first time the extension runs with no router answering, and any time from
AI-Paladin: Get Started. They are also listed as a walkthrough on VS
Code's own Welcome page (that tab is VS Code's and is always named
"Welcome").
Already installed the router yourself?
pip install ai-paladin # or pipx, or your own virtual environment
ai-paladin # starts the router on http://127.0.0.1:8722
The extension finds ai-paladin on your PATH; if it is somewhere else,
set aiPaladin.command. A router you started yourself is used as it is.
What step 1 does not do: it never runs sudo. If Python's venv module is
missing (on Ubuntu it is the separate python3-venv package), the command
fails and says so; an administrator installs that. It downloads the
ai-paladin package only, from PyPI; Ollama and the models are step 3.
Your project folder
When the chat opens, the extension tells the router which folder is open in
this window. The router then reads files from it to answer your questions,
through the same gates as everything else: the keyword scan, the protected
paths, and credential files (.env, .ssh, .aws) are never handed to a
model.
The folder is not registered when the workspace is untrusted, when no
local folder is open, or when the router refuses it (your home folder
itself, a system folder, or a folder holding credentials or AI-Paladin's own
settings).
Reviewed edits
With propose edits ticked (it is, in the side bar), you can ask for a
change and the on-prem model answers with one or more proposed edits.
- The router checks each proposal: the path is inside your project folder,
it is not a credential file or one of the files that decide what
AI-Paladin enforces, and the text to replace occurs exactly once. A
proposal that fails is reported in the chat and never shown as a diff.
- VS Code opens the diff and asks Accept or Reject.
- Only on Accept does the extension change the file, and it checks
again first: still inside the open folder, still the same content the
proposal was made against, no unsaved changes. Then it saves the file.
- The outcome is written to the router's audit log.
The router never writes to your project. It only proposes. Rejecting,
closing the prompt, or any failed check leaves the file untouched.
What the review does not do: it does not judge whether a change is correct
or safe. That is what you decide when you read the diff.
The posture is not changed by the extension
There is no command to seal or lift the perimeter. The status bar is read
from GET /api/posture; to change the posture use Settings in the chat
(the router audits the change), or pin the node with defaults.lock_mode
in router/policy.yaml.
What the guard does and does not cover
Stated here because it is easy to assume otherwise once the shield is
sitting in your editor's status bar:
|
Inside the egress guard? |
The router process (ai-paladin) |
Yes. This is the guarded process, and it is the only one that talks to a model. |
| This extension and its side bar |
No. It is part of VS Code. It speaks only to loopback, but the router's guard has no visibility into it. |
| VS Code itself |
No. Telemetry, settings sync, the extension gallery, git push. |
| Ollama |
No. A separate process that can pull models from the internet. |
A sealed shield means the router cannot reach anything but this machine.
It does not mean the machine is sealed. For that you want a host firewall or
a network namespace with no default route; see
docs/ROADMAP.md §5.
Limits
- The router and VS Code must be on the same machine. Remote-SSH, WSL, dev
containers and browser-based editors are not supported: the side bar would
reach the wrong machine's loopback, and edits are not applied.
- One folder per window: the first local folder of the workspace.
- The on-prem model answers and proposes edits. It does not run commands or
tests.
- VS Code applies a strict content policy to webviews. If the side bar does
not paint, it shows a message with Open in browser after a few seconds.
The router and its guard are unaffected either way.
Install from a file
No build step. From this directory:
npx @vscode/vsce package # produces ai-paladin-0.4.0.vsix
code --install-extension ai-paladin-0.4.0.vsix
Or press F5 in this folder to launch an Extension Development
Host. node test/extension.test.js runs the edit-handling tests without an
editor.
Uninstalling
Removing this extension removes the side bar and the status-bar item. It
does not touch the Claude Code hook, which is a separate thing a person
installs. To remove AI-Paladin and the hook together, run
ai-paladin uninstall first (it lists and removes only the hook entries
AI-Paladin added, after asking), then pip uninstall ai-paladin. A plain
pip uninstall would leave the hook behind and make Claude Code refuse
every tool call. See the main README, "Uninstalling".
Settings
| Setting |
Default |
What it does |
aiPaladin.endpoint |
http://127.0.0.1:8722 |
Base URL of the router. It binds to loopback only; a remote host will not work. |
aiPaladin.command |
empty |
The command that starts the router, if it is not in the folder Install uses or on your PATH. --no-window is added. |
aiPaladin.installCommand |
empty |
What Install runs after you confirm. Empty means the virtual-environment install above. |
aiPaladin.pollSeconds |
2 |
Posture read interval while the router is up. Backs off to 10 s while it is down. |
aiPaladin.showWhenOffline |
true |
Keep the status-bar item visible when the router is not running. |
endpoint, command and installCommand are machine-level settings: a
project's .vscode/settings.json cannot set them, so opening someone's
repository cannot change what Install or Start run.
Commands
| Command |
Notes |
AI-Paladin: Get Started |
Opens the AI-Paladin Welcome tab: the four steps, with what is already done ticked. |
AI-Paladin: Open the VS Code Walkthrough |
The same steps on VS Code's built-in Welcome page. |
AI-Paladin: Install the Router |
Shows the command, asks, then runs it in a terminal. Never sudo. |
AI-Paladin: Start the Router |
Runs ai-paladin --no-window in a terminal. |
AI-Paladin: Set Up Ollama and Models |
Shows the router's setup page in the side bar. |
AI-Paladin: Open Chat |
Shows the side bar. Clicking the status-bar item does the same. |
AI-Paladin: Reload Chat |
Reloads the side bar, for example after starting the router. |
AI-Paladin: Open Console in a Panel |
The full console beside the editor. Edits are not applied from the panel. |
AI-Paladin: Open Console in Browser |
Opens it in the system browser instead. |