Inspiration
The increasing adoption of smart contracts across various blockchain ecosystems presents significant security challenges. Vulnerabilities in smart contracts can lead to financial losses, reputational damage, and disruptions in decentralized applications (dApps). Near AI rAIxon Sheriff Agent was developed to proactively identify and mitigate these risks, ensuring a secure and resilient blockchain infrastructure.
The core idea emerged from an in-depth analysis of the Near ecosystem. The automation of analysis and comparison of vast amounts of data, including real-time processing, has become possible thanks to the advancement of neural network agents.
Throughout the history of decentralized networks, the primary focus has been on security and transaction reliability. Various coding errors and blockchain protocol vulnerabilities have led, continue to lead, and will likely cause massive financial losses in the future. Some notable incidents include:
- 2016 – The DAO Hack, losses of $60M+
- 2022 – Ronin Bridge Hack, losses of $625M
- 2022 – Nomad Bridge Hack, losses of $190M
- 2025 – Bybit crypto exchange wallets drained of $1.4B+ in ETH
Timely analysis and intervention can help prevent hacker transactions. For instance:
- 2022 – An attack on the Rainbow Bridge (Near ↔ Ethereum bridge) was automatically neutralized within 31 seconds by the built-in protection system.
It is evident that proactive vulnerability detection within blockchain ecosystems and real-time transaction/code analysis can significantly reduce the risks of malicious attacks on the blockchain and its infrastructure.
What It Does
The rAIxon Sheriff Agent is designed to analyze smart contract code and detect vulnerabilities within the Near AI ecosystem and other blockchain networks. It cross-references detected vulnerabilities with established security knowledge bases, such as Amazon Berock, Amazon OpenSearch, and the Vector Store of the Near AI platform. Utilizing advanced AI models and real- time data retrieval, the agent provides a comprehensive security assessment of smart contracts.
How We Built It
The agent is powered by Near AI Agents and integrates with multiple knowledge bases and vector storage systems to efficiently retrieve and analyze security-related data. We implemented the Retrieval-Augmented Generation (RAG) pattern to enhance the agent’s ability to process vast amounts of security intelligence. The vulnerability knowledge base was built using sources such as:
- CVE (Common Vulnerabilities and Exposures)
- CISA KEV (Known Exploited Vulnerabilities Catalog)
- EPSS (Exploit Prediction Scoring System)
- BCCC (Blockchain Cybersecurity Center)
Additionally, the agent utilizes publicly available datasets and research for comprehensive security assessment, including:
Challenges We Ran Into
- Ensuring reliable datasets for creating vector knowledge storage, allowing Near AI Agent to verify user-provided code.
- Matching vulnerabilities with sample code that contains security flaws.
- Integrating multiple data sources while maintaining low-latency responses required optimizing data processing pipelines.
- Addressing compatibility issues between different technology stacks and package versions to ensure a seamless development and deployment process.
- Integrating the Near AI Agent with various vector databases to ensure scalability, fast data retrieval, and cost-effectiveness.
Accomplishments That We're Proud Of
- Successful integration of Near AI Agents with large security knowledge bases.
- Implementation of a RAG-based knowledge retrieval system for more accurate vulnerability assessments.
- Ongoing efforts to integrate the Near AI Agent with vector and graph databases, including AWS OpenSearch, Amazon Bedrock, serverless Amazon Lambda, ArangoGraph, and Pinecone.
What We Learned
Through this project, we deepened our understanding of:
- The evolving landscape of smart contract vulnerabilities and best security practices.
- The importance of AI models with augmented retrieval for enhancing cybersecurity solutions.
- Optimizing security data search and retrieval from large repositories for fast and efficient analysis.
What's Next for Near AI rAIxon Sheriff Agent
Moving forward, we aim to implement:
- Blockchain Scanner for NEAR.AI
- AI-based Code and Transaction Analytics
- Decentralized Repository of Secure Agents
Future Functionalities
- Transaction Monitoring – Analyzing all cross-chain operations and tracking suspicious fund movements.
- Agent Code Auditing – Automated security scans for agent smart contracts to detect vulnerabilities and backdoors.
- Malicious Agent Detection – Identifying anomalous behaviors such as frequent address changes or sudden algorithmic shifts.
- Phishing Attack Detection – Spotting agents that request excessive permissions from users.
- Automated Blacklisting – Creating a database of untrustworthy agents and notifying users of associated risks.
- Decentralization Verification – Detecting agents operating in a centralized manner that could become a single point of failure.
- Cross-Chain Interaction Analysis – Identifying vulnerable cross-chain bridges and weak integration points.
By continuously enhancing the Near AI rAIxon Sheriff, we aim to strengthen blockchain security, ensure trust, and safeguard decentralized applications.
Built With
- amazon-web-services
- amazonbedrock
- amazonlammbda
- cdk
- cloudformation
- fastapi
- opensearch
- sam
Log in or sign up for Devpost to join the conversation.