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:
tools/lazy_deps.py:81 pins anthropic==0.87.0 for CVE-2026-34450 / CVE-2026-34452.
anthropic==0.87.0 AnthropicBedrock SDK lacks the api_key parameter (added in anthropic >= 0.99.x).
- Without
api_key, AnthropicBedrock falls back to the boto3 SigV4 credential chain, which does not recognize AWS_BEARER_TOKEN_BEDROCK.
- 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)
| Scenario |
anthropic version |
AWS_BEARER_TOKEN_BEDROCK |
Result |
| Standalone Python in Hermes venv post-manual-upgrade |
0.103.1 |
yes |
✅ OK |
| Same Python, no manual upgrade |
0.87.0 |
yes |
❌ "could not resolve credentials" |
| Hermes gateway runtime (lazy_deps auto-reverts upgrade on next boot) |
0.87.0 |
yes |
❌ "could not resolve credentials" |
Hermes main agent path (hermes -z --model haiku-4-5) |
0.87.0 |
yes |
✅ 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)
-
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.
-
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.
-
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
Summary
Hermes' main agent path supports AWS Bedrock Bearer Token authentication (
AWS_BEARER_TOKEN_BEDROCK) viaagent/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:tools/lazy_deps.py:81pinsanthropic==0.87.0for CVE-2026-34450 / CVE-2026-34452.anthropic==0.87.0AnthropicBedrock SDK lacks theapi_keyparameter (added in anthropic >= 0.99.x).api_key, AnthropicBedrock falls back to the boto3 SigV4 credential chain, which does not recognizeAWS_BEARER_TOKEN_BEDROCK.:warning: Auxiliary title generation failed:banner above each gateway reply).Reproducer environment:
auxiliary.title_generation.provider: bedrock,auxiliary.title_generation.model: us.anthropic.claude-haiku-4-5-20251001-v1:0AWS_BEARER_TOKEN_BEDROCKin.env(HF-provisioned token),AWS_REGION=us-east-1Validation matrix (tested 2026-05-20)
hermes -z --model haiku-4-5)bedrock_adapter→ boto3 Converse, not AnthropicBedrock SDK)Root-cause references
tools/lazy_deps.py:81:agent/anthropic_adapter.py:760-790(build_anthropic_bedrock_client):Inspected signature of installed
anthropic==0.87.0AnthropicBedrock.__init__:→ no
api_keyparameter.Secondary finding: provider canonicalization gap
agent/auxiliary_client.py:3481:Literal dict lookup against
PROVIDER_REGISTRYkeyedbedrock. Main agent path (runtime_provider.py) canonicalizes provider names. Auxiliary does not. This meansprovider: amazon-bedrock(as exposed byhermes_cli/auth.py:441and accepted bymodel_aliases:blocks for the main agent) silently falls through here and emits the misleadingAMAZON-BEDROCK_API_KEYenv-var-not-found error before the real Bearer Token issue is ever hit.We worked around this in our config by using
provider: bedrockfor the auxiliary block, but the aliasamazon-bedrockshould be accepted in both paths for consistency.Suggested fixes (in priority order)
Patch
build_anthropic_bedrock_clientto detectAWS_BEARER_TOKEN_BEDROCKand route via boto3 Converse API directly (mirroring the main agent'sbedrock_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.Bump
anthropicpast 0.99.x once a CVE-clean version exists, then addapi_key=os.environ.get("AWS_BEARER_TOKEN_BEDROCK")to theAnthropicBedrock(...)call inbuild_anthropic_bedrock_client. Future-proof.Canonicalize provider name in
auxiliary_client.py:3481to accept bothamazon-bedrockandbedrock(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