The base layer for our future, impenetrable universal undercore.
A self-organizing, multi-agent security framework designed to be resilient, modular, and self-improving while operating within the constraints of the Core Directive.
Prime Security implements principles from autonomic computing, multi-agent AI systems, and self-organizing systems to create a security framework that can:
- Self-configure: Adapt to new environments and requirements
- Self-heal: Detect and recover from failures automatically
- Self-optimize: Improve performance over time
- Self-protect: Defend against threats and maintain integrity
All while operating within the immutable boundaries defined by the Core Directive.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Core Directive Layer β
β (Immutable principles governing all behavior) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββΌββββββββββββββββββββββ
β β β
βββββββββΌβββββββββ ββββββββββΌβββββββββ βββββββββΌβββββββββ
β Multi-Agent β β Self-Building β β Security β
β Coordination βββββ€ & Repair ββββΊβ Services β
ββββββββββββββββββ βββββββββββββββββββ ββββββββββββββββββ
See Architecture Documentation for details.
npm install prime-securityimport { primeSecurity, crypto, auditLogger } from 'prime-security';
// Initialize the system
await primeSecurity.initialize();
await primeSecurity.start();
// Use security primitives
const hashed = crypto.hash('sensitive data');
const random = crypto.generateSecureRandom(32);
// System automatically logs to audit trail
console.log(auditLogger.count()); // View audit events
// Graceful shutdown
await primeSecurity.stop();import { registry, Module } from 'prime-security';
const myModule: Module = {
name: 'custom-module',
version: '1.0.0',
dependencies: ['core-security'],
init: async () => {
console.log('Initializing custom module');
},
start: async () => {
console.log('Custom module started');
},
stop: async () => {
console.log('Custom module stopped');
}
};
registry.register(myModule);The system's architecture is represented as a "blueprint" (Digital DNA) that can reconstruct and extend the system:
import { DNAManager } from 'prime-security';
const dna = DNAManager.createMinimal();
console.log(dna.modules); // See registered modulesDynamic plugin system with lifecycle management:
- Init: Prepare resources
- Start: Begin operation
- Stop: Graceful shutdown
- Destroy: Cleanup
All critical operations are logged for compliance:
import { auditLogger, AuditLevel } from 'prime-security';
auditLogger.log(
AuditLevel.INFO,
'my-component',
'user-login',
{ userId: '123', ip: '192.168.1.1' }
);
// Query audit trail
const recent = auditLogger.query({
component: 'my-component',
since: new Date(Date.now() - 3600000),
limit: 100
});Verify Core Directive adherence:
import { complianceChecker } from 'prime-security';
const isCompliant = await complianceChecker.isCompliant();
const results = await complianceChecker.runAll();git clone https://github.com/dshvvvshr/Prime-security.git
cd Prime-security
npm installnpm run buildnpm test # Run tests
npm run test:coverage # With coverage
npm run test:watch # Watch modenpm run lint # Check code
npm run lint:fix # Fix issues
npm run format # Format with Prettier- Core Directive - Foundational principles (required reading)
- Architecture - System design and components
- Research Foundations - Theoretical background and tools
- Contributing Guide - How to contribute
- License - MIT License
Security is not a featureβit's the foundation. This project implements:
- Defense in depth: Multiple security layers
- Zero trust: Verify all requests
- Encryption: AES-256-GCM for data, TLS 1.3 for transport
- Input validation: All inputs sanitized and validated
- Audit logging: Immutable audit trail
- Compliance checks: Automated Core Directive verification
Report vulnerabilities privately to project maintainers.
- β Cryptographic primitives (AES, SHA, HMAC, PBKDF2)
- β Input validation and sanitization
- β Module registry with dependency resolution
- β Audit logging and compliance checking
- β Self-healing and autonomic capabilities (in progress)
- β Multi-agent coordination framework (planned)
- β Content access layer (planned)
- β Distributed deployment support (future)
- Core security primitives
- Module registry system
- Basic governance and compliance
- Digital DNA blueprint
- Audit logging
- GitHub Actions CI/CD
- LangChain/LangGraph integration
- Advanced self-healing mechanisms
- Content access layer implementation
- Comprehensive monitoring and metrics
- Additional compliance checks
- P2P capabilities
- Edge deployment support
- Decentralized governance
- Blockchain integration
- Neural cellular automata patterns
- Quantum-augmented security
- Neuromorphic computing integration
- Advanced AI governance mesh
We welcome contributions! Please read:
- Core Directive - Understand the principles
- Contributing Guide - Follow the process
- Architecture - Learn the design
All contributions must align with the Core Directive.
This project is licensed under the MIT License - see LICENSE file for details.
Inspired by:
- IBM's Autonomic Computing
- Multi-agent AI frameworks (LangChain, AutoGen, Agora)
- Self-organizing systems and cybernetics
- Modular robotics and robot metabolism
- Neural cellular automata
Built with β€οΈ for a secure, self-organizing future.
A Model Context Protocol (MCP) server implementation for Brave Search API. This server enables AI applications and agents to perform privacy-focused web searches through the standardized MCP interface.
- Web Search: General web search with rich filtering and pagination
- Local Search: Find local businesses and services
- Image Search: Search for images with metadata
- Video Search: Search for video content
- News Search: Search for recent news articles
- Summarizer: Get AI-generated summaries for search queries
- Node.js 18 or higher
- A Brave Search API key (get one at https://brave.com/search/api/)
- Clone the repository:
git clone https://github.com/dshvvvshr/Prime-security.git
cd Prime-security- Install dependencies:
npm install- Create a
.envfile based on.env.example:
cp .env.example .env- Add your Brave Search API key to
.env:
BRAVE_API_KEY=your_api_key_here
- Build the project:
npm run buildStart the MCP server in STDIO mode (default):
npm startOr use the development mode with auto-reload:
npm run devSearch the web using Brave Search.
Parameters:
q(required): Search querycountry(optional): Country code (e.g., "US", "GB")search_lang(optional): Search language (e.g., "en", "es")count(optional): Number of results (1-20)offset(optional): Pagination offsetsafesearch(optional): Safe search level ("off", "moderate", "strict")freshness(optional): Time filter ("pd" = past day, "pw" = past week, "pm" = past month, "py" = past year)
Search for local businesses and places.
Parameters:
q(required): Search querycount(optional): Number of results (1-20)
Search for images.
Parameters:
q(required): Search querycount(optional): Number of results (1-150)safesearch(optional): Safe search level
Search for videos.
Parameters:
q(required): Search querycount(optional): Number of results (1-20)safesearch(optional): Safe search level
Search for news articles.
Parameters:
q(required): Search querycount(optional): Number of results (1-20)freshness(optional): Time filter
Get AI-generated summaries.
Parameters:
key(required): Summarizer key or search queryentity_info(optional): Include entity information
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"brave-search": {
"command": "node",
"args": ["/path/to/Prime-security/dist/index.js"],
"env": {
"BRAVE_API_KEY": "your_api_key_here"
}
}
}
}This server uses STDIO transport and can be integrated with any MCP-compatible client. Refer to your client's documentation for specific integration instructions.
Brave Search API has the following rate limits:
- Free Tier: 1 request/second, 2,000 queries/month
- Base Tier: Higher limits available
- Pro/Enterprise: Custom limits
This implementation uses Brave Search, which is privacy-focused and does not track users or build search profiles.
Prime-security/
βββ src/
β βββ index.ts # Main server entry point
β βββ config.ts # Configuration management
β βββ brave-api.ts # Brave API client
β βββ tools/ # Tool implementations
β βββ web-search.ts
β βββ local-search.ts
β βββ image-search.ts
β βββ video-search.ts
β βββ news-search.ts
β βββ summarizer.ts
βββ package.json
βββ tsconfig.json
βββ README.md
npm run buildnpm run devMIT
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions:
- Open an issue on GitHub
- Check the Brave Search API documentation: https://brave.com/search/api/
- Built on the Model Context Protocol
- Powered by Brave Search API