Inspiration
Modern developers increasingly rely on AI coding assistants to generate and modify code. But generating code is only one part of the development process — developers still need to understand whether the generated changes are actually correct, safe, and testable.
We wanted to explore a simple question:
What if an AI coding assistant didn't stop after generating a fix, but could also verify that the fix actually worked?
That idea led us to build CodeGuard, an AI-powered autonomous coding agent that works directly inside VS Code.
Instead of following the traditional "ask → generate → done" workflow, CodeGuard follows a verification-oriented loop:
Analyze → Detect → Fix → Test → Verify
The goal is not simply to generate more code, but to help developers make changes with greater confidence.
What We Built
CodeGuard is a VS Code extension that can analyze a project, identify relevant issues, reason about potential fixes, and interact with the project through an agentic workflow.
When CodeGuard finds an issue, it can:
- Analyze the project and relevant files.
- Identify bugs, runtime problems, and common security issues.
- Reason about a potential solution.
- Generate a proposed code change.
- Show the developer the change before applying it.
- Apply the approved fix.
- Run the project's tests.
- Continue investigating when verification fails, within configured agent limits.
- Provide a summary of what was changed and verified.
This makes CodeGuard more than a static AI code reviewer — it is an AI-assisted development loop with verification built into the workflow.
How We Built It
CodeGuard was built as a VS Code extension using the VS Code Extension API and JavaScript.
The AI reasoning layer uses an OpenAI-compatible API interface, allowing CodeGuard to work with NVIDIA Nemotron through the Nebius Token Factory.
The architecture is intentionally split into two responsibilities:
- AI model: reasoning, understanding the code, identifying issues, and proposing fixes.
- CodeGuard agent: project context, tool execution, file changes, developer approval, test execution, and verification.
This separation allows the model to act as the reasoning engine while CodeGuard controls the actual development workflow.
We also use VS Code's SecretStorage mechanism for API-key handling rather than requiring credentials to be hard-coded into the project.
Challenges
One of the biggest challenges was moving from a simple AI code-review workflow to an agentic workflow.
A basic implementation can ask an LLM to inspect a file and return suggestions. However, a real coding agent has to deal with much more:
- Understanding which files are relevant.
- Maintaining context across multiple steps.
- Deciding when a fix should be proposed.
- Safely modifying project files.
- Giving the developer control over changes.
- Executing tests after modifications.
- Handling failed verification.
- Preventing the agent from endlessly modifying the project.
Another challenge was designing the system so that the AI does not have unrestricted control over the developer's codebase. This led us to introduce approval before applying fixes and configurable limits on agent iterations.
We also had to work through the practical challenges of packaging and publishing a VS Code extension, including VSIX packaging, Marketplace requirements, extension metadata, and deployment.
What We Learned
Building CodeGuard taught us that building an AI agent is very different from simply integrating an LLM API.
The model itself is only one component.
The real engineering challenge is building the system around the model — providing context, defining tools, controlling execution, handling failures, and creating a reliable feedback loop.
We also learned how important verification is for AI-generated code. A generated solution can look reasonable while still failing tests or introducing another issue.
That changed our approach from:
"Can the AI generate a solution?"
to:
"Can the system generate a solution and provide evidence that it works?"
What's Next
CodeGuard is currently available as a VS Code extension, and we plan to continue improving the agent's reliability, project understanding, test-driven verification, and security analysis.
Our long-term vision is to make AI coding agents more verification-first — helping developers move from AI-generated code toward AI-assisted, tested, and accountable software development.
CodeGuard — Analyze. Detect. Fix. Test. Verify.
Built With
- api
- automation
- developer
- express.js
- gen-ai
- git
- github
- javascript
- llm
- node.js
- nvideapi
- react
Log in or sign up for Devpost to join the conversation.