Skip to content

Add storage-s3-failure-diagnosis skill (live diagnosis of active S3 failures) - #338

Draft
vgaglia-aws wants to merge 2 commits into
aws:mainfrom
vgaglia-aws:add-storage-s3-failure-diagnosis
Draft

vgaglia-aws wants to merge 2 commits into
aws:mainfrom
vgaglia-aws:add-storage-s3-failure-diagnosis

Conversation

@vgaglia-aws

@vgaglia-aws vgaglia-aws commented Dec 4, 2026 •

Copy link
Copy Markdown

Description

Tool request: #337.

This PR adds storage-s3-failure-diagnosis, a read-only skill for an Amazon S3 problem that is happening now: a 403 Access Denied, replication that stalled or failed, a lifecycle rule that does not transition or expire, or 503 SlowDown and 500 InternalError responses. It has the agent read the bucket's actual configuration through control-plane APIs, walk a decision tree for that failure family, assign a severity and write a Markdown report with the specific fix.

Type of change

  • New skill
  • New custom agent
  • New MCP server
  • Update to an existing skill, agent, or MCP server
  • Documentation or infrastructure change

Required before review

  • Repository layout is correct — skills in /skills, MCP servers in /mcp, custom agents in /custom-agents; skills and MCP servers are never mixed in one directory. Here: one directory, skills/storage-s3-failure-diagnosis/.
  • A domain SME has reviewed and signed off. A named subject-matter expert for this domain — someone other than the author — has reviewed the tool for technical correctness and approved it in this PR. Required for any change to what the tool tells the agent; an edit that changes no technical claim can be marked n/a with the reason, as CONTRIBUTING.md describes. Here: not yet. I have not found an S3 SME. Could a maintainer please help route this to one?
  • Evaluation evidence is included (see Testing). Here: the structure, best-practices and functional results from the skill evaluation tool are committed under evals/.
  • No internal-only or proprietary content — no internal hostnames, account IDs, customer names, ticket numbers, internal URLs, or secrets in the tool, its examples, or its tests. Here: the example account IDs are the AWS documentation examples 111122223333 and 444455556666, and the bucket and role names are generic placeholders. In 18 of the 132 functional run journals I replaced the test account's bucket, Lambda function, trail and stack names, its S3 canonical user ID, its Cost Explorer figures (among them the size of its S3 bill in a sentence the agent wrote), its description as Cost Explorer returned it, and an AWS documentation example ARN whose account is not on the repository's allowlist, plus one internal system name the agent wrote in its notes. The patterns for the cost figures also replaced other numbers in those journals, such as the 40% in the cost question's own prompt.
  • README is complete — prerequisites, setup/deployment, and at least one sample prompt or usage example. Here: prerequisites, upload steps, and sample prompts for Chat and Incident RCA.
  • CHANGELOG updated and the version bumped. Here: one 1.0.0 entry for a new skill.
  • Named owner for ongoing maintenance. Here: @vgaglia-aws.

How it differs from existing skills

  • storage-s3-resiliency-expertise reviews the posture of one or many buckets across nine dimensions and rates them. My skill starts from a failure the user is seeing and finds its cause. My skill's description routes resiliency, security and data-protection reviews to storage-s3-resiliency-expertise by name.

  • aiml-access-diagnostics covers Bedrock and SageMaker roles that cannot reach S3. My skill covers the S3 side of a 403 for any caller.

  • aws-backup-coverage-review covers backup coverage and shares no checks with my skill.

  • Open PR datalake access analyzer skill #212 (datalake-access-analyzer) covers Lake Formation and Glue Data Catalog access denied, including S3 locations registered with Lake Formation. My skill does not read Lake Formation permissions and does not check whether an S3 location is registered with Lake Formation.

  • Open PR Add s3-access-denied-resolver skill #302 (s3-access-denied-resolver) diagnoses S3 403 AccessDenied by walking ten authorization layers, and its description rules out 503 SlowDown, replication and lifecycle issues. That overlaps the access-denied family of my skill. Within that family:

    • My skill also covers S3 Access Grants as its own layer and the masked 404, rates severity, and checks for an AWS service event before blaming configuration.
    • Add s3-access-denied-resolver skill #302 reads the SCPs and RCPs, identity policies, permissions boundary, VPC endpoint policy and KMS key policy itself. My skill reads the bucket's own configuration and takes those layers from the enhanced 403 message, CloudTrail and what the user supplies.
    • Add s3-access-denied-resolver skill #302 also covers buckets that block SSE-C writes and access point network origin. My skill has no check for either; references/REFERENCE.md section (a.0) names the SSE-C block only as a message shape, under its table of enhanced 403 clauses.
    • Add s3-access-denied-resolver skill #302 gives a verdict per layer from a closed set, a JSON diff for the fix and a fallback path when the agent's bucket reads are blocked.

    The replication, lifecycle and request-rate families are not in Add s3-access-denied-resolver skill #302.

  • Issue [request]: S3 storage cost optimisation custom agent (audit buckets, estimate waste, recommend lifecycle rules) #238 asks for an S3 storage cost optimisation custom agent; that is out of scope here.

I searched the skills on main, the custom agents, the MCP servers, the open pull requests and the open issues. The only other tool built to diagnose active S3 failures is open PR #302, which covers 403s only; aiml-access-diagnostics and PR #212 reach S3 only from the Bedrock, SageMaker or Lake Formation side.

What it covers, by family:

  • Access denied: reads the enhanced 403 error first. When its context clause names the denying policy type, the agent matches it against a table of thirteen clauses and goes straight to that layer. Otherwise, and for any cross-account or cross-organization caller, it walks thirteen layers in order: Block Public Access as a pre-check, the VPC endpoint policy, the caller's account policies (identity policy, permissions boundary, session policy, SCP), a resource control policy, the bucket owner's explicit deny, the resource owner's allow, Object Ownership and ACLs, KMS by operation, Object Lock, the access point policy, Requester Pays, S3 Access Grants, and a missing key that returns 403 instead of 404 to a caller without s3:ListBucket.
  • Replication: V1 versus V2 configuration and their delete-marker defaults, rule status, role, destination ownership and KMS, what does and does not replicate, Replication Time Control limits, and the Batch Replication roles, manifest and job errors.
  • Lifecycle: the replication-status gate first (lifecycle takes no action on PENDING or FAILED objects), the Object Lock asymmetry, conflict precedence, the 128 KB minimum object size for transitions and its override, minimum storage durations, directory buckets, and the two timing facts every lifecycle finding states (actions can take days or weeks, and the clock is the object's LastModified timestamp).
  • Request rate: seven causes of 503 SlowDown (partition throttle, same-key PUT throttling, per-object DELETE metering, DNS pinning, cross-region COPY bandwidth, KMS throttling, hot object), and 500 InternalError judged against the published SLA thresholds for each storage class.

In every family the agent checks for an AWS service event before naming a configuration cause and tests each finding against known non-findings. When a finding is High or Critical or the fix is not self-serviceable, the report adds an escalation packet listing what AWS Support will ask for. For a principal locked out by the bucket's own policy, the skill gives a hard-stop referral instead of a fix: it says a support case will not remove that policy and gives the self-service path, the account root user or, for a member account in AWS Organizations, centralized root access.

SKILL.md carries the workflow: a six-step checklist that says when each step runs and what it outputs. The decision trees, the fact tables and the severity definitions live in references/REFERENCE.md, and a reference map at the top of SKILL.md says which section to load for which step.

Read-only posture and IAM

The skill only reads and only recommends; it never changes a bucket and never reads object data. automation/iam-policy.json lists the 23 read actions the skill calls (S3, CloudTrail, CloudWatch, Service Quotas and AWS Health) in 5 statements. 21 of them are in the AIDevOpsAgentAccessPolicy managed policy, checked against version 16 of that policy, edited 2026-11-14. The other 2, s3:GetBucketRequestPayment and s3:ListAccessPoints, sit in their own optional statement, and the skill reports those checks as not performed when the default agent role cannot run them. automation/README.md explains each statement, and references/REFERENCE.md section (i) maps each API call to its IAM action.

Testing

  • structure checks pass. Here: evals/structure/structure-tests-results-v1.json, score 100, 12 of 12 checks passed, run 2026-12-03.
  • best-practices run across multiple iterations, with consistent results. Here: evals/best-practices/v2/, 3 iterations on 2026-12-03 with judge model us.anthropic.claude-sonnet-5, scores 88, 100 and 100 (consistency 88). In iteration 1 the judge, at medium confidence, failed 2 of the 17 checks: reference material in the body (its evidence is the S3 API list in Step 2) and an output template in the body (the six-part report outline in Step 5). Iterations 2 and 3 passed all 17. An earlier best-practices run on the same SKILL.md, the same day, scored 100 in all three iterations; it is not in the PR, because CONTRIBUTING.md asks for the last version of each test type only.
  • functional run with and without the change, so the difference in the agent's behavior is visible. Here: evals/functional/v6/, 3 iterations of the 26 cases on 2026-12-03, 132 of 132 runs completed: 18 should-trigger cases x 3 iterations x 2 arms, and 8 should-not-trigger cases x 3. With the skill available the agent loaded it in 39 of the 54 should-trigger runs, passed 209 of 264 assertion checks and met the expected output in 42 of 54 runs; without the skill it passed 146 of 264 checks and met the expected output in 28 of 54.
  • evals/evals.json includes positive cases (should trigger) and at least one negative case (should not trigger on unrelated input). Here: 18 should-trigger cases and 8 should-not-trigger cases (an AWS bill, an EC2 resize, a Lambda timeout, EBS gp3 throughput, EFS burst credits, an S3 posture review, an S3 cost question and a question about what is inside an S3 object); the skill loaded in none of the 24 runs of the should-not-trigger cases.

All three result sets come from the skill evaluation tool and are committed under evals/. In the functional run, whose judge is us.anthropic.claude-sonnet-5, evals/functional/v6/benchmark.json classes the 88 assertions as 40 always_passes, 29 flaky, 11 skill_uplift and 8 always_fails. Seven of the 8 always_fails belong to recall-four-families and recall-lifecycle-conflict-and-waterfall, two cases where the skill never loaded (below). The eighth is the Object Lock asymmetry in recall-lifecycle-blocked-by-replication (current versions can expire, noncurrent versions under retention or legal hold cannot): the skill loaded in all 3 of that case's with-skill runs, and the judge failed that assertion in all 6 runs. In two of the three runs of the S3 posture-review case, the agent loaded storage-s3-resiliency-expertise, the skill my description points to for reviews.

In 15 of the 132 runs the agent session started with a smaller context: the first context-window reading in its journal is 4.1 or 4.2 percent, against 4.4 or 4.5 in the other 117 runs. All 15 started within seven seconds of each other, among the first 20 runs to start, and 7 of them were runs without the skill. The skill loaded in none of the 8 with-skill should-trigger runs among them: all three runs of recall-four-families and of recall-request-rate-numbers, and one run each of recall-explicit-vs-implicit-deny and smoke-403-kms. I do not know its cause. Every with-skill run of recall-four-families and recall-request-rate-numbers started this way, so this run does not show whether my skill loads for those two prompts in a normal session. In the other 46 with-skill should-trigger runs the skill loaded in 39. The 7 misses there are all three runs of recall-lifecycle-conflict-and-waterfall, two of recall-403-evaluation-order-and-same-account-boolean, and one each of recall-existing-objects-replication and recall-severity-levels. That makes 15 misses in the 54 with-skill should-trigger runs (8 + 7), and three should-trigger cases that never loaded the skill in any run: recall-four-families, recall-request-rate-numbers and recall-lifecycle-conflict-and-waterfall. recall-request-rate-numbers passed 0 of 12 checks with the skill available and 5 of 12 without, and met the expected output in 0 of 3 runs on each side. In two runs of recall-request-rate-numbers the agent loaded a different skill, verifying-with-docs.

20 runs report a runtime of 0s and a cost of $0.00, 7 with the skill and 13 without, although each has a 7-record journal and graded assertions. None of the 20 made a tool call, and every run with a runtime above 0s made at least one, so I read the zeros as the way the tool measures an answer without tool calls, not as runs that did not execute. 12 of the 20 are among the 15 runs that started with a smaller context.

Apart from the replacements listed under "Required before review", the result files are as the tool wrote them. The 39 journals that loaded the skill show version: "1.0.0" in the SKILL.md text the agent read, the version this PR adds.

I also ran the README's three Chat prompts in two live AWS Ops Agent (formerly AWS DevOps Agent) sessions, on 2026-12-02 with an earlier draft of the skill and on 2026-12-03 with the skill files in this PR, both uploaded with the SDK's upload command. The skill loaded on all three prompts each time, and the agent's reads of references/REFERENCE.md succeeded on that upload's folder-prefixed layout. I did not run a live session without the skill; the 54 without-skill runs of the functional suite are that comparison.

Skills — complete if this PR adds or changes a skill

  • SKILL.md frontmatter is valid: name matches the directory, description present and within length limits, body at most 500 lines. Here: description is 1,004 characters, the body is 259 lines, and metadata.summary is 146 characters.
  • The description is written from the agent's point of view — scenarios, services, error types, symptoms. Here: scenarios, error codes and symptoms, with a referral to the posture-review skill.
  • Scoped to a specific agent type in metadata.aws-devops-agent-skills.agent-types (INCIDENT_RCA, INCIDENT_TRIAGE, INCIDENT_MITIGATION, …), not left GENERIC without reason. Here: CHAT, INCIDENT_RCA.
  • Procedures are structured as decision trees on real conditions, not flat prose. Here: one tree per family, in references/REFERENCE.md sections (a) to (d), each loaded from the reference map in SKILL.md.
  • Reference material lives in references/ or assets/ and loads on demand. Here: ten load-when pointers to references/REFERENCE.md sections and one to the sample context in assets/.
  • Non-executable content only — no scripts or code in the skill directory. Deterministic compute belongs in an MCP server. Here: Markdown and JSON, plus the .skilleval.yaml audit setting; no scripts or code.

Security and safety

  • Read-only by default; any action that changes customer state is explicit, documented, and approval-gated. Here: the skill has no action that changes customer state.
  • Customer data stays in the customer's account.
  • No destructive operations without an explicit, documented confirmation step. Here: no destructive operations at all.

License confirmation

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.

This description was drafted with an AI assistant and reviewed by me.

Adds a skill that diagnoses an active Amazon S3 failure in one of four
families: access-denied, replication, lifecycle, and request-rate errors
(503 SlowDown and 500 InternalError). It collects the bucket's actual
configuration through control-plane, read-only APIs, walks a decision tree
per family, assigns a severity and writes a shareable Markdown report. It
never reads or writes object data and never changes a resource; every fix
is a recommendation. Evals: 26 cases in evals/evals.json (18 that should
trigger the skill and 8 that should not). Structure scored 100, and best
practices scored 88, 100 and 100 in three iterations. In the functional
run (three iterations of every case), the skill loaded in 39 of the 54
runs that should trigger it and in none of the 24 runs that should not;
8 of those 54 runs started with a smaller agent context and did not load
the skill.
skills/storage-s3-failure-diagnosis/README.md, section "Packaging and
Upload".

The zip upload is now Option A and recommended. The repository import is
Option B: it states the User Guide limits for an imported directory (at
most 100 files and 6 MB), that this directory holds 280 files (272 under
evals/) and about 7 MB, so pointing the import at the directory is
refused ("Repository scope contains 280 files, exceeds the import
limit", tested 2026-12-04), and how to import a copy of the zip file set
(SKILL.md, references/, assets/, automation/iam-policy.json) from a
repository the connected GitHub account can read: Knowledge page, Skills
tab, Add skill, Import from repository, the directory's GitHub URL,
agent types Chat tasks and Incident RCA, status Active, Import skill.
The note on connecting a personal GitHub account moved with the import
text and no longer names this repository as one you can import. Option C
now says "the same zip upload".

Source: AWS Ops Agent User Guide,
about-aws-devops-agent-devops-agent-skills, "Importing a skill from a
repository" (its Constraints and its steps), read 2026-12-04.

No other file changes. metadata.version stays 1.0.0: this branch adds
the skill at 1.0.0, so there is no earlier version to bump from.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant