Skip to content

fix(eval): reject an ARN for config-bundle / gateway / online-eval ids - #2352

Draft
jariy17 wants to merge 2 commits into
refactorfrom
fix/eval-accept-arn-ids
Draft

jariy17 wants to merge 2 commits into
refactorfrom
fix/eval-accept-arn-ids

Conversation

@jariy17

@jariy17 jariy17 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Problem

For agentcore eval config-bundle list (and the other eval commands that take --id/--gateway/--online-eval), if you pass in an ARN instead of the bare id, the API throws a misleading AccessDenied error. (The ARN's slashes make the service misparse the request path as an unknown operation, which surfaces as a permissions error rather than a validation one.)

Fix

I decided to validate that the id is not an ARN and throw an error — an actionable InputValidationError instead of letting the request go through and hit the misleading AccessDenied:

--id must be a bare resource id, not an ARN (pass the id, e.g. the segment after the last '/').

Guarded at the core-method boundary for config-bundle (get/update/delete/listVersions), online-eval (get/update/setExecutionStatus/delete), and the createABTest gateway lookup (both A/B variants).

Tests

Config-bundle core test: a full ARN rejects with the bare-id message before any SDK call; a bare id still works. Full eval suite green; typecheck clean.

…l ids

`project status` prints ARNs, but the eval config-bundle, gateway, and
online-eval commands sent the id straight into the request path. An ARN's
slashes make the service parse the path as an unknown operation and return a
misleading AccessDenied instead of a validation error.

Normalize these ids with the existing serviceIdFromArn (ARN -> bare id, non-ARN
passes through) at the core-method boundary: config-bundle get/update/delete/
version-list, online-eval get/update/set-status/delete, and the gateway lookup
in createABTest.
@github-actions github-actions Bot added the size/s PR size: S label Sep 21, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 21, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

The fix is well-targeted: normalizing IDs at the core-method boundary with the existing serviceIdFromArn (which passes non-ARN inputs through unchanged) is the right lever, and it's applied consistently to every touched entry point. The added test mocks only at the SDK client boundary and asserts the bare id lands in every command variant (get / list versions / delete / update-with-read).

One adjacent gap worth considering (optional, not a blocker for this PR since it's out of the stated scope):

  • src/core/eval.tsx lines 1161–1163 (setOnlineInsightExecutionStatus) and 1175–1177 (deleteOnlineInsight) do a pre-check GetOnlineEvaluationConfigCommand({ onlineEvaluationConfigId: id }) with the raw id before delegating to the now-normalized setOnlineEvaluationExecutionStatus / deleteOnlineEvaluationConfig. Because online-insight configs are the same underlying resource as online-eval configs, an ARN passed to eval online-insight pause/resume/delete would still hit the same misleading AccessDenied on the pre-check. Fix would be a one-line id = serviceIdFromArn(id); at the top of each method (or normalize once before the GetOnlineEvaluationConfigCommand call). Fine to defer to a follow-up if that's out of scope here.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 21, 2026
@codecov-commenter

codecov-commenter commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (a23e472) to head (17eae89).
⚠️ Report is 1 commits behind head on refactor.

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2352   +/-   ##
=========================================
  Coverage     97.26%   97.26%           
=========================================
  Files           610      610           
  Lines         40590    40609   +19     
=========================================
+ Hits          39480    39499   +19     
  Misses         1110     1110           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Per review: these ids should be bare, not ARNs. Instead of silently extracting
the id from an ARN, reject it with an actionable InputValidationError naming the
option, so the misleading AccessDenied is replaced by a clear "pass the bare id"
message. Config-bundle, online-eval, and the createABTest gateway are guarded.
@jariy17 jariy17 changed the title fix(eval): accept a full ARN for config-bundle / gateway / online-eval ids fix(eval): reject an ARN for config-bundle / gateway / online-eval ids Sep 21, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 21, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 21, 2026
@jariy17
jariy17 marked this pull request as draft September 21, 2026 18:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants