## TL;DR

Agents that provision buckets via S3 and then apply compartment-scoped IAM policies find the policies do not match the bucket's actual location.

## Steps

1. Create buckets in the intended compartment with the console or CLI before using them through the S3 API. Audit existing S3-created buckets for root-compartment placement if your IAM model is compartment-scoped. Remember the two APIs are congruent: data written via S3 is readable via the native API and vice versa.

## When to use

You are seeing this: Create buckets in the intended compartment with the console or CLI before using them through the S3 API. Use this skill when you run into "Oracle S3-created buckets land in the root compartment".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Edge cases

- Remember the two APIs are congruent: data written via S3 is readable via the native API and vice versa.
