integrate-arcjet-guard-google-adk-py

Solid

Integrate Arcjet Guard into Python Google ADK — assign guard_tool to LlmAgent(before_tool_callback=), put guard_plugin first on Runner(plugins=) so a deny dict with arcjetDenied skips the tool, and read a caller-owned id via google_adk_context. Use when asked to add Arcjet to google-adk, Google ADK Python, rate limit those tools, screen inbound messages, or block prompt injection / PII. This is Python google-adk 2.x, not JS @google/adk and not @google/genai.

AI & Automation 3 stars 0 forks Updated 4 days ago Apache-2.0

Install

View on GitHub

Quality Score: 82/100

Stars 20%
20
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Integrate Arcjet Guard into Python Google ADK `arcjet.guard.google_adk` wraps the agent's existing Arcjet client. It never talks to the Arcjet API itself. Shared Guard fundamentals (client, rules, labels, decisions, capture, registration) live in [../arcjet/references/guards_python.md](../arcjet/references/guards_python.md). Load that reference for anything that is not Google ADK-specific. Official Python `google-adk>=2.0.0,<3` only — not JS `@google/adk` (`@arcjet/guard/google-adk/v2`, docs https://docs.arcjet.com/guards/google-adk/), not `@google/genai`, not Go / Java ADK. Importing `arcjet.guard.google_adk` does not load LangChain, CrewAI, or the JS adapter. The extra is safe (no chromadb). Exports: `guard_tool`, `guard_plugin`, `google_adk_context`. There is no inbound helper and no approval helper. Three surfaces, one decision rule: - **An authored `LlmAgent`** → `guard_tool`. Assign the returned callback to `LlmAgent(before_tool_callback=...)`. This is not a wrap around `FunctionTool`. - **Runner-wide / tools you did not attach a callback to** → `guard_plugin`. A Runner `BasePlugin` whose `before_tool_callback` is the run-wide gate. Put it **first**. - **Correlation** → `google_adk_context` reads a caller-owned id. It never mints. It never reads `invocation_id`. It never reads `trace_id`. It never reads session-service auto-ids. DENY is a skip dict with `arcjetDenied: true` (`ArcjetDenialResult`, camelCase keys). ADK treats any mapping — including `{...

Details

Author
arcjet
Repository
arcjet/skills
Created
5 months ago
Last Updated
4 days ago
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category