🛡️ DeFiGuard-AI Submission Details

Inspiration

The rapid rise of decentralized finance (DeFi) has unlocked unprecedented global financial freedom, but it has simultaneously introduced catastrophic smart contract vulnerabilities. Billions of dollars continue to vanish due to subtle logic flaws, unhandled reentrancy vectors, and malicious access controls. Existing security auditing tools are often too slow, highly expensive, or completely automated without intelligent contextual reasoning. The inspiration behind DeFiGuard-AI was to build an elite, autonomous virtual security auditor that bridges deep code-reasoning using Google Gemini with real-time historical threat intelligence from Elasticsearch, ensuring every developer can secure their smart contracts instantly before deployment.


What it does

DeFiGuard-AI is an autonomous multi-agent security intelligence platform engineered to inspect, reason about, and suggest patches for smart contracts. Powered by Google's Agent Development Kit (ADK) and Gemini 3.5, the agent dynamically evaluates control flows and exploit vectors rather than relying on rigid, hardcoded rules. It features hybrid threat retrieval matching code against known historical exploit signatures stored in Elasticsearch, persists complete audit trails to Google Cloud Firestore, provides a high-performance FastAPI backend, and delivers an immersive cyber-themed interactive dashboard via Streamlit.


How we built it

The platform was engineered with a modular, cloud-native architecture:

  • Agent Runtime & Orchestration: Built using the Google Agent Development Kit (google-adk) and Gemini 3.5, allowing the autonomous agent to dynamically decide when to invoke threat retrieval tools versus reasoning directly over smart contract source code.
  • Backend Infrastructure: Developed using FastAPI and Uvicorn with robust input validation, scoped CORS middleware, and safe exception handling.
  • Data Layer & Retrieval: Integrated Elasticsearch for high-speed BM25 pattern-matching of historical threat signatures and Google Cloud Firestore to persist scan histories.
  • Frontend Dashboard: Designed an interactive, real-time user interface utilizing Streamlit connected to live backend endpoints.
  • Cloud Infrastructure: Containerized the entire application via Docker with fully configured deployment pathways for Google Cloud Run.

Challenges we ran into

Developing a multi-agent AI system entirely from a smartphone presented immense constraints, particularly around local terminal execution, package dependency troubleshooting, and managing complex multi-file project structures without a physical computer. Additionally, configuring the Agent Development Kit (ADK) lifecycle to cleanly balance autonomous tool-calling loops with FastAPI endpoints required rigorous state management and exception tuning to ensure zero internal error leakage to the client interface.


Accomplishments that we're proud of

  • Successfully orchestrating Google Gemini 3.5 via Google ADK to build a genuinely autonomous agent that evaluates contracts contextually rather than running a simple static script.
  • Architecting a production-ready, enterprise-grade directory structure and writing an exceptionally professional documentation set that articulates clear technical depth, architecture design, and deployment readiness.
  • Overcoming severe mobile development limitations to write, organize, and submit a complete, high-impact hackathon project from scratch.

What we learned

Building DeFiGuard-AI deepened our mastery of modern agentic workflows, highlighting how framework-driven agent runtimes (like Google ADK) dramatically outperform traditional rigid pipelines by giving LLMs the autonomy to choose when to fetch external data. We also gained invaluable insight into structuring robust microservice architectures involving asynchronous database persistence, containerization, and secure cloud API routing.


What's next for DeFiGuard-AI

  • Automated Patch Generation: Expanding the agent capabilities to not just detect vulnerabilities, but automatically write and verify gas-optimized secure code patches.
  • Multi-Chain Support: Integrating real-time bytecode and source code ingestion directly from Ethereum, Arbitrum, Optimism, and Solana block explorers.
  • CI/CD Pipeline Integration: Developing official GitHub Actions and GitLab CI plugins so DeFiGuard-AI can automatically audit pull requests on every code commit.

Built With

  • docker
  • elasticsearch
  • fastapi
  • google-agent-development-kit
  • google-cloud-firestore
  • google-gemini
  • streamlit
Share this project:

Updates

Submission history