Signature
Parameters
string
required
The cloud service to authenticate. Uses the format
{provider}_{service}.Examples: "aws_s3", "gcp_bigquery", "azure_storage"string
default:"None"
Override the default region for this service.Example:
"us-west-2", "europe-west1"Returns
An authenticated client from the cloud provider’s SDK:Basic Usage
How It Works
1
Your code calls hexr_tool()
s3 = hexr_tool("aws_s3") — the SDK starts the credential resolution chain.2
L1 cache check (in-memory)
The SDK checks the in-memory L1 cache for existing credentials. On miss, proceeds to L2.
3
L2 cache check (Valkey)
The SDK checks the cluster-wide Valkey L2 cache. On miss, proceeds to credential exchange.
4
Credential exchange
The SDK sends the JWT-SVID to the Credential Injector, which calls AWS
AssumeRoleWithWebIdentity. AWS STS returns {AccessKeyId, SecretKey, Token}.5
Cache and return
Credentials are cached in both L1 (in-memory) and L2 (Valkey cluster-wide). Returns a configured
boto3.client('s3', credentials=...) ready to use.Multi-Cloud Example
Region Override
Error Handling
OPA Policy Scoping
Theresources parameter on @hexr_agent tells OPA which services this agent is allowed to access:
Observability
Everyhexr_tool() call emits OpenTelemetry data:
Span: hexr.tool.invoke
hexr.tool.invocations— Counter by servicehexr.tool.duration— Histogram of call latencyhexr.cache.hits/hexr.cache.misses— Cache performance