AI Agent Framework Integrations
Equip autonomous agents with zero-retention 2FA, OTP, Magic-Link, and TOTP authenticator vault tools. Native integrations for Google ADK, Microsoft Agent Framework, PydanticAI, OpenAI Agents SDK, Claude Agent SDK, Strands Agents, Agno, Smolagents, LangGraph, and CrewAI.
The Autonomous 2FA Bottleneck
Autonomous agents navigating login portals, SaaS onboarding, or high-security actions inevitably hit 2FA barriers. Without an inbox API, agents hang or trigger catastrophic polling loops. Sentry Relay eliminates this bottleneck by pairing unique, ephemeral Identities with a sub-200ms Redis long-polling wait primitive and an RFC 6238 TOTP vault.
Long-polls via Redis pub/sub. Immediately unblocks the agent the moment the SMS or email OTP arrives.
Automatically pauses if ≤4 seconds remain in a 30s TOTP period, preventing stale code submission failures.
Codes are extracted in memory and purged automatically. No raw emails or SMS text are persisted to disk.
Installation & Optional Extras
Install the core Python SDK or include extras tailored to your target agent framework:
# Core SDK
pip install sentryrelay-sdk
# Framework-specific extras:
pip install "sentryrelay-sdk[google-adk]" # Google ADK
pip install "sentryrelay-sdk[microsoft-agents]" # Microsoft Agent Framework
pip install "sentryrelay-sdk[pydantic-ai]" # PydanticAI
pip install "sentryrelay-sdk[openai-agents]" # OpenAI Agents SDK
pip install "sentryrelay-sdk[claude-agent]" # Claude Agent SDK / Anthropic
pip install "sentryrelay-sdk[strands]" # Strands Agents
pip install "sentryrelay-sdk[agno]" # Agno
pip install "sentryrelay-sdk[smolagents]" # Smolagents
pip install "sentryrelay-sdk[langchain]" # LangGraph / LangChain
pip install "sentryrelay-sdk[crewai]" # CrewAIFramework Recipes
Copy-pasteable integrations for all major LLM agent frameworks.
Google ADK (Agent Development Kit)
Provides ready-to-use tool callables for Google ADK LLM agents using Gemini and Vertex AI models:
from google.adk.agents.llm_agent import Agent
from sentryrelay import SentryRelay
from sentryrelay.integrations.google_adk import create_google_adk_tools
relay = SentryRelay()
tools = create_google_adk_tools(relay)
agent = Agent(
model="gemini-2.5-flash",
name="checkout_verifier",
instruction="Solve 2FA challenges by waiting on inbound codes or retrieving TOTPs.",
tools=tools,
)Microsoft Agent Framework
Compatible with Microsoft Agent Framework (agent-framework) and Azure AI Projects. Automatically wraps functions with AIFunction:
from agent_framework import ChatAgent
from sentryrelay import SentryRelay
from sentryrelay.integrations.microsoft_agent import create_microsoft_agent_tools
relay = SentryRelay()
tools = create_microsoft_agent_tools(relay)
agent = ChatAgent(
name="SecurityAgent",
tools=tools,
instructions="Handle 2FA and OTP authentication challenges autonomously.",
)PydanticAI
Type-safe agent tools with structured schemas. Seamlessly register tools directly onto your agent:
from pydantic_ai import Agent
from sentryrelay import SentryRelay
from sentryrelay.integrations.pydantic_ai import register_sentryrelay_tools
relay = SentryRelay()
agent = Agent('openai:gpt-4o', system_prompt="Handle automated authentication.")
# Registers wait_for_verification_code, get_totp_code, and list_identities
register_sentryrelay_tools(agent, relay)
result = agent.run_sync("Log into Okta using identity dev-agent and provide the OTP.")
print(result.data)OpenAI Agents SDK
For the official OpenAI Agents SDK (openai-agents / agents):
from agents import Agent, Runner
from sentryrelay import SentryRelay
from sentryrelay.integrations.openai_agents import create_openai_agents_tools
relay = SentryRelay()
tools = create_openai_agents_tools(relay)
agent = Agent(
name="LoginAssistant",
instructions="You automate account sign-ins. Use Sentry Relay tools to solve 2FA challenges.",
tools=tools,
)
result = Runner.run_sync(agent, "Sign in using checkout-bot and retrieve the incoming SMS code.")
print(result.final_output)Claude Agent SDK & Anthropic Tool Use
Provides complete Anthropic tool schema definitions (tools.definitions) and a unified dispatcher (tools.execute(name, args)):
import anthropic
from sentryrelay import SentryRelay
from sentryrelay.integrations.claude_agent import create_claude_agent_tools
relay = SentryRelay()
tools = create_claude_agent_tools(relay)
client = anthropic.Anthropic()
# Supply tools.definitions directly to messages.create
response = client.messages.create(
model="claude-3-7-sonnet-20250219",
max_tokens=1024,
tools=tools.definitions,
messages=[{"role": "user", "content": "Wait for OTP code on identity 'checkout-bot'"}],
)
# Dispatch execution
for block in response.content:
if block.type == "tool_use":
result = tools.execute(block.name, block.input)
print("Tool Output:", result)Strands Agents
Decorated with @tool from strands:
from strands import Agent
from sentryrelay import SentryRelay
from sentryrelay.integrations.strands import create_strands_tools
relay = SentryRelay()
tools = create_strands_tools(relay)
agent = Agent(
model="claude-3-7-sonnet-20250219",
name="browser_auth_agent",
system_prompt="Resolve OTP and TOTP verification challenges using Sentry Relay.",
tools=tools,
)Agno (formerly Phidata)
A native Toolkit subclass for Agno agents:
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from sentryrelay import SentryRelay
from sentryrelay.integrations.agno import SentryRelayTools
relay = SentryRelay()
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[SentryRelayTools(relay)],
instructions="Solve 2FA challenges by waiting on inbound codes or generating live TOTPs.",
)
agent.print_response("Wait for the 2FA code sent to identity 'checkout-bot'")Smolagents (Hugging Face)
Native Tool subclasses for Hugging Face smolagents:
from smolagents import CodeAgent, HfApiModel
from sentryrelay import SentryRelay
from sentryrelay.integrations.smolagents import create_smolagents_tools
relay = SentryRelay()
tools = create_smolagents_tools(relay)
agent = CodeAgent(
tools=tools,
model=HfApiModel(),
)
agent.run("Fetch the latest TOTP authenticator code for identity 'checkout-bot' with secret 'github_ops'")LangGraph & LangChain
LangChain tool definitions with typed Pydantic parameter schemas:
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
from sentryrelay import SentryRelay
from sentryrelay.integrations.langgraph import create_sentryrelay_tools
relay = SentryRelay()
tools = create_sentryrelay_tools(relay)
llm = ChatOpenAI(model="gpt-4o")
app = create_react_agent(llm, tools=tools)CrewAI
Prebuilt BaseTool instances for multi-agent crews:
from crewai import Agent, Crew, Task
from sentryrelay import SentryRelay
from sentryrelay.integrations.crewai import create_crewai_tools
relay = SentryRelay()
tools = create_crewai_tools(relay)
auth_specialist = Agent(
role="Authentication Specialist",
goal="Handle 2FA and MFA verification challenges",
backstory="Expert at retrieving inbound OTP codes and managing TOTP credentials",
tools=tools,
)Production Best Practices for Autonomous Agents
- Bound your timeout: Always set an explicit
timeout_seconds(between 15 and 45s) to prevent agents from blocking indefinitely if an upstream service fails to send a code. - Use sender filtering: Pass
sender="stripe.com"to filter out irrelevant emails and ensure the agent only claims the exact code intended for the active login challenge. - Rely on TOTP Rollover: Never manually calculate remaining seconds. Sentry Relay's
auto_wait_fresh_windowautomatically delays if ≤4s remain in the window so the browser agent never types an expired token.