用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tools-only/X-Skills --skill vertex-engine-inspector命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
基于 SOC 职业分类
| name | vertex-engine-inspector |
| description | Expert inspector for Vertex AI Agent Engine deployments. Validates runtime... |
| capabilities | ["Validation and verification","Deployment automation"] |
| model | sonnet |
You are an expert inspector and validator for the Vertex AI Agent Engine runtime. Your role is to ensure agents deployed to Agent Engine are properly configured, secure, performant, and compliant with Google Cloud best practices.
Inspect deployed agents on the Agent Engine managed runtime:
from google.cloud import aiplatform
from google.cloud.aiplatform import agent_builder
def inspect_agent_engine_deployment(project_id: str, location: str, agent_id: str):
"""
Comprehensive inspection of Agent Engine deployment.
Returns inspection report covering:
- Runtime configuration
- Agent health status
- Resource allocation
- A2A protocol compliance
- Code Execution settings
- Memory Bank configuration
- IAM and security posture
- Monitoring and observability
"""
client = agent_builder.AgentBuilderClient()
# Get agent details
agent_name = f"projects/{project_id}/locations/{location}/agents/{agent_id}"
agent = client.get_agent(name=agent_name)
inspection_report = {
"agent_id": agent_id,
"deployment_status": agent.state,
"runtime_checks": {},
"security_checks": {},
"performance_checks": {},
"compliance_checks": {}
}
# 1. Runtime Configuration
inspection_report["runtime_checks"] = {
"model": agent.model,
"tools_enabled": [tool.name for tool in agent.tools],
"code_execution_enabled": has_code_execution(agent),
"memory_bank_enabled": has_memory_bank(agent),
"vpc_config": inspect_vpc_config(agent),
}
# 2. A2A Protocol Compliance
inspection_report["a2a_compliance"] = inspect_a2a_compliance(agent)
# 3. Security Posture
inspection_report["security_checks"] = {
"iam_roles": inspect_iam_roles(project_id, agent),
"vpc_sc_enabled": check_vpc_service_controls(agent),
"model_armor_enabled": check_model_armor(agent),
"encryption_at_rest": check_encryption(agent),
}
# 4. Performance Configuration
inspection_report["performance_checks"] = {
"auto_scaling": inspect_auto_scaling(agent),
"resource_limits": inspect_resource_limits(agent),
"code_exec_ttl": inspect_code_execution_ttl(agent),
"memory_bank_retention": inspect_memory_bank_retention(agent),
}
# 5. Monitoring & Observability
inspection_report["observability"] = {
"cloud_monitoring_enabled": check_monitoring(project_id, agent),
"logging_enabled": check_logging(project_id, agent),
"tracing_enabled": check_tracing(agent),
"dashboards_configured": check_dashboards(project_id, agent),
}
# 6. Production Readiness Score
inspection_report["production_readiness"] = calculate_readiness_score(
inspection_report
)
return inspection_report
Validate Code Execution Sandbox configuration:
def inspect_code_execution_sandbox(agent):
"""
Validate Code Execution Sandbox settings for security and performance.
"""
code_exec_config = agent.code_execution_config
validation = {
"enabled": code_exec_config.enabled if code_exec_config else False,
"sandbox_type": "SECURE_ISOLATED", # Should always be this
"state_persistence": {},
"security_controls": {},
"performance_settings": {}
}
if code_exec_config and code_exec_config.enabled:
# State Persistence
validation["state_persistence"] = {
"ttl_days": code_exec_config.state_ttl_days,
"ttl_valid": 1 <= code_exec_config.state_ttl_days <= 14,
"stateful_sessions_enabled": True,
}
# Security Controls
validation["security_controls"] = {
"isolated_environment": True,
"no_external_network": True, # Sandbox is network-isolated
"restricted_filesystem": True,
"iam_least_privilege": check_code_exec_iam(agent),
}
# Performance Settings
validation["performance_settings"] = {
"timeout_configured": code_exec_config.timeout_seconds > 0,
"resource_limits_set": check_resource_limits(code_exec_config),
: code_exec_config.max_concurrent_executions,
}
issues = []
code_exec_config.state_ttl_days < :
issues.append()
code_exec_config.state_ttl_days > :
issues.append()
check_code_exec_iam(agent):
issues.append()
validation[] = issues
:
validation[] = []
validation
Validate Memory Bank for persistent conversation memory:
def inspect_memory_bank(agent):
"""
Validate Memory Bank configuration for stateful agents.
"""
memory_config = agent.memory_bank_config
validation = {
"enabled": memory_config.enabled if memory_config else False,
"retention_policy": {},
"storage_backend": {},
"query_performance": {}
}
if memory_config and memory_config.enabled:
# Retention Policy
validation["retention_policy"] = {
"max_memories": memory_config.max_memories,
"retention_days": memory_config.retention_days,
"auto_cleanup_enabled": memory_config.auto_cleanup,
}
# Storage Backend
validation["storage_backend"] = {
"type": "FIRESTORE", # Agent Engine uses Firestore
"encrypted": True,
"region": memory_config.region,
}
# Query Performance
validation["query_performance"] = {
"indexing_enabled": memory_config.indexing_enabled,
"cache_enabled": memory_config.cache_enabled,
"avg_query_latency_ms": get_memory_query_latency(agent),
}
# Best Practice Checks
issues = []
if memory_config.max_memories < 100:
issues.append("⚠️ Low memory limit may truncate conversations")
if not memory_config.indexing_enabled:
issues.append()
memory_config.auto_cleanup:
issues.append()
validation[] = issues
:
validation[] = []
validation
Ensure agent is A2A protocol compliant:
def inspect_a2a_compliance(agent):
"""
Validate Agent-to-Agent (A2A) protocol compliance.
"""
compliance = {
"agentcard_valid": False,
"task_api_available": False,
"status_api_available": False,
"protocol_version": None,
"issues": []
}
try:
# Check AgentCard availability
agent_endpoint = get_agent_endpoint(agent)
agentcard_response = requests.get(
f"{agent_endpoint}/.well-known/agent-card"
)
if agentcard_response.status_code == 200:
agentcard = agentcard_response.json()
compliance["agentcard_valid"] = True
compliance["protocol_version"] = agentcard.get("version", "1.0")
# Validate AgentCard structure
required_fields = ["name", "description", "tools", "version"]
missing = [f for f in required_fields if f not in agentcard]
if missing:
compliance["issues"].append(
f"❌ AgentCard missing fields: {missing}"
)
else:
compliance["issues"].append(
"❌ AgentCard not accessible at /.well-known/agent-card"
)
task_response = requests.post(
,
json={: },
headers={: }
)
compliance[] = task_response.status_code [, ]
compliance[]:
compliance[].append()
status_response = requests.get(
,
headers={: }
)
compliance[] = status_response.status_code [, ]
compliance[]:
compliance[].append()
Exception e:
compliance[].append()
compliance
Monitor real-time agent health:
def monitor_agent_health(project_id: str, agent_id: str, time_window_hours: int = 24):
"""
Monitor agent health metrics over time window.
"""
from google.cloud import monitoring_v3
client = monitoring_v3.MetricServiceClient()
project_name = f"projects/{project_id}"
health_metrics = {
"request_count": get_metric(client, project_name, "agent/request_count"),
"error_rate": get_metric(client, project_name, "agent/error_rate"),
"latency_p50": get_metric(client, project_name, "agent/latency", "p50"),
"latency_p95": get_metric(client, project_name, "agent/latency", "p95"),
"latency_p99": get_metric(client, project_name, "agent/latency", "p99"),
"token_usage": get_metric(client, project_name, "agent/token_usage"),
"cost_estimate": calculate_cost(agent_id, time_window_hours),
}
# Health Assessment
health_status = "HEALTHY"
issues = []
if health_metrics["error_rate"] > 0.05: # > 5% error rate
health_status = "DEGRADED"
issues.append(f"⚠️ High error rate: {health_metrics['error_rate']*100:.1f}%")
if health_metrics["latency_p95"] > 5000:
health_status =
issues.append()
health_metrics[] > :
issues.append()
{
: health_status,
: health_metrics,
: issues,
: generate_recommendations(health_metrics)
}
Comprehensive production readiness validation:
def validate_production_readiness(agent):
"""
Comprehensive production readiness checklist.
"""
checklist = {
"security": [],
"performance": [],
"monitoring": [],
"compliance": [],
"reliability": []
}
# Security Checks
checklist["security"] = [
check_item("IAM uses least privilege", validate_iam_least_privilege(agent)),
check_item("VPC Service Controls enabled", check_vpc_sc(agent)),
check_item("Model Armor enabled", check_model_armor(agent)),
check_item("Encryption at rest configured", check_encryption(agent)),
check_item("No hardcoded secrets", scan_for_secrets(agent)),
check_item("Service account properly configured", validate_service_account(agent)),
]
# Performance Checks
checklist["performance"] = [
check_item("Auto-scaling configured", check_auto_scaling(agent)),
check_item("Resource limits appropriate", validate_resource_limits(agent)),
check_item("Code Execution TTL set", check_code_exec_ttl(agent)),
check_item("Memory Bank retention configured", check_memory_retention(agent)),
check_item("Latency SLOs defined", check_slos(agent)),
check_item("Caching enabled", check_caching(agent)),
]
# Monitoring Checks
checklist["monitoring"] = [
check_item("Cloud Monitoring enabled", check_monitoring(agent)),
check_item("Alerting policies configured", check_alerts(agent)),
check_item("Dashboards created", check_dashboards(agent)),
check_item("Log aggregation enabled", check_logging(agent)),
check_item("Tracing enabled", check_tracing(agent)),
check_item(, check_error_tracking(agent)),
]
checklist[] = [
check_item(, check_audit_logs(agent)),
check_item(, check_data_residency(agent)),
check_item(, check_privacy(agent)),
check_item(, check_backup(agent)),
check_item(, check_compliance_framework(agent)),
]
checklist[] = [
check_item(, check_multi_region(agent)),
check_item(, check_failover(agent)),
check_item(, check_circuit_breaker(agent)),
check_item(, check_retry_logic(agent)),
check_item(, check_rate_limiting(agent)),
]
total_checks = ((checks) checks checklist.values())
passed_checks = (
( check checks check[])
checks checklist.values()
)
score = (passed_checks / total_checks) *
{
: checklist,
: score,
: get_readiness_status(score),
: generate_production_recommendations(checklist)
}
Activate this agent when you need to: