Skip to main content

warden-agent-sdk (Python)

Client SDK for Warden — build and sign canonical Warden delegation tokens, and route agent frameworks through the Warden MCP proxy.

Warden's identity boundary is a single signed token that says who an agent acts for (RFC 8693): sub is the accountable human, act is the nested acting chain whose leaf is the agent, and roles/attrs/rel/scope carry RBAC/ABAC/ReBAC/grant. This SDK is the convenience layer for producing that token and wiring it in. The proxy always accepts a raw conforming token with no SDK at all — this package is convenience, not a new trust surface.

Install

pip install warden-agent-sdk            # core (pure stdlib): token builder + conformance
pip install "warden-agent-sdk[jwt]"     # + asymmetric JWT signing (PyJWT)

Not on PyPI yet? Install from source until the first release:

pip install "git+https://github.com/vijayvedula/warden.git#subdirectory=sdk/python"

Build a token

from warden_sdk import TokenBuilder

tok = (
    TokenBuilder(sub="alice@example.com", agent="prod-agent")
    .via("svc-principal")                     # act chain: alice -> svc -> agent
    .role("analyst")
    .relation("can_read", "table:sales")      # ReBAC
    .grant("query_table")                     # agent's delegated scope
    .audience("warden:prod")
    .expires_in(300)
)

# Local/dev: a keyed dev envelope (verified with `--token-key`)
tok.write_dev_envelope(".warden/token.json", key="dev-secret")

# Production: a compact JWT signed by an asymmetric key (or your KMS)
from warden_sdk import JwtSigner
signer = JwtSigner.from_file("issuer_ec_priv.pem", alg="ES256", default_kid="k1")
jwt = tok.to_jwt(signer, at_jwt=True)

Identity adapters

Map a platform's native identity to canonical claims. Adapters are pure data mapping — they never sign authority themselves.

from warden_sdk.adapters import aws, databricks, google, azure

tok = aws.from_sts_session({
    "accountable": "alice@example.com",
    "session_name": "agent-session",
    "session_tags": {"team": "research"},     # STS session tags -> ABAC attrs
    "iam_roles": ["arn:aws:iam::…:role/analyst"],
    "session_policy_actions": ["query_table"],
}, agent="prod-agent", audience="warden:prod")
Adapter Native source Entry point
aws STS AssumeRole session + session tags (Bedrock AgentCore) from_sts_session
databricks on-behalf-of-user + Unity Catalog grants from_obo
google workload identity / service account (Vertex ADK / A2A) from_workload_identity
azure Entra ID managed identity + OBO from_entra_obo

Orchestration shims

Point an agent framework's MCP client at warden proxy instead of the tool server — no other agent code changes.

from warden_sdk import ProxyConfig
from warden_sdk.orchestration import langgraph as wl
from langchain_mcp_adapters.client import MultiServerMCPClient

cfg = ProxyConfig(upstream="python3 tools_server.py", agent="prod-agent",
                  token=".warden/token.json", audience="warden:prod")
client = MultiServerMCPClient(wl.warden_mcp_servers(cfg))
tools = await client.get_tools()   # discovered THROUGH Warden

warden_sdk.orchestration.google_adk provides the equivalent for the Google ADK MCP toolset.

Conformance

A token is conformant iff it passes warden token verify — the exact check the proxy runs. The kit shells out to the real binary so first-party and community adapters are verifiable against ground truth:

from warden_sdk import TokenBuilder, verify_token

env = TokenBuilder(sub="alice", agent="prod-agent").audience("warden:prod") \
    .dev_envelope(key="dev-secret")
verify_token(env, agent="prod-agent", audience="warden:prod",
             token_key="dev-secret").raise_for_status()

Develop

pip install -e ".[dev]"
cargo build            # from the repo root, so the conformance tests find `warden`
pytest
ruff check .

Source-available under the Functional Source License 1.1 (FSL-1.1-ALv2) — free for any use except a Competing Use; each version becomes Apache-2.0 two years after release. See LICENSE.

Metadata

Release files for warden-agent-sdk 0.1.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 warden-agent-sdk 0.1.0
File Size Uploaded
warden_agent_sdk-0.1.0.tar.gz 20.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for warden-agent-sdk 0.1.0
File Interpreter ABI Platform
warden_agent_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.9 kB

Release files / warden_agent_sdk-0.1.0.tar.gz

Download URL warden_agent_sdk-0.1.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9199cee99129314cec5fb31ed39086f097c22b98f3efcb38b5b616cdc26d8c63
BLAKE2b-256 checksum
How to use checksums
5c8744fb888c9ab21021829ec96fa8e385ffdb56185c99637db544bc839e92fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / warden_agent_sdk-0.1.0-py3-none-any.whl

Download URL warden_agent_sdk-0.1.0-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c119752e8c89d1f9ad83d5f993b32489ed0d5f608492bbb8856cc1187da68cc3
BLAKE2b-256 checksum
How to use checksums
815841346dd4390633337c90e50766651e2902f04b437338f424e8552ccd1442
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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