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]"
Cloud identity auth also needs the extra for your provider: aws for aws_iam (installs boto3), azure for azure_ad (installs azure-identity) or gcp for gcp (installs google-auth), for example pip install -e ".[mcp,aws]". The all extra installs MCP and every provider. For GCP, set AKEYLESS_GCP_AUDIENCE if your auth method does not use the default akeyless.io.
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"}}
runtakescommand, plus optionalhost(required when the item has more than one host; the error lists them),cwd,shell(powershellorcmd, WinRM only),host_key_fingerprint(SHA256:<base64>, SSH only), andremote_user(SSH certificate issuers only).upload(remote_path, base64content, at most 512 KB) anddownload(remote_path) move one file.- A run returns
stdout,stderr,exit_code,truncated, and, when sent withcwdor run in PowerShell, thecwdthe command ended in. Pass thatcwdback 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.
Related
- Secrets at runtime (values in agent):
akeyless-agentcore-runtime - Product docs: Agentic Runtime Authority
Metadata
Release files for akeyless-agentcore-rta 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_rta-0.3.0.tar.gz | 34.3 kB | With provenance | Details for akeyless_agentcore_rta-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| akeyless_agentcore_rta-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for akeyless_agentcore_rta-0.3.0-py3-none-any.whl |
Total release size: 60.7 kB
Release files / akeyless_agentcore_rta-0.3.0.tar.gz
| Download URL | akeyless_agentcore_rta-0.3.0.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a7d15cd1adb98ad559faf2d9e93a5e53626070d477c5adb7518130b5395e042
|
|
BLAKE2b-256 checksum How to use checksums |
68284d9c1c245b7b94b3fe87c7793eadd952a77534f2be93f711f3a21e288f12
|
| 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 19, 2026.
Transparency logRelease files / akeyless_agentcore_rta-0.3.0-py3-none-any.whl
| Download URL | akeyless_agentcore_rta-0.3.0-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2376d4878d7c6a2a61f1a84b235a4b5bc73e7e3532a8ea97f8bc0b81f577bfa1
|
|
BLAKE2b-256 checksum How to use checksums |
38ef4ed57167ffcdab3125d67f0681dff7db2ef61fd40813d6fc9535130a8673
|
| 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 19, 2026.
Transparency logSecurity for akeyless-agentcore-rta 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
Both files in this release have been uploaded with provenance metadata.
Attestation for akeyless_agentcore_rta-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 Nov 19, 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.