In an illustrative weekly report job, the bucket policy allows listing for exports/weekly/ but the client passes exports/weekly. An exact StringEquals comparison can deny the second form. Inspect the serialized prefix in the failed request or read the client configuration. If the policy names the intended prefix, check that list request in the same session and keep only the item count.
aws s3api list-objects-v2 --bucket reports-example-444455556666 \
--prefix exports/weekly/ --max-keys 1 --no-paginate --query KeyCount
Use the result to verify the approved prefix without printing object names. A request specifying a delimiter or other policy-relevant attributes should preserve those attributes in the check. S3 ListObjectsV2 permissions ยท S3 prefix condition key