Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions custom-agents/aws-operation-review/SYSTEM_PROMPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ You are an AWS Operations Review Specialist focused on assessing AWS services ag

## Goal

Perform comprehensive operational reviews of AWS services (EKS clusters, RDS instances, Aurora clusters) to identify gaps in security, reliability, performance, cost optimization, and operational excellence — aligned with AWS best practices and the Well-Architected Framework.
Perform comprehensive operational reviews of AWS services (EKS clusters, RDS instances, Aurora clusters, Bedrock workloads) to identify gaps in security, reliability, performance, cost optimization, and operational excellence — aligned with AWS best practices and the Well-Architected Framework.

## Approach

1. Identify which AWS service the user wants reviewed (EKS, RDS, or Aurora).
2. Load the appropriate skill for the service:
- For EKS clusters: use the `eks-operation-review` skill methodology
- For RDS/Aurora databases: use the `rds-operation-review` skill methodology
- For Bedrock workloads: use the `bedrock-operation-review` skill methodology
3. Follow the skill's structured assessment framework to evaluate the resource.
4. For each finding, assess severity (critical, high, medium, low) based on security exposure, blast radius, and operational risk.
5. Generate actionable recommendations with clear remediation steps.
Expand Down Expand Up @@ -40,7 +41,7 @@ Before creating new recommendations, list existing recommendations and update an
Generate a shareable report artifact as a Markdown document.

**Artifact naming:** `<service>-review-<resource-name>-<YYYY-MM-DD>.md`
Examples: `eks-review-prod-cluster-2026-06-21.md`, `rds-review-orders-db-2026-06-21.md`
Examples: `eks-review-prod-cluster-2026-06-21.md`, `rds-review-orders-db-2026-06-21.md`, `bedrock-review-1234567890-us-east-1-2026-08-21.md`

**Report structure:**

Expand Down
8 changes: 8 additions & 0 deletions skills/bedrock-operation-review/.skilleval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
audit:
ignore:
- STR-016 # README alongside SKILL.md is intentional
# Whitelist documentation/blog domains for best practices reference (won't trigger SEC-002)
safe_domains:
- aws.amazon.com
- docs.aws.amazon.com
- repost.aws
16 changes: 16 additions & 0 deletions skills/bedrock-operation-review/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

## [1.0.0] - 2026-07-XX
### Added
- Initial release adapted from AWS Support Specialist skill
- Comprehensive Amazon Bedrock operational review aligned with the AWS Well-Architected Framework and Bedrock best practices
- Five review pillars: Security, Performance, Service Quotas, Cost Optimization, and Resilience
- Resource discovery across foundation models, guardrails, inference profiles, prompt routers, provisioned throughput, custom models, agents, knowledge bases, data sources, and Prompt Management
- CloudWatch metric collection and threshold-based classification (Normal/Warning/Critical) in the `AWS/Bedrock` namespace
- Service quota utilization analysis (RPM/TPM including CRIS) via Service Quotas API
- Cost optimization checks: prompt caching, model distillation, batch inference, provisioned throughput, intelligent prompt routing, and self-managed EC2 GPU utilization
- Cross-Region Inference (CRIS) adoption analysis for resilience
- Severity-ranked findings (CRITICAL, HIGH, MEDIUM, LOW, INFO) and a shareable Markdown report artifact
- AWS-API-only data collection (Bedrock, Bedrock Agent, CloudWatch, Service Quotas, EC2) with no data-plane model invocations and no prompt/response content read
- Reference files: best-practices checklist and CloudWatch metric thresholds
- Evaluation test cases (5 functional evals, 6 trigger queries)
147 changes: 147 additions & 0 deletions skills/bedrock-operation-review/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# Bedrock Operational Review — AWS DevOps Agent Skill

A comprehensive Amazon Bedrock operational review skill for [AWS DevOps Agent](https://docs.aws.amazon.com/devopsagent/latest/userguide/about-aws-devops-agent.html). Conducts best-practices assessments aligned with the [Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) and the [AWS Well-Architected Framework](https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html). Generates a shareable report artifact for the review.

## What It Does

When activated via Chat, this skill instructs the DevOps Agent to:

1. Discover Bedrock resources in the configured account/regions — foundation models, guardrails, inference profiles, prompt routers, provisioned throughput, custom models, model customization jobs, agents, knowledge bases, data sources, and prompts.
2. Collect CloudWatch metrics from the `AWS/Bedrock` namespace (also `CWAgent` namespaces) for invocations, latency, throttling, errors, token usage, guardrail interventions, and prompt-cache activity.
3. Pull service quota values from Service Quotas and compare against observed usage.
4. Analyze against six pillars — **Security, Performance, Service Quotas, Cost Optimization, Resilience** — plus check-specific guidance.
5. Generate a shareable report artifact, named `bedrock-review-<account-id>-<region>-<YYYY-MM-DD>.md`.

All data is gathered through native AWS APIs (`bedrock`, `bedrockagent`, `cloudwatch`, `servicequotas`, `ec2`). The skill performs **no data-plane model invocations** and reads no prompt or response content. It does not depend on Kubernetes, EKS, or any internal tooling.

## Agent Types

This skill is intended for the following agent types (selected in the Operator Web App at upload time):

- **On-demand** — conversational invocation in Chat ("review my Bedrock account", "Bedrock health check").
- **Evaluation** — proactive operational improvement recommendations.

Select **Generic** instead if you want the skill available to all agent types.

## Prerequisites

### 1. An AWS DevOps Agent Space with the target AWS account

You need an existing [Agent Space](https://docs.aws.amazon.com/devopsagent/latest/userguide/getting-started-with-aws-devops-agent-creating-an-agent-space.html) with the target AWS account configured as a cloud source.

### 2. IAM permissions for the DevOps Agent's primary cloud-source role

The Agent Space's IAM role must have read access to Bedrock, Bedrock Agent, CloudWatch, Service Quotas, and EC2 APIs. Verify these are present in your account before running the review:

- `bedrock:ListFoundationModels`, `bedrock:ListGuardrails`, `bedrock:GetGuardrail`
- `bedrock:GetModelInvocationLoggingConfiguration`
- `bedrock:ListInferenceProfiles`, `bedrock:GetInferenceProfile`
- `bedrock:ListPromptRouters`, `bedrock:GetPromptRouter`
- `bedrock:ListProvisionedModelThroughputs`, `bedrock:GetProvisionedModelThroughput`
- `bedrock:ListCustomModels`, `bedrock:GetCustomModel`
- `bedrock:ListModelCustomizationJobs`, `bedrock:GetModelCustomizationJob`
- `bedrock:ListAgents`, `bedrock:GetAgent`, `bedrock:ListAgentAliases` (Bedrock Agent control plane)
- `bedrock:ListKnowledgeBases`, `bedrock:GetKnowledgeBase`, `bedrock:ListDataSources`, `bedrock:GetDataSource`
- `bedrock:ListPrompts`, `bedrock:GetPrompt`
- `cloudwatch:ListMetrics`, `cloudwatch:GetMetricData`, `cloudwatch:GetMetricStatistics`
- `servicequotas:GetServiceQuota`, `servicequotas:ListServiceQuotas`
- `ec2:DescribeInstances`

The skill operates entirely in **read-only** mode: it never calls `Create*`, `Update*`, `Delete*`, or any `InvokeModel*` (data-plane) APIs.

### 3. Model invocation activity (recommended)

Most CloudWatch-based checks (latency, throttling, prompt caching, guardrail signals, cross-region inference, model versions) rely on `AWS/Bedrock` metrics, which only exist for models that have been invoked in the analysis window. Reviewing an account with no recent Bedrock traffic still produces a configuration report, but metric-driven findings will be empty.

### 4. (Conditional) CloudWatch Agent for EC2 GPU utilization

The EC2 GPU utilization check (self-managed P4/P5/P5en/P6 instances) requires the **CloudWatch Agent** installed with the **NVIDIA DCGM plugin** enabled, publishing `nvidia_smi_utilization_gpu` and `nvidia_smi_memory_util` to the `CWAgent` namespace. Without it, GPU signals cannot be evaluated. This check is optional and only applies to accounts running self-managed GPU training/inference.

## Uploading to AWS DevOps Agent

> Reference: [Uploading a skill](https://docs.aws.amazon.com/devopsagent/latest/userguide/about-aws-devops-agent-devops-agent-skills.html#uploading-a-skill)

### 1. Package the skill

From the `skills/` directory in this repo:

```bash
cd skills
zip -r bedrock-operation-review.zip bedrock-operation-review/ -x 'bedrock-operation-review/evals/*'
```

The resulting `bedrock-operation-review.zip` contains:

```
bedrock-operation-review/
├── SKILL.md # frontmatter + skill instructions (required)
├── README.md
└── references/
├── best-practices-checklist.md
└── metrics-thresholds.md
```

`evals/` is excluded from the upload to keep the zip small (it's only used for offline evaluation).

Constraints (enforced at upload time):

- Total zip size ≤ **6 MB**.
- `SKILL.md` is required and must include `name` and `description` frontmatter.
- A `scripts/` directory is **not** allowed — uploads containing scripts are rejected.

### 2. Upload via the Operator Web App

1. Navigate to the **Skills** page in your Agent Space Operator Web App.
2. Click **Add skill** → **Upload skill**.
3. Drag and drop `bedrock-operation-review.zip` (or browse to it).
4. Select agent types: **On-demand** and **Evaluation** (or leave **Generic** to make it available to all agent types).
5. Review the validation results.
6. Click **Upload**.

## Usage

In the DevOps Agent Chat, use natural language:

- *"Run a Bedrock operational review for all regions."*
- *"Review my Bedrock account `123456789012` in `us-east-1` for best practices."*
- *"Audit Bedrock security and cost optimization."*
- *"Check my Bedrock service quota utilization and throttling."*
- *"ORR for our Bedrock workloads."*

The agent will:

- Collect all data automatically (no prompts for confirmation).
- Use only AWS APIs — no model invocations, no prompt/response content read.
- Generate a report artifact named `bedrock-review-<account-id>-<region>-<YYYY-MM-DD>.md`.

## Skill Contents

```
bedrock-operation-review/
├── SKILL.md # main skill instructions (with frontmatter)
├── README.md # this file
├── references/
│ ├── best-practices-checklist.md # checklist mapped to Bedrock best practices
│ └── metrics-thresholds.md # CloudWatch metric thresholds & severity rules
└── evals/ # evaluation data (not included in upload zip)
```

## Best-Practices Pillars Covered

| # | Pillar | Checks | Reference |
|---|--------|--------|-----------|
| 1 | Security | Guardrails, Guardrail Signals, Model Invocation Logging, Knowledge Base config & encryption, VPC config for customization jobs, IAM fine-grained access, KB logging, Prompt injection, Model access | [Bedrock security](https://docs.aws.amazon.com/bedrock/latest/userguide/security.html) |
| 2 | Performance | Latency & Throttling, Agent Performance, Invoked Model Versions, Data Automation, Service Tier | [Monitoring Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/monitoring.html) |
| 3 | Service Quotas | Model Quotas, Guardrail Service Quotas | [Bedrock quotas](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html) |
| 4 | Cost Optimization | Application Inference Profiles, Custom Model Distillation, Prompt Caching, Prompt Management, Intelligent Prompt Routing, Provisioned Throughput, Batch Inference, EC2 GPU Utilization | [Bedrock pricing](https://aws.amazon.com/bedrock/pricing/) |
| 5 | Resilience | Cross-Region Inference (CRIS) | [Cross-region inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) |

## Severity Definitions

| Severity | Definition | SLA |
|----------|------------|-----|
| CRITICAL | Immediate risk to availability, security, or data integrity | 24–48 hours |
| HIGH | Significant gap that could lead to incidents | 1 week |
| MEDIUM | Notable improvement opportunity | 30 days |
| LOW | Minor optimization or hardening | When convenient |
| INFO | Observation, no action required | N/A |
Loading