Skip to main content

Google Agent Development Kit (ADK) integration for Sardis

Project description

sardis-adk

Google Agent Development Kit (ADK) integration for Sardis -- the Payment OS for the Agent Economy.

Give your Google ADK agents the ability to make real payments, check balances, enforce spending policies, and review transaction history through Sardis.

Installation

pip install sardis-adk

Quick Start

Option 1: Pre-configured Agent

The fastest way to get a payment-capable agent:

from sardis_adk import create_sardis_agent

agent = create_sardis_agent(
    api_key="sk_test_...",
    wallet_id="wallet_abc123",
    model="gemini-2.0-flash",
)

# Use with ADK runner
from google.adk.runners import InMemoryRunner

runner = InMemoryRunner(agent=agent)

Option 2: Toolkit (Bring Your Own Agent)

Add Sardis tools to any existing ADK agent:

from google.adk import Agent
from sardis_adk import SardisToolkit

toolkit = SardisToolkit(api_key="sk_test_...", wallet_id="wallet_abc123")

agent = Agent(
    name="my_agent",
    model="gemini-2.0-flash",
    tools=toolkit.get_tools(),
    instruction="You are a helpful assistant that can make payments.",
)

Option 3: Individual Tools

Use specific tools without the toolkit:

from sardis_adk.tools import sardis_pay, sardis_check_balance, configure
from sardis import SardisClient

client = SardisClient(api_key="sk_test_...")
wallet = client.wallets.create(name="my-agent", chain="base", policy="Max $100/day")

configure(client, wallet.id)

# Now use tools directly
result = sardis_pay(to="openai.com", amount="25.00", purpose="API credits")
print(result["success"])  # True

Available Tools

Tool Description
sardis_pay Execute a payment with automatic policy enforcement
sardis_check_balance Check wallet balance and spending limits
sardis_check_policy Validate whether a payment would be allowed (dry-run)
sardis_set_policy Set or update spending policy using natural language
sardis_list_transactions View recent transaction history

Tool Details

sardis_pay

sardis_pay(
    to="openai.com",        # Recipient address or merchant
    amount="25.00",          # Payment amount
    token="USDC",            # Token type (USDC, USDT, PYUSD, EURC)
    purpose="API credits",   # Reason for payment
)
# Returns: {"success": True, "tx_id": "tx_...", "balance_after": 975.0, ...}

sardis_check_balance

sardis_check_balance(token="USDC", chain="base")
# Returns: {"balance": 1000.0, "remaining": 900.0, "limit_per_tx": 100.0, ...}

sardis_check_policy

sardis_check_policy(to="openai.com", amount="25.00", token="USDC")
# Returns: {"allowed": True, "reason": "All policy checks passed", ...}

sardis_set_policy

sardis_set_policy(policy_text="Max $50 per transaction, daily limit $500")
# Returns: {"success": True, "limit_per_tx": 50.0, "limit_total": 500.0, ...}

sardis_list_transactions

sardis_list_transactions(limit=10)
# Returns: {"count": 3, "transactions": [{"tx_id": "tx_...", ...}, ...]}

Simulation Mode

By default, Sardis runs in simulation mode -- no real money moves and no API key is required. This is ideal for development and testing:

from sardis_adk import SardisToolkit

# Simulation mode (no real transactions)
toolkit = SardisToolkit(api_key="sk_test_demo", wallet_id="wallet_abc")
tools = toolkit.get_tools()

When you are ready for production, use a real API key and Sardis will execute on-chain transactions through non-custodial MPC wallets.

Combining with Other Tools

Sardis tools work alongside any other ADK tools:

from google.adk import Agent
from google.adk.tools import google_search
from sardis_adk import SardisToolkit

toolkit = SardisToolkit(api_key="sk_test_...", wallet_id="wallet_abc")

agent = Agent(
    name="research_and_pay",
    model="gemini-2.0-flash",
    tools=[google_search, *toolkit.get_tools()],
    instruction="Research products and make purchases when instructed.",
)

Requirements

  • Python 3.11+
  • sardis >= 0.3
  • google-adk >= 0.3

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sardis_adk-1.0.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

sardis_adk-1.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file sardis_adk-1.0.0.tar.gz.

File metadata

  • Download URL: sardis_adk-1.0.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sardis_adk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5387988753b16a29e1f0cfe29c3ae3834d83360c9c4037d9beebc0a2e649c65d
MD5 3f31ce122a51d6180dcb30b8b42f8827
BLAKE2b-256 4b312b0292fc7ccf4bf20ba76b759100153ff67cf00a6b7e0d223292f49ec97f

See more details on using hashes here.

File details

Details for the file sardis_adk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sardis_adk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sardis_adk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d6c0db528098ca744a95e0bf762322e13d83ea3833ad7c42900bd188996705a
MD5 570527318c0b74ef45482df97aef764e
BLAKE2b-256 37f215b64f3bf1d8fb52e60c1ecd172de8ea32276187aea6823524b48d76fb69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page