Skip to main content

aiyoplane-google-adk

AEAP Composition Boundary Adapter for Google ADK.

A thin wrapper that attaches the AEAP Runtime Decision Point (RDP) to Google ADK's tool invocation surface. Consequential tool executions — including code execution and sandboxed environment operations — produce independently verifiable Execution Receipts.

pip install aiyoplane-google-adk

Why Google ADK + AEAP

Google ADK already reaches into agent runtime code execution and sandboxed environments. Those are prime AEAP territory: code execution, external API calls, cloud resource mutations, and economic actions are all consequential and benefit from the "before this crosses the boundary, authorize it" property AEAP provides. ADK owns the runtime; AEAP owns the authorization semantics at the consequential-execution boundary. Clean architectural separation.

See the AEAP specification §9.

Minimal usage — decorator

from google.adk.agents import Agent
from aiyoplane_mcp_authz import create_aiyo_mcp_authz, create_local_rdp
from aiyoplane_google_adk import aiyo_tool, BlockedByPolicy, EscalationRequired

policy = {
    "rules": [
        {"action_type": "code_execution", "language": "python", "effect": "allow"},
        {"action_type": "code_execution", "effect": "escalate"},
    ]
}

authz = create_aiyo_mcp_authz(
    rdp=create_local_rdp(policy=policy),
    tool_config={
        "run_code": {"aiyo_gated": True, "action": {"type": "code_execution"}},
    },
)

@aiyo_tool(
    authz=authz,
    tool_name="run_code",
    intent_builder=lambda kw: {
        "type": "code_execution",
        "language": kw["language"],
        "code_hash": compute_hash(kw["code"]),
    },
)
def run_code(language: str, code: str) -> str:
    """Execute code in a sandbox."""
    return sandbox_exec(language, code)

agent = Agent(
    name="coder",
    model="gemini-1.5-pro",
    tools=[run_code],
    instruction="Help the user execute code safely.",
)

Minimal usage — function form

from aiyoplane_google_adk import wrap_tool_function

def run_code(language: str, code: str) -> str:
    return sandbox_exec(language, code)

guarded = wrap_tool_function(
    run_code,
    authz=authz,
    tool_name="run_code",
    intent_builder=lambda kw: {"type": "code_execution", "language": kw["language"]},
)

Composition Boundary — what the adapter actually does

  1. Intent construction via intent_builder(tool_kwargs).
  2. RDP evaluation via aiyoplane-mcp-authz.
  3. Verdict composition. ALLOW → inner function runs; ESCALATE → EscalationRequired; BLOCK → BlockedByPolicy.
  4. Fail-closed default on every ambiguous condition.

Local vs. hosted RDP

from aiyoplane_mcp_authz import create_local_rdp, create_hosted_rdp

# Development:
authz = create_aiyo_mcp_authz(rdp=create_local_rdp(policy=policy), tool_config={...})

# Production:
authz = create_aiyo_mcp_authz(
    rdp=create_hosted_rdp(api_key="aiyo_live_..."),
    tool_config={...},
)

API reference

aiyo_tool(*, authz, tool_name, intent_builder, attach_receipt=False)

Decorator form.

wrap_tool_function(fn, *, authz, tool_name, intent_builder, attach_receipt=False)

Function form.

Exceptions

  • AiyoGoogleADKError, AdapterConfigError, BlockedByPolicy, EscalationRequired

License

Apache License 2.0.

Google, Google ADK, Gemini, and Google Cloud are trademarks of Google LLC. This package is an independent AEAP Composition Boundary Adapter and is not affiliated with or endorsed by Google LLC.

Verify First. Execute Second.

Metadata

Release files for aiyoplane-google-adk 1.0.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 aiyoplane-google-adk 1.0.0
File Size Uploaded
aiyoplane_google_adk-1.0.0.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiyoplane-google-adk 1.0.0
File Interpreter ABI Platform
aiyoplane_google_adk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / aiyoplane_google_adk-1.0.0.tar.gz

Download URL aiyoplane_google_adk-1.0.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
53d2b8bdc159716b07b956917e6d58e8e0161520238403b770ca010207fb5370
BLAKE2b-256 checksum
How to use checksums
a68ccdda65c10356911a00867f47298dd8ab6280c794b4c5e037e4e4d946c3d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0rc3

Release files / aiyoplane_google_adk-1.0.0-py3-none-any.whl

Download URL aiyoplane_google_adk-1.0.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4943f4f48c23c8a268653b57dac4d8265770baebe339e305c054afe6130aab06
BLAKE2b-256 checksum
How to use checksums
7bf5d1aa790a25453e53834654160831c2e9198a01b07908cac68657861c2bb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0rc3

Release history Release notifications | RSS feed

This release

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