# Unverified until the first deploy

Nothing in this POC has run against AWS. It was built from the docs read on 2026-12-01, the service models in boto3/botocore 1.44.17 and the source of the AgentCore SDK 1.30.0. Check each item on the first `make deploy verify` and delete it once confirmed.

## Decisions that differ from the brief

1. **One template, not one per agent.** Both runtimes use the same workload identity template. IAM rejects two templates with the same path prefix and path pattern under one provider (EntityAlreadyExists), and the docs' own demo uses one template: the identity differs because the runtime name and ID are part of the identifier.

## Preview behaviour

2. **No gate on the preview.** The docs describe no allowlist. If `CreateWorkloadIdentityProvider` or `CreateAgentRuntime` with `workloadIdentityTemplateArn` returns AccessDenied or ValidationException for an admin caller, the account is not enabled.
3. **Platform version V2 with direct code deployment in VPC mode in us-east-1.** Each is documented; the combination with a workload identity template is not shown anywhere. V2 availability by Region was not read.
4. **Trust domain.** The provider is named after the project and uses `<account-id>.aws.internal`. Trust domains are unique per account, so if a provider (for example the console's `default`) already uses that domain, creation fails: set `TF_VAR_trust_domain` to another value (for example `agents.field-kit.internal`) for both `make deploy` and `make destroy`.
5. **Template definition with a provider not named `default`.** The docs show `account-provider-default:1` with providers named `default` and `claims`, so this should work.
6. **Bucket policy before identities exist.** Terraform writes the policy from the documented identifier format before any runtime exists. The docs say this is supported. Confirm the real `subject` in CloudTrail matches `spiffe://<trust-domain>/us-east-1/bedrock-agentcore/runtime/agentA/agentA-*`.
7. **S3 accepts `aws:OriginIdentity/*` condition keys in a bucket policy** in the deploy account, as the docs show.
8. **Template propagation.** Invocations can fail with AccessDeniedException for "a few minutes" after the template is created. `agentctl.py invoke` retries for 5 minutes (`INVOKE_WAIT`).

## Network

9. **VPC endpoints.** S3 gateway, plus `logs` and `bedrock-agentcore` interface endpoints. The docs require ECR (containers only), S3 and logs. `bedrock-agentcore` is added because the SDK exchanges the identity context at the AgentCore data plane (`/identities/GetIAMWorkloadIdentityCredentials`, read from the SDK source, not from the docs). No STS endpoint: the SDK does not call STS. If an invocation times out, add `sts` to `TF_VAR_interface_endpoint_services` first.
10. **S3 gateway endpoint policy.** Scoped to the demo bucket and the documented `acr-code-*-<region>-an` service buckets. If runtime creation or start fails on V2 (snapshot build), loosen this policy first.
11. **Security group egress.** HTTPS to the endpoints and the S3 prefix list only. Assumes the microVM reaches its metadata service and DNS without a rule.
12. **Supported AZ IDs.** `use1-az1` and `use1-az2` are from the docs table for us-east-1.

## Agent and execution role

13. **Execution role policy.** Logs statements from the direct code deployment guide plus `s3:GetObject` on the demo and code buckets. X-Ray, CloudWatch metrics and Bedrock model statements are left out because the agent uses none of them. The docs say the role needs no permission for the identity exchange.
14. **Environment variables.** The agent reads `DEMO_BUCKET`, `DEMO_KEY`, `DEMO_REGION` and `AGENT_NAME` set through `environmentVariables`.
15. **Invoke response shape.** `agentctl.py` handles `application/json` and `text/event-stream`, and a JSON string that itself contains JSON.

## CloudTrail evidence

16. **Where `onBehalfOf` appears.** Resolved on first deploy (2026-12-01): it did not appear on any event. Observed in this POC on 2026-12-01 (AgentCore Runtime, us-east-1): no event carried `userIdentity.onBehalfOf`. CloudTrail recorded a `GetIAMWorkloadIdentityCredentials` event from `bedrock-agentcore.amazonaws.com` for each runtime, naming the runtime, the workload identity provider and the role session it issued. The S3 data events show the shared role and that role session name, so the two join on the session name. `agentctl.py evidence` uses that join.
17. **AssumeRole events in Event history.** Resolved on first deploy (2026-12-01): the role session is issued through `GetIAMWorkloadIdentityCredentials`, which is in Event history; no matching `AssumeRole` event was recorded.
18. **Denied data events.** Assumes the trail logs agentB's denied `GetObject` with `errorCode` `AccessDenied` and the caller's access key ID.
19. **Delivery delay.** The 15 minute bound (`EVIDENCE_WAIT=900`) is a working assumption, not a documented figure.

## Teardown

20. **Network interfaces.** AgentCore can keep its network interfaces in the VPC for up to 8 hours after the runtimes are deleted. `make destroy` waits 15 minutes (`ENI_WAIT`); if they are still there, Terraform fails on the subnets and security group and `make destroy` must be run again later. Everything else is removed on the first run.
21. **Provider deletion** is asynchronous; the script polls the deletion task for up to 10 minutes. Its public keys stay published for 12 hours (documented, not a leftover resource).
22. **Runtime log groups.** Assumed to be named `/aws/bedrock-agentcore/runtimes/<runtime-id>-...`; the script deletes groups with the prefixes `agentA-` and `agentB-`.
23. **Service-linked role** `AWSServiceRoleForBedrockAgentCoreNetwork` is created by AgentCore on first VPC use, is shared by the account and is not removed.
24. **Tags on provider and template** are passed at creation (`Tags`); whether the Resource Groups Tagging API lists these resource types for the leftover check is unknown, so `agentctl.py leftovers` checks them by ARN.

## Tooling

25. **Terraform.** hashicorp/aws `~> 6.73` validated this configuration; its resource list was not searched for workload identity resources or a `workload_identity_template_arn` argument on the AgentCore runtime resource. The script is used either way because botocore 1.44.17 has every operation.
26. **AWS CLI 2.37.0** on this machine was not checked for the new commands; nothing in the POC depends on it for them.
27. **Interface endpoint price** (about USD 0.01 per endpoint per AZ per hour) is from memory, not from a pricing page read today.
