akeyless-agentcore-runtime
Fetch Akeyless secrets at runtime on AWS Bedrock AgentCore. Authenticate with cloud identity (AWS IAM) — no long-lived API keys in your agent deployment. Application secrets stay in Akeyless, not AWS Secrets Manager.
Built on the Akeyless Python SDK with AgentCore-specific auth, path conventions, caching, and optional MCP tools.
Repository: github.com/akeyless-community/bedrock-agentcore-akeyless-runtime
Documentation
| Guide | Description |
|---|---|
| Installation | pip install — no git clone required |
| Publishing to PyPI | Trusted publishing setup for maintainers |
| Akeyless setup | Auth method, RBAC, secret paths — do this first |
| Deployment patterns | In-agent fetch, hybrid, MCP server, Gateway Lambda |
| Examples | Runnable sample agents |
| Security | Production checklist and reporting |
| Maintainer guide | Branch protection, approvals, PyPI environment |
| Contributing | Development setup and PR guidelines |
Why this integration?
| Concern | AWS default pattern | This integration |
|---|---|---|
| Authentication to secrets platform | IAM role → Secrets Manager | IAM role → Akeyless (AWS IAM auth method) |
| Secret storage | AWS Secrets Manager | Akeyless (static, dynamic, rotated) |
| Bootstrap credentials | None (IAM only) | Only AKEYLESS_ACCESS_ID (no secret key) |
| Rotation & governance | Secrets Manager policies | Akeyless RBAC, rotation, audit |
AgentCore Runtime provides an IAM execution role with ambient AWS credentials. This library uses those credentials to generate an Akeyless cloud ID and authenticate — the same pattern used by EKS, Lambda, and other Akeyless integrations.
Install
No git clone needed. Add to your agent project and install with pip.
From PyPI (recommended)
pip install akeyless-agentcore-runtime
See docs/PYPI_PUBLISHING.md for maintainer setup. The package is not on PyPI yet — use GitHub install below until the first release is published.
From GitHub (available now)
pip install "akeyless-agentcore-runtime @ git+https://github.com/akeyless-community/bedrock-agentcore-akeyless-runtime.git@v0.3.0"
Add to your AgentCore requirements.txt:
akeyless-agentcore-runtime @ git+https://github.com/akeyless-community/bedrock-agentcore-akeyless-runtime.git@v0.3.0
bedrock-agentcore>=0.1.0
Full install guide (extras, MCP CLI, verification): docs/INSTALL.md
Requires Python 3.10+.
Quick start
1. Configure Akeyless
Follow docs/AKEYLESS_SETUP.md — create an AWS IAM Auth Method, RBAC, and store secrets under /bedrock-agentcore/<agent>/<env>/.
2. Set bootstrap env vars on AgentCore
Configure only auth + path prefix — not application secrets:
| Variable | Required | Example |
|---|---|---|
AKEYLESS_ACCESS_ID |
Yes | p-xxxxx |
AKEYLESS_ACCESS_TYPE |
No (default: aws_iam) |
aws_iam |
AKEYLESS_SECRET_PREFIX |
Recommended | /bedrock-agentcore/my-agent/production |
AKEYLESS_GATEWAY_URL |
No | https://api.akeyless.io |
3. Fetch a secret in your agent
from akeyless_agentcore import get_secret
api_key = get_secret("OPENAI_API_KEY")
Works in both sync scripts and async def AgentCore handlers — it calls the Akeyless SDK directly (blocking HTTP, cached between invocations).
4. Deploy
agentcore deploy
See examples/strands-agent/ for a complete agent.
Two ways to retrieve secrets
| API | Who calls it | Purpose |
|---|---|---|
get_secret() |
Your Python code | Bootstrap secrets (e.g. model API key at startup) |
get_akeyless_secret (tool) |
The LLM agent | On-demand secrets via Strands / MCP / Gateway |
Both use the same Akeyless SDK under the hood (auth + get_secret_value). The tool adds a JSON response layer for agent frameworks.
from akeyless_agentcore import get_secret
from akeyless_agentcore.tools.strands import create_strands_tools
api_key = get_secret("OPENAI_API_KEY") # you call this
agent = Agent(model=model, tools=create_strands_tools()) # agent calls get_akeyless_secret
Recommended production pattern: both — see examples/hybrid-agent/.
Full details: docs/DEPLOYMENT.md
API reference
get_secret(name) — fetch a secret from your code
from akeyless_agentcore import get_secret
api_key = get_secret("OPENAI_API_KEY")
AkeylessRuntimeClient — full client
from akeyless_agentcore import AkeylessRuntimeClient
client = AkeylessRuntimeClient(
gateway_url="https://api.akeyless.io",
secret_prefix="/bedrock-agentcore/my-agent/production",
access_id="p-xxxxx",
access_type="aws_iam",
)
client.get_secret("OPENAI_API_KEY")
client.get_secret_json("APP_CONFIG")
client.get_dynamic_secret("aws-creds")
client.get_rotated_secret("api-key")
client.list_secrets()
Agent tools — get_akeyless_secret / list_akeyless_secrets
from akeyless_agentcore.tools.strands import create_strands_tools
# or: pip install 'akeyless-agentcore-runtime[mcp]' for MCP server
Authentication
| Method | AKEYLESS_ACCESS_TYPE |
Additional env |
|---|---|---|
| AWS IAM (recommended) | aws_iam |
AKEYLESS_ACCESS_ID |
| Access key | access_key |
AKEYLESS_ACCESS_ID, AKEYLESS_ACCESS_KEY |
| API key | api_key |
AKEYLESS_ACCESS_ID, AKEYLESS_ACCESS_KEY |
| Universal Identity | universal_identity |
AKEYLESS_UID_TOKEN |
| JWT | jwt |
AKEYLESS_ACCESS_ID, AKEYLESS_JWT |
| Pre-authenticated | — | AKEYLESS_TOKEN |
Architecture
sequenceDiagram
participant Agent as AgentCore Runtime
participant Lib as akeyless-agentcore-runtime
participant AWS as AWS STS/IAM
participant AKL as Akeyless Gateway
Agent->>Lib: get_secret("OPENAI_API_KEY")
Lib->>AWS: Generate cloud ID (SigV4 GetCallerIdentity)
AWS-->>Lib: Signed identity proof
Lib->>AKL: POST /auth (access_id, aws_iam, cloud_id)
AKL-->>Lib: Session token
Lib->>AKL: GET /get-secret-value
AKL-->>Lib: Secret value
Lib-->>Agent: OPENAI_API_KEY
Local development
export AKEYLESS_ACCESS_ID=p-xxxxx
export AKEYLESS_ACCESS_TYPE=access_key
export AKEYLESS_ACCESS_KEY=your-readonly-key
export AKEYLESS_SECRET_PREFIX=/bedrock-agentcore/my-agent/dev
python3 -c "from akeyless_agentcore import get_secret; print(get_secret('OPENAI_API_KEY')[:8] + '...')"
Related community projects
- netlify-akeyless-runtime — Netlify Functions
- fly-akeyless-runtime — Fly.io Machines
- vercel-akeyless-runtime — Vercel serverless
- heroku-akeyless-runtime — Heroku dynos
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file akeyless_agentcore_runtime-0.3.0.tar.gz.
File metadata
- Download URL: akeyless_agentcore_runtime-0.3.0.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffa3947ee27876320e959ddd26e72e9f533cdb02def8030d01bc44aa466f0b28
|
|
| MD5 |
ec56ce2ca3dafd61acdb876e447bc016
|
|
| BLAKE2b-256 |
db4857850edc309c9fc6e0d4eaa1e45ee50ca0b16a854b7650104cf863530eaf
|
Provenance
The following attestation bundles were made for akeyless_agentcore_runtime-0.3.0.tar.gz:
Publisher:
publish.yml on akeyless-community/bedrock-agentcore-akeyless-runtime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
akeyless_agentcore_runtime-0.3.0.tar.gz -
Subject digest:
ffa3947ee27876320e959ddd26e72e9f533cdb02def8030d01bc44aa466f0b28 - Sigstore transparency entry: 2167119974
- Sigstore integration time:
-
Permalink:
akeyless-community/bedrock-agentcore-akeyless-runtime@5603586f7adbf94cf94f0cca8005edf9533e2877 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/akeyless-community
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5603586f7adbf94cf94f0cca8005edf9533e2877 -
Trigger Event:
release
-
Statement type:
File details
Details for the file akeyless_agentcore_runtime-0.3.0-py3-none-any.whl.
File metadata
- Download URL: akeyless_agentcore_runtime-0.3.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
849fc0a8fbdd40336cfb2597115212304eb862c00b5342edd4b1a19a1e6ee8f0
|
|
| MD5 |
b9dbbe9e1a92d9ab9648f725a35687d0
|
|
| BLAKE2b-256 |
7ef1aaa585d507e4a3d76cd117b17d7ad2823f5d1b39eb0ae834113152776b5e
|
Provenance
The following attestation bundles were made for akeyless_agentcore_runtime-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on akeyless-community/bedrock-agentcore-akeyless-runtime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
akeyless_agentcore_runtime-0.3.0-py3-none-any.whl -
Subject digest:
849fc0a8fbdd40336cfb2597115212304eb862c00b5342edd4b1a19a1e6ee8f0 - Sigstore transparency entry: 2167119992
- Sigstore integration time:
-
Permalink:
akeyless-community/bedrock-agentcore-akeyless-runtime@5603586f7adbf94cf94f0cca8005edf9533e2877 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/akeyless-community
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5603586f7adbf94cf94f0cca8005edf9533e2877 -
Trigger Event:
release
-
Statement type: