Evals match host — access key runbook

The match host is the separate machine that runs live eval matches and, after each turn, uploads eval data (per-match JSON, the manifest, thinking files, in-progress seat files) to the stack's EvalsBucket under the evals/ prefix. Cloudflare serves that prefix publicly at /evals/data/*.

The stack (infra/template.yaml) creates the identity — MatchHostUser with the MatchHostPolicy managed policy attached — but deliberately never creates an access key, so no secret ever lands in CloudFormation state, outputs, or this repo. Minting and rotating the key is a manual operator step, described here.

What the identity can do

Exactly s3:PutObject and s3:DeleteObject on arn:aws:s3:::league-of-agents-<stage>-evals-<account>/evals/* — nothing else: no s3:PutObjectAcl, no listing, no reads beyond what the public already has, no other bucket. The prod policy is mirrored in infra/iam-match-host-policy.json and kept in sync with the template by tests/test_evals_infra.py.

Because the bucket is versioned, an overwrite or delete is recoverable for 30 days (noncurrent versions expire after that): restore a bad upload by copying the previous version back over the current one.

Create the key (run once, as an IAM admin — not the deploy user)

The deploy policy can create and delete the user but intentionally cannot mint keys for it.

# The user name is auto-generated by CloudFormation; read it from the stack.
USER=$(aws cloudformation describe-stacks \
  --stack-name league-of-agents-platform-prod \
  --query "Stacks[0].Outputs[?OutputKey=='MatchHostUserName'].OutputValue" \
  --output text)
BUCKET=$(aws cloudformation describe-stacks \
  --stack-name league-of-agents-platform-prod \
  --query "Stacks[0].Outputs[?OutputKey=='EvalsBucketName'].OutputValue" \
  --output text)
aws iam create-access-key --user-name "$USER"

Where the match host stores it

Smoke-test from the match host (writes and removes one object):

echo '{}' | AWS_PROFILE=league-evals aws s3 cp - "s3://$BUCKET/evals/_probe.json"
AWS_PROFILE=league-evals aws s3 rm "s3://$BUCKET/evals/_probe.json"

Rotate the key

  1. aws iam create-access-key --user-name "$USER" (new key).
  2. Update the profile on the match host and the credential manager.
  3. Confirm an upload succeeds with the new key (smoke test above).
  4. aws iam delete-access-key --user-name "$USER" --access-key-id <old-id>.

Two keys may coexist only during that swap. Rotate at least every 90 days, and immediately if the match host is rebuilt, decommissioned, or the key may have been exposed (in that case delete first, then re-create).

If the stack replaces the user

Deleting the stack, or a change that replaces MatchHostUser, deletes the user and its keys with it (CloudFormation cannot delete a user that still has access keys — delete the key first with aws iam delete-access-key). After redeploy, create a new key as above.