Skip to main content
Version: v0 (preview)

guard()

guard() wraps a tool so Kelhe scores the action before it runs. There is one adapter per framework; the call shape is the same, except LangGraph and AutoGen take a shared AgentContext.

from kelhe.adapters.openai_agents import guard # OpenAI Agents
from kelhe.adapters.langgraph import guard, AgentContext # LangGraph
from kelhe.adapters.crewai import guard # CrewAI
from kelhe.adapters.autogen import guard, AgentContext # AutoGen
FrameworkCallNotes
OpenAI Agentsguard(kelhe, func)Returns a FunctionTool.
CrewAIguard(kelhe, tool)Function or BaseTool; scoped by tool name.
LangGraphguard(kelhe, func, context=ctx)Create one AgentContext, then ctx.bind(agent).
AutoGenguard(kelhe, tool, context=ctx)Create one AgentContext, then ctx.bind(agent).

All adapters accept name= and description= to override what the model sees. The tool's behavior is never changed — Kelhe only runs a check immediately before it executes. See the per-framework guides under Getting started.