Skip to content

fix: reject inline secrets across runtime and identity credential commands - #2080

Merged
jariy17 merged 2 commits into
refactorfrom
feat/runtime-api-key-resolve-secret
Aug 24, 2026
Merged

fix: reject inline secrets across runtime and identity credential commands#2080
jariy17 merged 2 commits into
refactorfrom
feat/runtime-api-key-resolve-secret

Conversation

@tejaskash

@tejaskash tejaskash commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What

Route every secret-value flag through SourceResolver.resolveSecret (stdin - or file:// only, single-line enforced, trailing newline stripped) instead of the generic resolveText. Inline secrets on argv leak into shell history, ps output, and CI logs.

Handlers changed:

Also dropped "inline" from those flags' help text so it matches the enforced contract, aligning with the project add credentials handlers.

Not changed: bearer-token invoke paths (ephemeral, never persisted) and structured-config flags (JSON/tags/free text) that legitimately use resolveText.

Testing

  • tsc --noEmit clean.
  • Tests feeding a secret now pipe it via stdin; added inline-rejection coverage for runtime --api-key, and identity api-key + oauth2 create.
  • Full suite: 1742 pass, 0 fail.

…eSecret

The runtime add handler resolved its --api-key with the generic resolveText,
so an inline secret value was accepted and a trailing newline was not stripped.
Switch to resolveSecret (stdin/file only, single-line enforced), matching the
api-key and oauth credential handlers and the flag's documented contract.
@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Aug 24, 2026
The standalone identity api-key/oauth2 credential-provider create and update
handlers resolved their --api-key / --client-secret with the generic
resolveText, so an inline secret value was accepted and a trailing newline was
not stripped. Inline secrets on argv leak into shell history, ps output, and
CI logs. Switch all four to resolveSecret (stdin '-' or file:// only,
single-line enforced) and drop "inline" from the flag help, matching the
project add credentials and runtime handlers.

Tests feeding a secret now pipe it via stdin; added inline-rejection coverage
for api-key and oauth2 create.
@tejaskash tejaskash changed the title fix(project): resolve runtime --api-key through SourceResolver.resolveSecret fix: reject inline secrets across runtime and identity credential commands Aug 24, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.24%. Comparing base (38c30ae) to head (eaf11b5).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2080   +/-   ##
=========================================
  Coverage     97.24%   97.24%           
=========================================
  Files           396      396           
  Lines         24019    24021    +2     
=========================================
+ Hits          23357    23359    +2     
  Misses          662      662           

☔ 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.

@jariy17
jariy17 merged commit b75e1c6 into refactor Aug 24, 2026
10 checks passed
@jariy17
jariy17 deleted the feat/runtime-api-key-resolve-secret branch August 24, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants