Skip to main content

Akeyless Agentic Runtime Authority for Amazon Bedrock AgentCore

Python library and Model Context Protocol (MCP) server that gives Amazon Bedrock AgentCore agents access to protected resources through Akeyless Agentic Runtime Authority (ARA). AI agents can query databases, run actions on AWS, Azure, GCP and Kubernetes, and execute commands on Linux (SSH), Windows (WinRM) and LDAP / Active Directory servers, authenticating to the Akeyless Gateway with their AWS IAM role.

AgentCore orchestrates. Akeyless holds the credentials. Secret values never enter the agent or the model context.

Requirements

  • Python 3.10+
  • Akeyless Gateway with ARA enabled (not api.akeyless.io)
  • Auth method your AgentCore role can use (production: AWS IAM cloud identity)

Install (local)

cd bedrock-agentcore-akeyless-rta
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[mcp,dev]"

Quick start — client

from akeyless_agentcore_rta import AkeylessRtaClient

client = AkeylessRtaClient()  # reads AKEYLESS_* env
for s in client.list_secrets():
    print(s.name, s.target_type)  # never prints credentials

rows = client.query_db("SELECT 1", secret_name="/prod/db/readonly")
print(rows.results)

Remote commands (SSH, Windows, LDAP)

service_execute (MCP: service-execute) also runs one non-interactive command on a remote host, with the credentials of the item you name. The Gateway decides how to run it from the item's target type:

Item target_type in list-secrets Runs over
Rotated secret on an SSH target ssh SSH
Rotated secret on a Windows target windows WinRM
Rotated secret on a linked target linked SSH or WinRM, on one of the linked hosts
RDP dynamic secret rdp SSH or WinRM, as the temporary user
LDAP (Active Directory) rotated or dynamic secret ldap WinRM over HTTPS, as the domain user
SSH certificate issuer (secret_type: ssh-cert-issuer) ssh SSH, with a short-lived certificate signed for the call
out = client.service_execute("uptime", secret_name="/servers/web-ssh")
print(out.results[0]["stdout"], out.results[0]["exit_code"])

out = client.service_execute(
    '{"tool":"run","arguments":{"command":"ls","host":"web1.corp","cwd":"/var/log"}}',
    secret_name="/servers/web-ssh",
)

The payload is either a plain command line (uptime, Get-Service) or a sub-tool call for anything else:

{"tool":"run","arguments":{"command":"systemctl status nginx","host":"web1.corp","cwd":"/var/log"}}
  • run takes command, plus optional host (required when the item has more than one host; the error lists them), cwd, shell (powershell or cmd, WinRM only), host_key_fingerprint (SHA256:<base64>, SSH only), and remote_user (SSH certificate issuers only).
  • upload (remote_path, base64 content, at most 512 KB) and download (remote_path) move one file.
  • A run returns stdout, stderr, exit_code, truncated, and, when sent with cwd or run in PowerShell, the cwd the command ended in. Pass that cwd back on the next call, so a series of commands behaves like one shell session.
  • list_sub_tools (MCP: list-sub-tools) on a remote item returns this catalog without connecting to the host.

The same ARA gates apply as for databases: ara_allow_access, input rules (the Gateway ships default rules per target type), AI validation, output rules, and an ARA session record. Remote commands need Gateway 5.6.0 or later; an older Gateway answers unsupported secret type. A remote call can take up to 3.5 minutes on the Gateway.

Quick start — MCP on AgentCore

# env (required)
export AKEYLESS_GATEWAY_URL=https://gw.example.com:8000
export AKEYLESS_ACCESS_ID=p-xxxxx
export AKEYLESS_ACCESS_TYPE=aws_iam   # or access_key locally

python examples/mcp-server/server.py
# AgentCore: protocol MCP → examples/mcp-server/server.py

The MCP tools (list-secrets, query-db, service-execute, list-sub-tools) have the same names, parameters (secret-name, payload, agent-id, original-user, original-prompt, auth-code, state), required fields and descriptions as akeyless mcp-runtime-authority. The Gateway picks how to run each call from the item type.

Environment

Variable Required Notes
AKEYLESS_GATEWAY_URL Yes Customer GW (https://gw:8000 or …/api/v2). Public SaaS rejected.
AKEYLESS_ACCESS_ID Yes* Auth method access id
AKEYLESS_ACCESS_TYPE No Default aws_iam. Also: access_key, oidc, saml, jwt, …
AKEYLESS_ACCESS_KEY For access_key Local/dev only
(OIDC/SAML) — Browser login to Gateway; needs Access ID only
AKEYLESS_AGENT_ID No Default bedrock-agentcore
AKEYLESS_MCP_ID No Default akeyless-agentcore-rta
AKEYLESS_DEFAULT_SECRET_NAME No Optional default path for execute tools

* Or AKEYLESS_TOKEN for a pre-issued session token.

Architecture

sequenceDiagram
    participant U as User
    participant C as Claude Desktop
    participant M as akeyless-claude-mcp
    participant A as Akeyless API
    participant G as Akeyless Gateway
    participant L as AI Quorum (LLMs)
    participant R as Database / Cloud

    U->>C: "Query prod postgres for user count"
    C->>M: list-secrets
    M->>A: list-items (authenticated, role-scoped)
    A-->>M: secret paths + target types (no values)
    M-->>C: /prod/db/postgres-ro
    C->>M: query-db (path + SQL)
    M->>G: POST /config/target_query
    Note over G: 1. RBAC: ARA execute permission on path
    Note over G: 2. Input rules (read-only, no multi-statement...)
    alt Input rule violated
        G-->>M: BLOCKED (never reaches target)
    end
    opt AI Quorum enabled
        G->>L: validate action
        L-->>G: verdicts (any deny = block)
        alt Any model denies
            G-->>M: BLOCKED
        end
    end
    Note over G: 3. Fetch JIT/rotated credential (stays in GW)
    G->>R: execute with credential
    R-->>G: raw results
    Note over G: 4. Output rules (PII, secrets...)
    alt Output rule violated
        G-->>M: BLOCKED / redacted
    end
    G-->>M: JSON results (no credentials)
    M-->>C: { count: 42 }
    C-->>U: "There are 42 users"
    Note over G: ARA session recorded for audit

Docs

Guide Description
Akeyless setup Auth method, ARA RBAC, chicken-and-egg IAM bind
AgentCore deploy MCP protocol, envVars, invoke
Security Checklist
Maintainer guide Branch protection, approvals, PyPI environment
Publishing to PyPI Trusted publishing setup
Contributing Development setup

Repository: github.com/akeyless-community/bedrock-agentcore-akeyless-rta

Development

pip install -e ".[mcp,dev]"
pytest

Run pytest inside this package directory so the workspace root does not collect unrelated tests.

Metadata

Release files for akeyless-agentcore-rta 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akeyless-agentcore-rta 0.2.0
File Size Uploaded Provenance Actions
akeyless_agentcore_rta-0.2.0.tar.gz 32.5 kB With provenance Details for akeyless_agentcore_rta-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for akeyless-agentcore-rta 0.2.0
File Interpreter ABI Platform Actions
akeyless_agentcore_rta-0.2.0-py3-none-any.whl Python 3 none any Details for akeyless_agentcore_rta-0.2.0-py3-none-any.whl

Total release size: 58.2 kB

Release files / akeyless_agentcore_rta-0.2.0.tar.gz

Download URL akeyless_agentcore_rta-0.2.0.tar.gz
Size 32.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c360e99a299d1b7345f8b41c331e2071d2426d6e9eb781f4ddb3452779a06c32
BLAKE2b-256 checksum
How to use checksums
1452080115b1ae0a0d2bb4d520ca3cef23b0392681fc4f01c7af19312633e2c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / akeyless_agentcore_rta-0.2.0-py3-none-any.whl

Download URL akeyless_agentcore_rta-0.2.0-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f08692a39150f1c6b86d3288d745bfa1db6c572a797dd25195d760e5cd666c04
BLAKE2b-256 checksum
How to use checksums
1e83a2bb6a937f4236fa47f80f96e862050c927b1a9c005c2127ce0fef63cf53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for akeyless-agentcore-rta 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for akeyless_agentcore_rta-0.2.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 Nov 17, 2026.

Transparency log

A 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.

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