Plug-and-play agentic framework with multi-backend, guardrails, and Azure AD support
Project description
RapidAgent
Plug-and-play agentic framework with multi-backend support, native multi-LLM support, Azure OpenAI + Azure AD auth, and built-in security guardrails (PII/PHI redaction, prompt injection prevention, tool authorization).
Installation
pip install rapidagent # Core (Direct backend — all Python 3.10+)
pip install rapidagent[langgraph] # + LangGraph backend
pip install rapidagent[azure] # + Azure AD auth
pip install rapidagent[anthropic] # + Anthropic Claude SDK
pip install rapidagent[google] # + Google Gemini SDK
pip install rapidagent[litellm] # + LiteLLM (100+ providers — see note below)
pip install rapidagent[cli] # + CLI commands
pip install rapidagent[all] # Everything
Quickstart
from rapidagent import RapidAgent, tool
@tool
def get_weather(city: str) -> str:
"""Get current weather."""
return f"Weather in {city}: 72F, sunny"
agent = RapidAgent(model="openai:gpt-4o-mini", tools=[get_weather])
result = agent.invoke("Weather in SF?")
print(result["content"])
Or from YAML:
name: my-agent
model: openai:gpt-4o-mini
system_prompt: "You are helpful."
tools:
- name: current_time
description: Get the current time
function: rapidagent.tools.builtins:current_time
agent = RapidAgent.from_config("agent.yaml")
LLM Provider Support
RapidAgent supports 40+ LLM providers natively using their official SDKs. No single point of compromise.
Native providers (official SDKs — recommended)
| Provider | Model String | SDK | Auth Env Var |
|---|---|---|---|
| OpenAI | openai:gpt-4o-mini |
openai (core) |
OPENAI_API_KEY |
| Azure OpenAI | (dict config) | openai (core) |
AZURE_OPENAI_ENDPOINT |
| Anthropic Claude | anthropic:claude-3-5-sonnet-latest |
anthropic |
ANTHROPIC_API_KEY |
| Google Gemini | google:gemini-2.0-flash |
google-genai |
GEMINI_API_KEY |
OpenAI-compatible providers (no extra SDKs)
Uses the same openai SDK (already installed) with a custom base_url. Zero additional dependencies, zero additional risk.
| Provider | Config |
|---|---|
| Groq | provider: openai_compatible, endpoint: https://api.groq.com/openai/v1 |
| Together AI | provider: openai_compatible, endpoint: https://api.together.xyz/v1 |
| Ollama (local) | provider: openai_compatible, endpoint: http://localhost:11434/v1 |
| OpenRouter | provider: openai_compatible, endpoint: https://openrouter.ai/api/v1 |
| DeepSeek | provider: openai_compatible, endpoint: https://api.deepseek.com |
| Perplexity | provider: openai_compatible, endpoint: https://api.perplexity.ai |
| Fireworks | provider: openai_compatible, endpoint: https://api.fireworks.ai/inference/v1 |
| + 30 more | Any OpenAI-compatible endpoint |
model:
provider: openai_compatible
model: llama-3.3-70b-versatile
endpoint: https://api.groq.com/openai/v1
agent = RapidAgent(model="anthropic:claude-3-5-sonnet-latest")
agent = RapidAgent(model="google:gemini-2.0-flash")
LiteLLM (explicit opt-in — for providers not covered above)
LiteLLM can route through 100+ providers via a single package. Has had past security incidents (supply-chain attacks exfiltrating credentials). Use only if your provider isn't covered by the native providers above.
# Explicit opt-in — only works if you set this
agent = RapidAgent(model="litellm:bedrock/anthropic.claude-v2")
Installing rapidagent[litellm] shows a runtime warning every time it's used.
Multi-Backend Architecture
| Python | Default Backend | Features |
|---|---|---|
| 3.10 – 3.13 | LangGraph | Full durability, checkpointing, HITL, multi-agent, LangSmith. |
| 3.14+ | Direct | Pure Python ReAct loop. Tools, streaming, memory, checkpointing included. |
agent = RapidAgent(model="openai:gpt-4o-mini", backend="direct")
Security Guardrails
Six built-in guardrails + audit trail. Enable via YAML or code.
guardrails:
input_filter:
enabled: true
block_patterns:
- "ignore all instructions"
tool_auth:
enabled: true
allowlist: [get_weather, current_time]
denylist: [rm.*, exec.*]
pii:
enabled: true
patterns:
email: redact
ssn: block
phi:
enabled: false # HIPAA — opt-in
include_pii: true
output_filter:
enabled: true
audit_log:
enabled: true
path: ./audit/audit.jsonl
What each guardrail does
| Guardrail | Hook Points | Default |
|---|---|---|
| InputGuardrail | Input → LLM | Blocks prompt injection, jailbreaks |
| ToolAuthGuardrail | Before tool exec | Denylist: exec, eval, rm, subprocess, drop table, shutdown |
| PIIScanner | All I/O points | Redacts email, phone, API keys. Blocks 9-digit SSNs |
| PHIScanner | Same as PII | 14 HIPAA patterns: MRN, Medicare IDs, VINs, IPs, health dates. Opt-in |
| OutputGuardrail | Response → user | Blocks hate speech, violent content |
| RateLimiter | Input | Sliding window (100 req / 60s) |
Every decision logged to JSONL audit file. Supports custom sinks (Datadog, Splunk).
agent = RapidAgent(
model="openai:gpt-4o-mini",
guardrails={
"input_filter": {"block_patterns": ["BADWORD"]},
"phi": {"enabled": True},
},
)
CLI
rapidagent doctor # Diagnose environment
rapidagent init my-project # Interactive setup with prereq checks
rapidagent new my-project # Quick scaffold
rapidagent run agent.yaml # Interactive chat
rapidagent ask agent.yaml "Hi" # Single question
rapidagent list # Available blueprints
Features
| Feature | Description |
|---|---|
| Multi-backend | LangGraph (3.10-3.13) or Direct (3.14+) — auto-selected |
| 40+ LLM providers | OpenAI, Anthropic, Google, Groq, Together, Ollama, OpenRouter, DeepSeek, ... |
| Azure OpenAI + AD | API key, service principal, or DefaultAzureCredential |
| Security guardrails | PII/PHI redaction, prompt injection, tool auth, rate limiter, audit trail |
| Crash recovery | SQLite checkpointing after every LLM + tool step |
| Structured output | Pass any Pydantic model for JSON output |
| Token/cost tracking | Token counts and cost per invocation |
| Retry with backoff | Exponential backoff on API errors (rate limits, timeouts) |
@tool decorator |
Auto-generates LLM tool schemas from type hints |
| Multi-agent | Supervisor/worker, swarm, and sequential patterns |
| CLI | Scaffold, init, doctor, run, chat |
| 128 tests | Completely covered |
Configuration
name: customer-support
model:
provider: azure_openai
deployment: gpt-4o
endpoint: https://my-resource.openai.azure.com
auth_type: default_credential
backend: direct
system_prompt: "You are a helpful support agent."
max_iterations: 10
tools:
- name: lookup_order
description: Look up an order
function: tools.orders:lookup_order
guardrails:
input_filter:
enabled: true
tool_auth:
enabled: true
pii:
enabled: true
audit_log:
path: ./audit/audit.jsonl
human_in_the_loop:
enabled: true
require_approval_for:
- process_refund
Development
git clone https://github.com/your-org/rapidagent
cd rapidagent
pip install -e .[all]
python -m unittest discover tests/
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rapidagent-0.3.1.tar.gz.
File metadata
- Download URL: rapidagent-0.3.1.tar.gz
- Upload date:
- Size: 59.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
861a140c8c781d3611bdd05d7d65c2e48060ac157dbe52e5c94366166ee538b6
|
|
| MD5 |
55ed164e9baea0769288eff167766536
|
|
| BLAKE2b-256 |
3a6d6828f976ba62e3fa10a0e10992b74acdb28183316da28ac7306d038d0504
|
File details
Details for the file rapidagent-0.3.1-py3-none-any.whl.
File metadata
- Download URL: rapidagent-0.3.1-py3-none-any.whl
- Upload date:
- Size: 62.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13bde17395be543107b8ef343509f59b48c6a9436f2183c73b3477296b5fd87f
|
|
| MD5 |
b93f6da9a70b92ade782537d44215a97
|
|
| BLAKE2b-256 |
40ce2ab06a8c5dae55810c2f70ce5bbbcf46b9aad747f332c49bf2a02e17f3ca
|