agents-optimize
An agent skill by aws, from aws/agent-toolkit-for-aws. Tags: analytics, cost-optimization, evaluation, observability, performance.
What it does
Use when measuring or improving agent quality and performance — set up evaluators, online monitoring, CI/CD quality gates, observability, or cost optimization. Triggers on: "evaluate my agent", "add evaluator", "measure quality", "quality gate", "run evals", "agent too slow", "why is it slow", "reduce latency", "set up observability", "CloudWatch dashboard", "how much does my agent cost", "cost optimization", "logs not showing up", "logs missing", "spans not found", "eval failing", "eval error", "dev traces", "local traces", "agentcore dev traces", "traces to CloudWatch". Not for debugging errors or crashes — use agents-debug. Slow but correct routes here; broken routes to debug.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add aws/agent-toolkit-for-aws --skill agents-optimize
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/aws/agent-toolkit-for-aws
cp -r agent-toolkit-for-aws/plugins/aws-agents/skills/agents-optimize ~/.claude/skills/agents-optimize
Safety box score
Grade C, moderate risk: 30 of 100 risk points, rated 2026-09-22. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill is an AWS observability and evaluation helper for AgentCore: it runs CLI commands, reads project config, and can enable traces, logs, online evals, dashboards, and CI/CD quality gates. The main risks are account-level telemetry exposure to CloudWatch/X-Ray, production-impacting monitoring changes, and the fact that it can execute shell/AWS CLI commands as part of its workflow.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 2 (moderate) | The skill drives command execution with Bash/CLI snippets such as `agentcore run eval`, `agentcore add online-eval`, and `agentcore deploy -y`, but it does not download and run arbitrary code. |
| Network access | 2 (moderate) | It reads and sends observability data to AWS services, including CloudWatch logs/traces and X-Ray (`aws xray update-trace-segment-destination --destination CloudWatchLogs`), so agent traffic and telemetry leave the machine. |
| Filesystem reach | 1 (low) | It reads `agentcore/agentcore.json` and writes results under `agentcore/.cli/eval-runs/`, which is bounded to the project directory. |
| Secrets & credentials | 1 (low) | The workflow requires local AWS credentials and uses session IDs from responses/logs, and the evaluated traces/logs may contain sensitive application content, but it does not directly read secret stores or keychains. |
| Privilege & persistence | 0 (none) | No `sudo`, global installs, service registration, or shell/OS setting changes are requested; the changes are at the AgentCore/AWS account layer, not local privilege escalation. |
| Instruction hijack surface | 0 (none) | There is no instruction to ignore safeguards, fetch and obey remote prompts, or hide behavior; the text is task guidance for eval/observability workflows. |
| Irreversible actions | 2 (moderate) | It can create, deploy, pause, and resume online evals and generate CI/CD quality gates (`agentcore deploy -y`, `pause online-eval`, `resume online-eval`), which can affect live production monitoring and build outcomes. |
| Transparency | 0 (none) | All shipped files are plain markdown; there are no binaries, minified blobs, or runtime-decoded payloads. |
Before installing
- Read `references/evals.md` and `references/observability.md` to confirm which AWS services and CLI commands it will touch.
- Check whether your agent logs/traces may contain PII or secrets before enabling CloudWatch/X-Ray ingestion.
- Try it first in a non-production AWS account, and keep online eval sampling low (`1–5%`) unless you explicitly want broader coverage.
- If you only need local iteration, verify `agentcore dev --no-traces` is not required and that CloudWatch Transaction Search is enabled in the target account.
Rated 2026-09-22 by an automated review of 4 files from the skill's repository.
Source
- Repository
- aws/agent-toolkit-for-aws (all skills from this repository)
- Path
- plugins/aws-agents/skills/agents-optimize/SKILL.md
- Branch
- main
- Collection
- aws-agents
- Updated
- 2026-09-19
Related skills
- aws-billing-and-cost-management — Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer.
- caveman-evidence-review — Read-only review of Caveman Cloud evidence: cost, Cave Score, workflows, traces, latency, errors, routing, savings.
- evaluation — This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates.
- aws-observability — Builds, configures, debugs, and optimizes AWS observability with CloudWatch (Log Insights, Metrics, Alarms, Dashboards, EMF), X-Ray, CloudTrail.
- aws-storage — Selects, investigates, and compares AWS object, file, and block storage services, and answers cost, performance, configuration, security.
- ab-testing — When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program.