integrate-arcjet-guard-strands-agents-py

Integrate Arcjet Guard security rules into Python Strands Agents tools and hooks.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/arcjet/arcjet-plugin --skill integrate-arcjet-guard-strands-agents-py-arcjet
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: integrate-arcjet-guard-strands-agents-py
Source: https://github.com/arcjet/arcjet-plugin/tree/main/plugins/arcjet/skills/integrate-arcjet-guard-strands-agents-py
Command: npx skills add https://github.com/arcjet/arcjet-plugin --skill integrate-arcjet-guard-strands-agents-py-arcjet

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires arcjet, strands-agents.

What problem does it solve? AI agents built with the Python Strands framework can call risky tools, process prompt-injected messages, and leak PII without any policy enforcement. This Skill adds Arcjet Guard protection to those agents so tool calls are rate-limited, screened, and denied before damage occurs. ## Core Features & Use Cases - Authored tool gating: Wrap your own @tool functions with guard_tool to enforce rate limits and rules per tool call. - Unwrapped and MCP tool gating: Attach guard_hooks to Agent(hooks=) so tools you did not author are gated via BeforeToolCallEvent.cancel_tool, with fail-closed deny on errors. - Inbound message screening: Call core aj.guard(...) before the agent runs to block prompt injection and PII, with caller-owned correlation IDs via strands_agent_context. - Use Case: You have a Strands agent with an order-lookup tool and MCP tools. Wrap the lookup with a 10-per-minute TokenBucket keyed on the authenticated user, gate MCP tools with hooks, and screen inbound user text for prompt injection before invoking the agent. ## Quick Start Ask your AI agent to integrate Arcjet Guard into your Python Strands agent by wrapping authored tools with guard_tool and adding guard_hooks for MCP tools.

Frequently Asked Questions about integrate-arcjet-guard-strands-agents-py

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Arcjet Guard to a Python Strands agent?▼

Wrap authored @tool functions with guard_tool and pass guard_hooks to Agent(hooks=) for unwrapped or MCP tools. Screen inbound messages with core aj.guard() before calling the agent, since there is no inbound helper.

How do I rate limit Strands agent tool calls?▼

Create a TokenBucket rule with a refill rate, interval, and max tokens, keyed on the authenticated user ID, then pass it to guard_tool or guard_hooks. Denied calls are blocked via BeforeToolCallEvent.cancel_tool before the tool runs.

Does this work with the JavaScript @strands-agents/sdk?▼

No. This integration is only for the official Python strands-agents package version 1.11.0 or higher, imported as arcjet.guard.strands_agents. The JS SDK uses @arcjet/guard/strands-agents/v1 instead.

Why is arcjet.guard.strands_agents not installing from PyPI?▼

PyPI arcjet 1.0.0 does not include this module yet. Pin arcjet to git SHA 582372916d70311873ef24b7a72443c098b3aec9 with the strands-agents extra, which requires strands-agents>=1.11.0,<2.

What happens when the Arcjet guard is unreachable?▼

guard_tool and guard_hooks default to on_guard_error="deny", so they fail closed by always setting cancel_tool on error. Core guard() fails open, so check decision.has_failed_open() at inbound screening call sites that must fail closed.

Can I use event.interrupt() to deny a Strands tool call?▼

No. BeforeToolCallEvent.interrupt() is human-in-the-loop, not a policy gate. Deny a tool by setting cancel_tool to True or a string containing the JSON ArcjetDenialResult payload.