hermes - 💡(How to fix) Fix Auxiliary client (title-gen / compress) cannot use AWS Bedrock Bearer Token (AWS_BEARER_TOKEN_BEDROCK) — anthropic SDK 0.87.0 CVE-pin lacks api_key parameter [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Hermes' main agent path supports AWS Bedrock Bearer Token authentication (AWS_BEARER_TOKEN_BEDROCK) via agent/bedrock_adapter.py, which uses boto3's native Converse API. The auxiliary client path (title-gen, compression-summary, etc.) for the same Bedrock provider does NOT support Bearer Token auth, because:

  1. tools/lazy_deps.py:81 pins anthropic==0.87.0 for CVE-2026-34450 / CVE-2026-34452.
  2. anthropic==0.87.0 AnthropicBedrock SDK lacks the api_key parameter (added in anthropic >= 0.99.x).
  3. Without api_key, AnthropicBedrock falls back to the boto3 SigV4 credential chain, which does not recognize AWS_BEARER_TOKEN_BEDROCK.
  4. Result: every auxiliary call against a Bedrock model fails with HTTP 403 "could not resolve credentials from session" (visible to end-users on Slack as a :warning: Auxiliary title generation failed: banner above each gateway reply).

Reproducer environment:

  • Hermes Agent v0.14.0 + 49 commits past 2026.5.16 release
  • macOS launchd gateway (1 user, single-tenant deployment)
  • Provider config: auxiliary.title_generation.provider: bedrock, auxiliary.title_generation.model: us.anthropic.claude-haiku-4-5-20251001-v1:0
  • Auth: AWS_BEARER_TOKEN_BEDROCK in .env (HF-provisioned token), AWS_REGION=us-east-1
  • Main agent path with same model & token: ✅ Works (boto3 Converse API recognizes Bearer Token)
  • Auxiliary path with same model & token: ❌ HTTP 403

Error Message

Literal dict lookup against PROVIDER_REGISTRY keyed bedrock. Main agent path (runtime_provider.py) canonicalizes provider names. Auxiliary does not. This means provider: amazon-bedrock (as exposed by hermes_cli/auth.py:441 and accepted by model_aliases: blocks for the main agent) silently falls through here and emits the misleading AMAZON-BEDROCK_API_KEY env-var-not-found error before the real Bearer Token issue is ever hit.

Root Cause

Hermes' main agent path supports AWS Bedrock Bearer Token authentication (AWS_BEARER_TOKEN_BEDROCK) via agent/bedrock_adapter.py, which uses boto3's native Converse API. The auxiliary client path (title-gen, compression-summary, etc.) for the same Bedrock provider does NOT support Bearer Token auth, because:

Fix Action

Fix / Workaround

  1. Patch build_anthropic_bedrock_client to detect AWS_BEARER_TOKEN_BEDROCK and route via boto3 Converse API directly (mirroring the main agent's bedrock_adapter._get_bedrock_runtime_client). This unblocks Bearer Token auth without waiting for an anthropic SDK upgrade. Trade-off: loses anthropic SDK features like prompt caching / thinking budgets — acceptable for auxiliary tasks (title-gen, compress-summary) which don't need them.

Workaround (current)

Code Example

"provider.anthropic": ("anthropic==0.87.0",),  # CVE-2026-34450, CVE-2026-34452

---

return _anthropic_sdk.AnthropicBedrock(
    aws_region=region,
    ...  # no api_key=, no AWS_BEARER_TOKEN_BEDROCK pickup
)

---

['self', 'aws_secret_key', 'aws_access_key', 'aws_region', 'aws_profile',
 'aws_session_token', 'base_url', 'timeout', 'max_retries', 'default_headers',
 'default_query', 'http_client', '_strict_response_validation']

---

pconfig = PROVIDER_REGISTRY.get(provider)
if pconfig is None:
    logger.warning("resolve_provider_client: unknown provider %r", provider)
    return None, None
RAW_BUFFERClick to expand / collapse

Summary

Hermes' main agent path supports AWS Bedrock Bearer Token authentication (AWS_BEARER_TOKEN_BEDROCK) via agent/bedrock_adapter.py, which uses boto3's native Converse API. The auxiliary client path (title-gen, compression-summary, etc.) for the same Bedrock provider does NOT support Bearer Token auth, because:

  1. tools/lazy_deps.py:81 pins anthropic==0.87.0 for CVE-2026-34450 / CVE-2026-34452.
  2. anthropic==0.87.0 AnthropicBedrock SDK lacks the api_key parameter (added in anthropic >= 0.99.x).
  3. Without api_key, AnthropicBedrock falls back to the boto3 SigV4 credential chain, which does not recognize AWS_BEARER_TOKEN_BEDROCK.
  4. Result: every auxiliary call against a Bedrock model fails with HTTP 403 "could not resolve credentials from session" (visible to end-users on Slack as a :warning: Auxiliary title generation failed: banner above each gateway reply).

Reproducer environment:

  • Hermes Agent v0.14.0 + 49 commits past 2026.5.16 release
  • macOS launchd gateway (1 user, single-tenant deployment)
  • Provider config: auxiliary.title_generation.provider: bedrock, auxiliary.title_generation.model: us.anthropic.claude-haiku-4-5-20251001-v1:0
  • Auth: AWS_BEARER_TOKEN_BEDROCK in .env (HF-provisioned token), AWS_REGION=us-east-1
  • Main agent path with same model & token: ✅ Works (boto3 Converse API recognizes Bearer Token)
  • Auxiliary path with same model & token: ❌ HTTP 403

Validation matrix (tested 2026-05-20)

Scenarioanthropic versionAWS_BEARER_TOKEN_BEDROCKResult
Standalone Python in Hermes venv post-manual-upgrade0.103.1yes✅ OK
Same Python, no manual upgrade0.87.0yes❌ "could not resolve credentials"
Hermes gateway runtime (lazy_deps auto-reverts upgrade on next boot)0.87.0yes❌ "could not resolve credentials"
Hermes main agent path (hermes -z --model haiku-4-5)0.87.0yes✅ OK (uses bedrock_adapter → boto3 Converse, not AnthropicBedrock SDK)

Root-cause references

tools/lazy_deps.py:81:

"provider.anthropic": ("anthropic==0.87.0",),  # CVE-2026-34450, CVE-2026-34452

agent/anthropic_adapter.py:760-790 (build_anthropic_bedrock_client):

return _anthropic_sdk.AnthropicBedrock(
    aws_region=region,
    ...  # no api_key=, no AWS_BEARER_TOKEN_BEDROCK pickup
)

Inspected signature of installed anthropic==0.87.0 AnthropicBedrock.__init__:

['self', 'aws_secret_key', 'aws_access_key', 'aws_region', 'aws_profile',
 'aws_session_token', 'base_url', 'timeout', 'max_retries', 'default_headers',
 'default_query', 'http_client', '_strict_response_validation']

→ no api_key parameter.

Secondary finding: provider canonicalization gap

agent/auxiliary_client.py:3481:

pconfig = PROVIDER_REGISTRY.get(provider)
if pconfig is None:
    logger.warning("resolve_provider_client: unknown provider %r", provider)
    return None, None

Literal dict lookup against PROVIDER_REGISTRY keyed bedrock. Main agent path (runtime_provider.py) canonicalizes provider names. Auxiliary does not. This means provider: amazon-bedrock (as exposed by hermes_cli/auth.py:441 and accepted by model_aliases: blocks for the main agent) silently falls through here and emits the misleading AMAZON-BEDROCK_API_KEY env-var-not-found error before the real Bearer Token issue is ever hit.

We worked around this in our config by using provider: bedrock for the auxiliary block, but the alias amazon-bedrock should be accepted in both paths for consistency.

Suggested fixes (in priority order)

  1. Patch build_anthropic_bedrock_client to detect AWS_BEARER_TOKEN_BEDROCK and route via boto3 Converse API directly (mirroring the main agent's bedrock_adapter._get_bedrock_runtime_client). This unblocks Bearer Token auth without waiting for an anthropic SDK upgrade. Trade-off: loses anthropic SDK features like prompt caching / thinking budgets — acceptable for auxiliary tasks (title-gen, compress-summary) which don't need them.

  2. Bump anthropic past 0.99.x once a CVE-clean version exists, then add api_key=os.environ.get("AWS_BEARER_TOKEN_BEDROCK") to the AnthropicBedrock(...) call in build_anthropic_bedrock_client. Future-proof.

  3. Canonicalize provider name in auxiliary_client.py:3481 to accept both amazon-bedrock and bedrock (matching main agent path).

Workaround (current)

Auxiliary providers stay on a non-Bedrock provider (e.g., Azure OpenAI). Main agent Bedrock aliases work fine.

Refs

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING