Skip to content

Commit f2d858c

Browse files
stuaganocharmcrush
andcommitted
refactor: Consolidate agents and remove mock data
This commit refactors the security agent by merging the functionality of `enhanced_agent.py` into `agent.py`, creating a single, comprehensive agent. Key changes: - Merged API Hub, dependency analysis, and risk propagation tools into the main agent. - Removed mock data fallbacks from `frontend/enhanced_security_agent_app.py` and `backend/api/gcp.py` to ensure robust error handling. - Stabilized the `run.sh` script by removing the `--reload` flag and improving the Streamlit command. - Deleted the redundant `agents/enhanced_agent.py`. These changes improve maintainability and align the application with the "no mock data" core principle. 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
1 parent edcc4d2 commit f2d858c

56 files changed

Lines changed: 2914 additions & 35252 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ wheels/
7676
*.log
7777
logs/
7878
log/
79+
src/google/adk/a2a/logs/
80+
7981

8082
# Local development settings
8183
.env.local
@@ -98,3 +100,10 @@ Thumbs.db
98100
*.bak
99101
*.tmp
100102
*.temp
103+
.crush/
104+
105+
# Media files
106+
*.png
107+
*.pdf
108+
109+

contributing/samples/personal_assistant_agent/cloudbuild.yaml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,26 +209,4 @@ substitutions:
209209

210210
# Images to be pushed
211211
images:
212-
- '${_AR_IMAGE}'
213-
214-
# Build triggers configuration
215-
# This section is used when setting up automated triggers
216-
# but is not processed during manual builds
217-
trigger:
218-
name: 'personal-assistant-agent-trigger'
219-
description: 'Automated deployment trigger for Personal Assistant Agent'
220-
github:
221-
owner: 'your-username'
222-
name: 'your-repo-name'
223-
push:
224-
branch: '^main$'
225-
substitutions:
226-
_REGION: 'us-central1'
227-
_SERVICE_NAME: 'personal-assistant-agent'
228-
_ENVIRONMENT: 'production'
229-
includedFiles:
230-
- 'ADK/contributing/samples/personal_assistant_agent/**'
231-
ignoredFiles:
232-
- '**/*.md'
233-
- '**/README.md'
234-
- '**/*.txt'
212+
- '${_AR_IMAGE}'

contributing/samples/security_agent/.cursorrules

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
# Enhanced GCP Security Agent - Cursor Rules
2+
# ALWAYS USE VERTEX AI AND CLOUD RUN FOR ALL OPERATIONS
3+
4+
## Google Cloud Platform Architecture Requirements
5+
6+
### Vertex AI Integration
7+
- **ALWAYS use Vertex AI for all LLM operations** - Never use Google AI API directly
8+
- Use Application Default Credentials (ADC) for authentication to Vertex AI
9+
- Set GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION environment variables
10+
- Use `gemini-2.0-flash-exp` model through Vertex AI endpoints
11+
- All ADK agents MUST be configured to use Vertex AI backend
12+
- Never pass api_key parameter to Agent constructor - use ADC only
13+
14+
### Cloud Run Deployment Strategy
15+
- **Target Cloud Run for all deployment scenarios**
16+
- Configure containerized applications with proper health checks
17+
- Use Cloud Run service-to-service authentication
18+
- Implement proper resource limits and scaling policies
19+
- Configure VPC connector for secure communication
20+
- Use Cloud Run jobs for batch processing tasks
21+
22+
### Authentication and Authorization
23+
- **MANDATORY: Use Application Default Credentials (ADC) everywhere**
24+
- Configure service accounts with least privilege access
25+
- Use Cloud IAM roles for fine-grained permissions
26+
- Implement proper OIDC token validation for service-to-service calls
27+
- Never hardcode API keys or credentials in code
228

329
## Core Development Principles
430

@@ -64,6 +90,23 @@
6490
- Handle timeout scenarios gracefully
6591
- Display meaningful error messages to users
6692

93+
### Google Cloud Services Integration
94+
- **Use Vertex AI for all LLM/Agent operations** - set model='gemini-2.0-flash-exp'
95+
- Use Cloud Run for hosting both frontend (Streamlit) and backend (FastAPI)
96+
- Use Cloud Storage for file uploads and data persistence
97+
- Use Cloud Trace for OpenTelemetry distributed tracing
98+
- Use Cloud Logging for application logs and monitoring
99+
- Use Cloud IAM for service authentication and authorization
100+
- Use Cloud Secret Manager for sensitive configuration data
101+
102+
### Container and Deployment Configuration
103+
- Create Dockerfile for both frontend and backend services
104+
- Use multi-stage builds for optimized container images
105+
- Configure Cloud Run services with proper CPU/memory limits
106+
- Set up proper environment variable management
107+
- Implement graceful shutdown handling
108+
- Configure liveness and readiness probes
109+
67110
## Code Quality Standards
68111

69112
### Error Handling

contributing/samples/security_agent/.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ coverage.xml
5050
*.py,cover
5151
.hypothesis/
5252
.pytest_cache/
53+
.streamlit/
5354

5455
# Distribution / packaging
5556
.Python
@@ -82,6 +83,10 @@ log/
8283
.env.development.local
8384
.env.test.local
8485
.env.production.local
86+
/Users/stuartgano/Desktop/Micron/ADK/contributing/samples/security_agent/CLAUDE.md
87+
/Users/stuartgano/Desktop/Micron/ADK/contributing/samples/security_agent/run.log
88+
.cursorrules
89+
/Users/stuartgano/Desktop/Micron/ADK/contributing/samples/security_agent/=1.31.0
8590

8691
# Google Cloud specific
8792
.gcloudignore
@@ -96,4 +101,5 @@ site/
96101
Thumbs.db
97102
*.bak
98103
*.tmp
99-
*.temp
104+
*.temp
105+
.crush/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Requirement already satisfied: opentelemetry-api in /Users/stuartgano/Desktop/Micron/ADK/venv/lib/python3.13/site-packages (1.36.0)
2+
Requirement already satisfied: importlib-metadata<8.8.0,>=6.0 in /Users/stuartgano/Desktop/Micron/ADK/venv/lib/python3.13/site-packages (from opentelemetry-api) (6.11.0)
3+
Requirement already satisfied: typing-extensions>=4.5.0 in /Users/stuartgano/Desktop/Micron/ADK/venv/lib/python3.13/site-packages (from opentelemetry-api) (4.14.0)
4+
Requirement already satisfied: zipp>=0.5 in /Users/stuartgano/Desktop/Micron/ADK/venv/lib/python3.13/site-packages (from importlib-metadata<8.8.0,>=6.0->opentelemetry-api) (3.22.0)

0 commit comments

Comments
 (0)