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
Metadata
Release files for akeyless-agentcore-runtime 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| akeyless_agentcore_runtime-0.3.0.tar.gz | 30.0 kB | With provenance | Details for akeyless_agentcore_runtime-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| akeyless_agentcore_runtime-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for akeyless_agentcore_runtime-0.3.0-py3-none-any.whl |
Total release size: 48.0 kB
Release files / akeyless_agentcore_runtime-0.3.0.tar.gz
| Download URL | akeyless_agentcore_runtime-0.3.0.tar.gz |
|---|---|
| Size | 30.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffa3947ee27876320e959ddd26e72e9f533cdb02def8030d01bc44aa466f0b28
|
|
BLAKE2b-256 checksum How to use checksums |
db4857850edc309c9fc6e0d4eaa1e45ee50ca0b16a854b7650104cf863530eaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / akeyless_agentcore_runtime-0.3.0-py3-none-any.whl
| Download URL | akeyless_agentcore_runtime-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
849fc0a8fbdd40336cfb2597115212304eb862c00b5342edd4b1a19a1e6ee8f0
|
|
BLAKE2b-256 checksum How to use checksums |
7ef1aaa585d507e4a3d76cd117b17d7ad2823f5d1b39eb0ae834113152776b5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logSecurity for akeyless-agentcore-runtime 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for akeyless_agentcore_runtime-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.