integrate-arcjet-guard-langchain-py
Installation
SKILL.md
Integrate Arcjet Guard into Python LangChain
arcjet.guard.langchain 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.
Load that reference for anything that is not LangChain-specific.
Four surfaces, one decision rule:
- Any Python callable →
guard_action/guard_action_syncin corearcjet.guard. No LangChain extra. Details in the shared Python Guard reference. - A LangChain
BaseToolyou call yourself →guard_tool. DENY raisesArcjetToolDeniedError(the tool'shandle_tool_errormay convert it). create_agent(the model chooses tools) →ArcjetMiddleware+ToolPolicy. Tools without a policy pass through.- Observe a chain or agent →
ArcjetCaptureHandler/ArcjetAsyncCaptureHandler. These cannot deny.