🛡️ CodeGuard AIAn autonomous AI agent for VS Code that reviews your project, fixes bugs, runs your tests to prove the fixes work, and tells you exactly what changed. Built for the Nebius x NVIDIA Global AI Hackathon (Coding & Agentic Engineering track) on NVIDIA Nemotron models served through Nebius Token Factory (any OpenAI-compatible endpoint works). ✨ What it does
Safety built in: originals are backed up to 🆕 What's new in this hackathon versionCodeGuard started as a single-pass Gemini reviewer. During the submission period it was significantly reworked:
🚀 Quick start
Settings (
|
| Setting | Default | Meaning |
|---|---|---|
codeguard.baseUrl |
https://integrate.api.nvidia.com/v1 |
OpenAI-compatible endpoint |
codeguard.model |
nvidia/nemotron-3-ultra-550b-a55b |
Model ID |
codeguard.deepModel |
(empty) | Stronger model used after repeated test failures |
codeguard.testCommand |
(auto) | e.g. npm test; auto-detected from package.json |
codeguard.requireApproval |
true |
Show a diff before each fix |
codeguard.maxTurns |
40 |
Agent turn limit |
codeguard.disableThinking |
true |
Faster tool calls (Nemotron chat-template flag) |
Using Nebius Token Factory
- Create an API key at https://tokenfactory.nebius.com (API keys → Create API key).
- Set
codeguard.baseUrltohttps://api.tokenfactory.nebius.com/v1/. - Set
codeguard.modelto the exact Nemotron model ID shown on the Token Factory models page. - Run
CodeGuard: Set API Keywith your Nebius key.
Tool calling must be supported by the chosen model on your provider. If a model rejects tool calls, pick another Nemotron model.
Optional: Tavily web search
Run CodeGuard: Set Tavily API Key. When set, the agent gets a web_search tool for library docs and error messages.
🧪 Demo
demo/buggy-app contains deliberate bugs (off-by-one, typos, wrong math, null crash, hardcoded secret, eval, React key/effect/XSS, missing alt text).
cd demo/buggy-app && npm test # 5 of 6 tests fail
Open demo/buggy-app in the Extension Development Host and run CodeGuard: Review Project → tests go from failing to passing, with a report.
🏗️ Architecture
src/
extension.js activation + key commands
commands/ "Review Project" command, progress UI, report
agents/reviewAgent.js agent loop (tool calling, verify & retry, escalation)
tools/ list_files, read_file, write_file, run_tests, web_search
ui/diffApproval.js diff + apply/skip prompt
utils/ path safety, backups, report builder
prompts/systemPrompt.js agent instructions
test/agent.test.js offline tests with a fake model server
✅ Tests
npm test
Runs the agent against a fake OpenAI-compatible server (no key or network needed).
⚠️ Known limitations
- Review quality depends on the model; always read the diffs.
npm testfor projects with dependencies requiresnpm installfirst.- Files over 200 KB are skipped; very large projects may need several runs.
- Do not send confidential code to free public endpoints; the NVIDIA trial endpoint logs usage.
🤝 Feedback
Issues and ideas welcome on GitHub.
📄 License
MIT — see LICENSE.