Enterprise-grade Zero-Leak Secret Defense & Sandbox for Autonomous AI Agents built with LangGraph, CrewAI, AutoGen, LlamaIndex, and Smolagents.
@shield.protectDecorator: Zero-boilerplate function and tool protection. Automatically intercepts arguments and return values.- Framework Integrations:
- LangChain & LangGraph:
AgentShieldCallbackHandler - CrewAI:
AgentShieldCrewHook - LlamaIndex:
AgentShieldLlamaHandler - Microsoft AutoGen:
AgentShieldAutoGenGuard
- LangChain & LangGraph:
- Zero-Leak Redaction: 40+ credential types (OpenAI, Anthropic, AWS, GitHub, Stripe, Slack, private keys,
/proc/self/environ). - Environment Sanitization:
sanitize_env()replaces sensitive variables with virtual mock tokens. - HMAC-SHA256 Audit Ledger: Cryptographically seals every inspection with microsecond overhead.
pip install agentshield-defenseNote: In code, import as standard import agentshield or from agentshield import shield.
Decorate any agent tool, custom function, or LLM wrapper:
from agentshield import shield
@shield.protect
def deploy_infrastructure(target: str, config: str) -> str:
# Any incoming AWS keys or OpenAI keys in config are automatically masked
return f"Deployed {target} with token: AKIAIOSFODNN7EXAMPLE"
# When executed:
output = deploy_infrastructure("prod-cluster", "key=sk-1234567890abcdef1234567890abcdef")
print(output)
# -> "Deployed prod-cluster with token: [AGENTSHIELD_REDACTED:AWS_ACCESS_KEY:a1b2c3d4e5f6]"For strict enforcement (raising PermissionError on leak):
from agentshield import protect
@protect(strict=True)
def sensitive_operation():
...from langchain_openai import ChatOpenAI
from agentshield import AgentShieldCallbackHandler
shield_handler = AgentShieldCallbackHandler()
llm = ChatOpenAI(
model="gpt-4o",
callbacks=[shield_handler]
)
# Outgoing prompts and tool invocations are inspected and sanitized in real timefrom crewai import Task
from agentshield import AgentShieldCrewHook
hook = AgentShieldCrewHook()
task = Task(
description="Analyze server environment and deploy database",
expected_output="Deployment summary"
)
hook.before_task_execution(task)from llama_index.core import Settings
from agentshield import AgentShieldLlamaHandler
Settings.callback_manager.add_handler(AgentShieldLlamaHandler())from agentshield import AgentShieldAutoGenGuard
guard = AgentShieldAutoGenGuard()
clean_message = guard.filter_message(incoming_message)- Zero Cloud Exfiltration: Runs 100% locally with
AGENTSHIELD_AIR_GAPPED=1. - Pre-filled SIG Lite / CAIQ: Download the Vendor Risk Assessment Packet at ritualdev.in/trust.
- Statutory Alignment: Designed for India DPDP Act 2023, EU GDPR, and SOC 2 Type II.
MIT © RitualDev Studio