Current collected state Current
Observed since 20 Oct, 23:22 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Runtime security guardrails for AI agents — inspect, control, and audit every tool call. Zero-dependency local mode included.
Lightweight security guardrails for AI agents. All security logic runs server-side.
from agentshield import Shield
shield = Shield() # reads AGENTSHIELD_API_KEY from env
@shield.guard
async def send_email(to: str, body: str) -> str:
... # your tool implementation
# The server decides: ALLOW, BLOCK, or REQUIRE_CONFIRMATION
await send_email(to="user@company.com", body="Hello")
async with shield.session("Summarize my emails") as s:
result = await s.guarded_executor.execute(
"read_inbox", {"limit": 10}, read_inbox_fn
)
from agentshield import Shield, ToolCallBlocked, ConfirmationRejected, ServerError
shield = Shield()
@shield.guard
async def send_email(to: str, body: str) -> str:
...
try:
await send_email(to="user@test.com", body="hi")
except ToolCallBlocked as e:
print(f"Blocked: {e.reason} (trace: {e.trace_id})")
except ConfirmationRejected:
print("User declined confirmation")
except ServerError as e:
print(f"Server error: {e}")
# Explicit configuration
shield = Shield(
api_key="your-key",
base_url="https://shield.yourcompany.com",
timeout=10.0,
max_retries=3,
agent_id="my-agent",
)
Or via environment variables:
AGENTSHIELD_API_KEY (required)AGENTSHIELD_BASE_URL (default: http://localhost:8000)AGENTSHIELD_TIMEOUT (default: 10.0)AGENTSHIELD_AGENT_IDOr via agentshield.yaml in the working directory.
# Sanitize external data before processing
result = await shield.sanitize(
data=email_body,
source="email/external",
)
# result.content has hidden injections removed
# result.trust_level shows the computed trust level
from agentshield.integrations import LangChainShield, CrewAIShield
# LangChain
guarded = LangChainShield(shield).wrap(agent_executor)
# CrewAI
guarded = CrewAIShield(shield).wrap(crew)
# AutoGen
from agentshield.integrations import AutoGenShield
AutoGenShield(shield).wrap(assistant)
# Claude Agent SDK
from agentshield.integrations import ClaudeAgentShield
guarded_handler = ClaudeAgentShield(shield).wrap(my_tool_handler)
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 18 Apr 2026 | 9 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 23:22 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f01112b4c9d08aa3001adbd7837e867d8e9ada816aae60d6a538a04f8ab9222b