API Guardian

Stop API Breakages Before They Break Your Code — Detect, Fix, and Ship with Confidence.

Inspiration

Modern applications depend on third-party APIs for payments, authentication, data storage, and external integrations. However, even a small change to an external service can break an otherwise functioning application.

Developers often have to manually search through codebases, investigate API changes, understand updated documentation, and implement fixes across multiple integrations. As applications grow, maintaining compatibility with external APIs becomes increasingly time-consuming.

We wanted to build a tool that goes beyond simply detecting potential issues and actively assists developers in repairing them. This inspired us to create API Guardian, an AI-powered platform that combines API discovery, intelligent repair suggestions, validation, and GitHub integration while keeping developers in control of the final changes.

What It Does

API Guardian is an AI-powered developer tool that identifies potential API compatibility issues in GitHub repositories and generates suggested code repairs.

Developers provide a GitHub repository URL, and API Guardian analyzes the source code to discover API-related usage and investigate potential compatibility problems.

When a potential issue is identified, an AI agent analyzes the affected code and generates a proposed modification. Developers can inspect the changes, review the generated diff, and approve the proposed migration before it is published to GitHub.

Our workflow includes:

  • Repository Analysis: Retrieves a GitHub repository and scans its source code for API integrations.
  • API Discovery: Identifies API-related code patterns and HTTP library usage.
  • AI-Assisted Repair: Generates proposed code modifications for potential compatibility issues.
  • Validation and Retry: Validates proposed changes and supports repair retries.
  • Developer-Controlled Migration: Creates a dedicated migration branch and supports publishing approved changes through GitHub pull requests.
  • Post-Repair Auditing: Provides options to re-audit the published migration branch and recheck the main branch.

Our goal is to make API maintenance proactive rather than reactive, helping developers spend less time investigating broken integrations and more time building software.

How We Built It

API Guardian consists of four primary components.

1. Frontend

We used HTML, CSS, and JavaScript to build an interactive dashboard where users can submit GitHub repository URLs, explore detected API integrations, view potential compatibility issues, and review proposed code changes.

2. Backend

We used Python and FastAPI to handle frontend requests, retrieve and clone GitHub repositories into temporary workspaces, scan source code, and coordinate analysis, repair generation, and validation.

The frontend communicates with the backend through HTTP requests.

3. AI Agent

We integrated Ollama to run language models locally. We initially experimented with Qwen2.5:7b before transitioning to Gemma3:4b.

The AI agent analyzes potential compatibility issues and generates suggested modifications to affected code.

4. GitHub Integration and Validation

We integrated GitHub operations to support repository access, code diffs, commits, migration branches, and pull requests.

After developer approval, API Guardian commits and pushes the proposed changes to a dedicated API Migration branch and opens a pull request against the original repository. Users can then re-audit the published branch or recheck the main branch.

We also implemented isolated repository workspaces, code-level validation, automated repair retries, and tests for repository operations and repair orchestration.

Database: API Guardian currently does not require a traditional database. GitHub serves as the source of repository code, while temporary local workspaces are used for analysis and testing.

Together, these components create an end-to-end workflow that connects repository analysis, AI-generated repairs, validation, and developer-controlled GitHub integration.

Challenges We Ran Into

One of our biggest challenges was discovering that detecting an API call and verifying an API compatibility issue are two very different problems.

Identifying API Calls Across Different Codebases

Applications often use helper functions, SDKs, variables, and dynamically constructed URLs rather than direct HTTP requests. We implemented pattern-based API detection and tested it across different projects to better understand these variations.

Verifying Actual API Compatibility Issues

Detecting an API integration does not necessarily mean it is outdated or broken. Reliable verification requires accurate API documentation, version information, and endpoint specifications. We recognized that distinguishing potential issues from confirmed compatibility problems is essential.

Generating Accurate AI Repairs

During testing, we encountered cases where the AI generated syntactically valid modifications that did not resolve the underlying API issue. We experimented with local language models, moving from Qwen2.5:7b to Gemma3:4b, and implemented validation and retry mechanisms to improve the repair workflow.

Safely Modifying GitHub Repositories

Automatically modifying source code can introduce unintended changes. We addressed this by using temporary repository workspaces, isolated code modifications, and developer approval before publishing changes.

These challenges reinforced the importance of combining AI-generated code with reliable evidence, meaningful validation, and human oversight.

Accomplishments That We're Proud Of

Throughout the hackathon, we built a working foundation for an AI-assisted API maintenance platform.

Our major accomplishments include:

  • Developed an interactive web application connecting an HTML, CSS, and JavaScript frontend to a FastAPI backend.
  • Implemented GitHub repository integration to retrieve and analyze source code.
  • Built an API discovery system capable of recognizing HTTP libraries and API-related code patterns.
  • Integrated Ollama to run local language models, experimenting with Qwen2.5:7b before transitioning to Gemma3:4b.
  • Developed an AI-assisted repair workflow that generates proposed code modifications.
  • Implemented automated repair retries and code-level validation.
  • Built isolated repository workspaces to prevent unintended modifications to original repositories.
  • Implemented GitHub migration workflows supporting code diffs, commits, dedicated branches, and pull requests.
  • Added options to audit the published migration branch and recheck the main branch after changes have been applied.
  • Added automated tests for repository operations, repair orchestration, and validation.
  • Tested API Guardian against multiple projects, including applications integrating with the Notion and Figma APIs.

Our biggest accomplishment was connecting repository analysis, AI-generated code modifications, validation, and GitHub review preparation into a single workflow.

We also gained practical experience working with local language models, GitHub automation, asynchronous backend operations, and the challenges of validating AI-generated code.

What We Learned

We learned that identifying API usage is fundamentally different from confirming a compatibility issue. Reliable API maintenance requires understanding the affected code, verifying changes against trustworthy API information, and ensuring that proposed repairs actually resolve the problem.

We also gained practical experience integrating local language models with FastAPI, automating GitHub workflows, managing isolated repository workspaces, and validating AI-generated code.

Most importantly, we learned that successful AI-assisted development requires more than generating code. It requires evidence, validation, testing, and meaningful human oversight.

What's Next for API Guardian

Our next steps focus on improving API detection accuracy, repair reliability, and support for more real-world projects.

  1. Improve API Discovery: Introduce more advanced source-code analysis to identify API calls through helper functions, SDKs, variables, and dynamically constructed endpoints.

  2. Integrate API Documentation and Specifications: Use trusted API documentation, OpenAPI specifications, and provider changelogs to verify whether detected API usage is outdated or incompatible.

  3. Improve AI Repair Accuracy: Provide Gemma3:4b with more precise information about compatibility issues and strengthen validation to ensure generated patches actually resolve the detected problems.

  4. Expand API and Programming Language Support: Extend API Guardian to analyze more third-party services, SDKs, and programming languages.

  5. Introduce Continuous API Monitoring: Monitor repositories and provider updates to detect newly announced breaking changes and prepare migration suggestions automatically.

  6. Improve Automated Testing: Add stronger API contract tests and regression checks to distinguish syntactically valid code changes from genuinely successful API migrations.

  7. Develop a Real-Time Developer Extension: Explore integrating API Guardian into developers' coding environments to identify potential API compatibility issues and suggest repairs as they write code, reducing the need to manually submit repository URLs for analysis.

Our long-term vision is to transform API Guardian from a repository analysis and AI-assisted repair prototype into a proactive API maintenance platform. By combining reliable compatibility verification, AI-generated migrations, automated testing, and developer-controlled GitHub integration, we aim to reduce the effort required to maintain third-party APIs and help developers focus more on building software than fixing unexpected integration failures.

Github Link: https://github.com/DevanshuSurana/API-Guardian.git

Built With

  • ai
  • api-integration
  • automated-code-repair
  • automated-testing
  • backend-development
  • code-analysis
  • code-generation
  • code-validation
  • css
  • developer-tools
  • fastapi
  • frontend-development
  • gemma-3
  • git
  • github-api
  • github-automation
  • html
  • javascript
  • llms
  • ollama
  • pull-requests
  • python
  • qwen2.5
  • rest-apis
  • web-development
+ 9 more
Share this project:

Updates

Submission history