A comprehensive guide to the Sentoru repository structure and architecture for AI agents. Sentoru is a hierarchical multi-agent security system built with Google's Agent Development Kit (ADK) that provides automated security analysis, vulnerability fixing, and penetration testing for code repositories.
app/
├── agent.py # Root orchestrator agent entry point
├── agent_engine_app.py # ADK engine application wrapper
├── agents/ # Specialized security agents
│ ├── analyst_agent.py # Security vulnerability analysis
│ ├── fixer_agent.py # Automated vulnerability patching
│ └── pentester_agent.py # Penetration testing validation
├── prompts/ # Agent instruction templates
│ ├── orchestrator_agent.md # Master coordinator instructions
│ ├── search_agent.md # RAG knowledge retrieval instructions
│ ├── analyst_agent.md # Security analysis instructions
│ ├── fixer_agent.md # Vulnerability fixing instructions
│ └── pentester_agent.md # Penetration testing instructions
├── tools.py # Agent tools and utilities
└── utils/ # Supporting utilities
├── gcs.py # Google Cloud Storage operations
├── tracing.py # Observability and logging
├── typing.py # Type definitions
└── util.py # Common utility functions
Sentoru implements a sophisticated hierarchical multi-agent architecture:
-
Orchestrator Agent (
app/agent.py: root_agent)- Master coordinator managing the entire security workflow
- Conditionally invokes Search Agent based on
USE_RAGconfiguration - Delegates to Review Agent for sequential security analysis
-
Search Agent (
app/tools.py: get_search_agent())- Optional RAG-powered knowledge retrieval agent
- Queries Vertex AI RAG corpus for security best practices
- Provides contextual intelligence from OWASP, CWE, and security sources
-
Review Agent (
app/agent.py: review_agent)- Sequential pipeline of three specialized security agents:
- Analyst Agent: Identifies security vulnerabilities
- Fixer Agent: Generates patches for vulnerabilities
- Pentester Agent: Creates tests to validate fixes
- Sequential pipeline of three specialized security agents:
Security Analysis Tools:
get_rag_vulnerability_knowledge_tool(): RAG-based security knowledge retrievalget_safety_API_tool(): Dependency vulnerability scanningget_orchestrator_agent_tools(): Conditional tool provisioning
Supported Operations:
- Git diff analysis and security assessment
- Automated vulnerability patching in GitHub format
- Penetration test generation using pytest framework
- RAG-enhanced security context gathering
Find practical examples in tests/integration/:
tests/
├── integration/
│ └── test_agent.py # End-to-end agent workflow tests
├── samples/ # Sample git diffs for testing
│ ├── sample.diff # Example with vulnerabilities
│ └── sample_clean.diff # Clean code example
└── unit/
└── test_utils.py # Utility function tests
notebooks/
├── adk_app_testing.ipynb # Interactive agent testing
└── evaluating_adk_agent.ipynb # Agent evaluation workflows
Key Testing Patterns:
- Load sample git diffs from
tests/samples/ - Initialize agent with proper session state
- Execute full security analysis workflow
- Validate JSON response format and security findings
# Initialize agent with git diff context
agent_state = {"git_diff": load_sample_diff()}
# Execute security workflow
response = root_agent.execute(
query="Analyze this code for security vulnerabilities",
state=agent_state
)
# Extract results
analysis = response.get("analysis")
fixes = response.get("fixed_code_patches")
tests = response.get("test_code")GOOGLE_CLOUD_PROJECT=<your-project-id>
GOOGLE_GENAI_USE_VERTEXAI=True
GOOGLE_CLOUD_LOCATION=us-central1
LLM_DEPLOYMENT=gemini-2.0-flash
SAFETY_API_KEY=<safety-api-key>
VULN_RAG_CORPUS=<rag-corpus-resource-name> # For RAG capabilities
USE_RAG=true # Toggle RAG functionality- Local Development: Full RAG capabilities available
- Cloud Deployment: RAG must be disabled (
USE_RAGunset) due to ADK limitation - GitHub Integration: Automated PR analysis via webhook triggers
- Git diff context passed through
before_agent_callback - Session state maintains security analysis context
- Structured JSON responses for downstream processing
- Vertex AI RAG corpus with OWASP, CWE, security documents
- Generated using Gemini Deep Research capabilities
- Vectorized with
text-embedding-005for semantic search
- Agent-as-a-Tool pattern for Search Agent
- Conditional tool provisioning based on configuration
- MCP toolset integration for external security APIs
- ADK Documentation: https://google.github.io/adk-docs/
- Repository: GitHub - Sentoru Agent
- Demo Video: YouTube Demo
- GitHub App: Install Sentoru
