refactor: move harness resources to .github/harness/#992
Conversation
Package TarballHow to installnpm install https://github.com/aws/agentcore-cli/releases/download/pr-992-tarball/aws-agentcore-0.11.0.tgz |
|
Tokens baked into image layers are extractable by anyone who can pull the image The Dockerfile comment claims "Tokens are passed as build args only — not stored in env vars", but using build args in
Anyone with pull access to the resulting image (e.g., the ECR repo the harness pulls from, any cached layers on build hosts, any mirror/backup) can extract both tokens. This is materially different from "not stored in env vars" — it's arguably worse, because env-var tokens die with the container while baked-in tokens live with every copy of the image. A few options:
Also worth noting: the README's |
Coverage Report
|
Move PR reviewer harness files into a dedicated .github/harness/ directory, separate from the general .github/scripts/ used by Strands workflows. - Move harness_review.py, prompts/ to .github/harness/ - Add Dockerfile for the harness container (dual-token: CLONE_TOKEN for git clones, GITHUB_TOKEN for gh CLI/PR comments) - Add README documenting the harness directory - Update pr-ai-review workflow to reference new path - Update .prettierignore for new prompts location
bf3ff79 to
e1d63ba
Compare
|
Thanks for the thorough review. Going with option 3 for now — updated the Dockerfile comment in ce006eb to accurately state that tokens are baked into the image at build time and the image must be treated as a secret (stored only in a registry with equivalent access controls). This image is only stored in a private ECR repo with access scoped to the same principals that already have the tokens, and rotation-via-rebuild is acceptable for our use case. We can revisit with BuildKit secrets or runtime injection if the access model changes. |
…handling Tokens are baked into image layers at build time — the previous comment incorrectly implied they were not stored. Updated to make the security posture explicit: the image itself must be treated as a secret.
ce006eb to
cf66f28
Compare
Replace manual SigV4 signing + urllib3 + EventStreamBuffer parsing with the native boto3 bedrock-agentcore client's invoke_harness method. This simplifies the code significantly and leverages the typed event stream response from the SDK. Rejected: keep raw HTTP approach | boto3 now supports invoke_harness natively Confidence: high Scope-risk: narrow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit aef3890.
Summary
.github/harness/for AgentCore Harness resources (PR reviewer now, tester later)harness_review.pyandprompts/from.github/scripts/to.github/harness/Dockerfilefor the harness container (dual-token:CLONE_TOKENfor git clones,GITHUB_TOKENfor gh CLI/PR comments)README.mddocumenting the harness directory and build instructionspr-ai-review.ymlworkflow to reference new path.github/scripts/stays untouched for Strands workflowsTest plan
finch buildCLONE_TOKENclones repos inside containerGITHUB_TOKENauthenticatesghCLI and can post PR commentspr-ai-reviewworkflow — ran successfully and posted review comment