Skip to main content

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

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

akeyless_agentcore_runtime-0.3.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

akeyless_agentcore_runtime-0.3.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file akeyless_agentcore_runtime-0.3.0.tar.gz.

File metadata

File hashes

Hashes for akeyless_agentcore_runtime-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ffa3947ee27876320e959ddd26e72e9f533cdb02def8030d01bc44aa466f0b28
MD5 ec56ce2ca3dafd61acdb876e447bc016
BLAKE2b-256 db4857850edc309c9fc6e0d4eaa1e45ee50ca0b16a854b7650104cf863530eaf

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file akeyless_agentcore_runtime-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for akeyless_agentcore_runtime-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 849fc0a8fbdd40336cfb2597115212304eb862c00b5342edd4b1a19a1e6ee8f0
MD5 b9dbbe9e1a92d9ab9648f725a35687d0
BLAKE2b-256 7ef1aaa585d507e4a3d76cd117b17d7ad2823f5d1b39eb0ae834113152776b5e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page