8000
Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EdgeGuard πŸ›‘οΈ

EdgeGuard Logo
Don't just review your code. Try to break it.
AI-powered edge-case investigation and verification agent for developers.

License Version 0.6.0 Architecture


EdgeGuard Workflow Demo


1. What is EdgeGuard?

EdgeGuard is an AI investigation agent built as a VS Code extension. Unlike general-purpose chatbots and code review assistants that offer vague suggestions, EdgeGuard operates on a single rigorous premise:

"Try to break this code before production does."

EdgeGuard extracts deep structural and semantic context from your methods, screens for risk characteristics, models execution paths, synthesizes concrete counterexample data, generates runnable verification proof tests, and proposes defensive fixes with interactive diff inspection.

Reasoning ───> Evidence ───> Counterexample ───> Verification ───> Confirmation

2. Installation & Quick Start

Since EdgeGuard is currently in active development, you can install it manually via the .vsix package included in this repository.

πŸ“₯ Download EdgeGuard-0.6.0.vsix

How to install in VS Code:

  1. Click the download link above and hit the Download icon on GitHub to save the .vsix file.
  2. Open VS Code and navigate to the Extensions view (Ctrl+Shift+X on Windows/Linux, Cmd+Shift+X on Mac).
  3. Click the ... (Views and More Actions) icon at the top right of the Extensions panel.
  4. Select "Install from VSIX..." from the dropdown menu.
  5. Locate and select the downloaded EdgeGuard-0.6.0.vsix file.
  6. Reload VS Code if prompted, and you are ready to hunt bugs!

3. Current Status

EdgeGuard is an actively developed open-source project.

Current support

  • C# / .NET
  • Java
  • TypeScript / JavaScript

The current release focuses on:

  • Deterministic static risk screening
  • Security taint analysis
  • AI-assisted edge-case investigation
  • Counterexample synthesis
  • Executable verification proof tests
  • Defensive fix suggestions with interactive diffs

EdgeGuard is designed to distinguish evidence from assumptions. False positives and incomplete data-flow paths are possible, especially when analyzing complex or externally dependent code.

When automatic proof cannot be established, findings are classified as LIKELY BUG or INCONCLUSIVE rather than being presented as confirmed defects.


4. Core Philosophy & Evidentiary Standards

EdgeGuard strictly separates facts from assumptions:

  • Evidence-Based Verdicts:

    • πŸ”΄ CONFIRMED BUG β€” Proven via automated verification test execution that reproduces the expected defect.
    • 🟠 LIKELY BUG β€” High-confidence risk supported by code evidence, concrete counterexample data, or deterministic taint data-flow trace.
    • 🟑 INCONCLUSIVE β€” Potential risk flagged, but unverified due to external dependencies or incomplete context.
    • 🟒 SAFE β€” Method analyzed across boundary conditions with no defects discovered.
  • Fail-Safe Dual-Engine Protection: Deterministic Security Taint Analysis & Static Edge-Case Heuristics execute alongside deep LLM reasoning. Even during network timeouts or when an LLM returns a false SAFE, critical vulnerability patterns remain detectable through deterministic analysis.

  • Zero Unsolicited Code Changes: EdgeGuard never mutates your code silently. Fixes are previewed via side-by-side diffs and require explicit developer confirmation.


5. Four Verification Scopes

EdgeGuard provides four distinct verification scopes to match your workflow:

[ πŸ›‘ EdgeGuard ] (Inline CodeLens) ──> Verify Function
Command Palette / Sidebar UI       ──> Verify File | Verify Module | Verify Project
  1. Verify Function (Inline CodeLens & Command):

    • Click the [ πŸ›‘ EdgeGuard ] CodeLens directly above any method in Java, TypeScript, JavaScript, or C# to verify that specific function immediately.
  2. Verify File:

    • Discovers and analyzes all functions defined within the active editor file.
  3. Verify Module:

    • Detects project and module boundaries automatically (pom.xml / build.gradle for Java, .csproj for C#, package.json / tsconfig.json for TypeScript/JavaScript) and screens all enclosed source files.
  4. Verify Project:

    • Scans and screens all supported source files across the entire workspace.

6. Decoupled Polyglot Architecture

To eliminate cross-language interference and prompt regressions, each language is fully isolated into its own self-contained module:

src/languages/
β”œβ”€β”€ types.ts                      # Common LanguageModule contract
β”œβ”€β”€ moduleRegistry.ts             # LanguageModuleRegistry (Resolves Java / C# / TS)
β”œβ”€β”€ java/                         # Dedicated Java Subsystem (Spring, Servlet, JDBC)
β”œβ”€β”€ csharp/                       # Dedicated C# Subsystem (ASP.NET Core, EF Core, LINQ)
└── typescript/                   # Dedicated TypeScript Subsystem (Express, Node, Prisma)
Language AST & Context Parser Failure Modes & Security Vulnerabilities Verification Tests
Java JavaParser & JavaContextProvider SQL Injection (JDBC, Statement.execute), Command Injection, Path Traversal, NullPointerException (items[0]), Collectors.toMap duplicate keys, SQL LIKE wildcards. JUnit 5
C# (.NET) CSharpParser & CSharpContextProvider SQL Injection (FromSqlRaw, SqlCommand), XPath Injection (SelectSingleNode), Command Injection, Path Traversal, LINQ multiple enumeration, ToDictionary duplicate keys, .Result deadlocks. xUnit (.NET)
TypeScript / JS TypeScriptParser & TypeScriptContextProvider Template-literal SQL Injection (db.query), Command Injection (child_process.exec), Path Traversal, XSS, unhandled JSON.parse, missing await, unsafe array mutations (sort()). Mocha / Assert

7. Scalable Verification & Static Risk Screening

When verifying large modules or entire projects with hundreds of functions, individual LLM calls for every function do not scale. EdgeGuard employs an ultra-fast, local Static Risk Screening stage prior to deep investigation.

In local benchmarks, the screening stage can process 150+ functions in under 20ms with 0 LLM cost.

Discover Functions (e.g. 167 functions)
        ↓
Static Risk Screening (Local AST & Heuristics, < 20ms)
        ↓
Prioritization:
  β€’ 23 HIGH PRIORITY
  β€’ 51 MEDIUM PRIORITY
  β€’ 93 LOW PRIORITY
        ↓
Developer Choice:
  [ Investigate High Priority (23 functions) ]  (Default)
  [ Investigate All Functions (167 functions) ]
        ↓
Fail-Safe Dual Analysis Pipeline (Taint + Heuristics + LLM)
        ↓
Verification Proof Test & Defensive Patching

8. Project Structure

src/
β”œβ”€β”€ ui/
β”‚   β”œβ”€β”€ codeLensProvider.ts      # Inline [ πŸ›‘ EdgeGuard ] CodeLens
β”‚   └── findingsViewProvider.ts  # Webview sidebar panel (Vietnamese UI)
β”œβ”€β”€ verification/
β”‚   β”œβ”€β”€ targetResolver.ts        # Scope target resolver (Function, File, Module, Project)
β”‚   β”œβ”€β”€ scopeManager.ts          # Unified execution manager (batching, prioritization, progress)
β”‚   β”œβ”€β”€ testGenerator.ts         # Multi-language verification proof test generator
β”‚   └── testRunner.ts            # Test execution runner and verdict promoter
β”œβ”€β”€ analysis/
β”‚   β”œβ”€β”€ analysisEngine.ts        # Fail-safe analysis coordinator
β”‚   β”œβ”€β”€ riskScreener.ts          # Static risk screener and priority classifier
β”‚   └── taint/                   # Deterministic Security Taint Analysis Engine
β”‚       β”œβ”€β”€ securityTaintAnalyzer.ts
β”‚       └── adapters/            # Language-specific taint adapters (Java, C#, TS)
β”œβ”€β”€ languages/                   # Decoupled polyglot language modules
β”‚   β”œβ”€β”€ java/                    # Java prompt, rules, tests, and fixes
β”‚   β”œβ”€β”€ csharp/                  # C# prompt, rules, tests, and fixes
β”‚   └── typescript/              # TypeScript prompt, rules, tests, and fixes
β”œβ”€β”€ context/
β”‚   β”œβ”€β”€ contextRegistry.ts       # Context provider dispatcher
β”‚   β”œβ”€β”€ javaContextProvider.ts   # Java context & AST parser
β”‚   β”œβ”€β”€ csharpContextProvider.ts # C# context & AST parser
β”‚   └── typeScriptContextProvider.ts # TypeScript context & AST parser
β”œβ”€β”€ providers/llm/
β”‚   β”œβ”€β”€ modelRegistry.ts         # Model catalog, pre-flight validation & discovery
β”‚   β”œβ”€β”€ geminiClient.ts          # Google Gemini API client
β”‚   β”œβ”€β”€ anthropicClient.ts       # Anthropic Claude API client
β”‚   β”œβ”€β”€ openaiClient.ts          # OpenAI & compatible endpoint client
β”‚   └── openrouterClient.ts      # OpenRouter multi-model client
β”œβ”€β”€ fixes/
β”‚   β”œβ”€β”€ fixAdvisor.ts             # Defensive patch advisor
β”‚   └── diffViewer.ts             # Side-by-side diff provider
└── storage/
    β”œβ”€β”€ secretStorage.ts          # Encrypted API key storage
    └── cacheManager.ts           # Document-change aware analysis cache

9. Verified Benchmarks & Test Targets

EdgeGuard is continuously tested against industry-standard vulnerable applications and large-scale architectures to evaluate detection quality, real-world behavior, and stability during static screening.

You can clone these repositories and test EdgeGuard yourself:

  • TypeScript / Node.js: OWASP/Juice Shop β€” Successfully screened 1,100+ functions, identifying critical PATH_TRAVERSAL (CWE-22) and injection-related findings without overwhelming the LLM.

  • C# / .NET: dotnet-architecture/eShopOnWeb β€” Tested against an enterprise-style architecture, with local static risk screening completing in under 20ms in benchmark runs and identifying Data Access and API surface risks.

  • Java: OWASP/Benchmark β€” Tested against complex taint flows, nested helper classes, raw JDBC SQL, and Command Injection patterns.

These projects are provided as practical test targets so developers can independently evaluate EdgeGuard against real-world and security-focused codebases.


10. License

MIT License. See LICENSE.txt for details.

About

AI-powered edge-case investigation and verification agent for developers. Try to break your code before production does.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0