Security infrastructure for autonomous AI agents
pip install agentsec
AI agents are being weaponized. Anthropic recently disclosed a Chinese state-sponsored group used jailbroken Claude to orchestrate autonomous cyberattacks at scale. 80-90% of operations were AI-driven. Several intrusions succeeded.
Organizations deploying AI agents have:
AgentSec provides three layers of defense:
Know exactly what your agents are doing. Capture prompts, responses, tool calls, network requests, and file operations.
Alignment anchored in architecture, not prompts. YAML-based policies that actually block dangerous actions.
Catch mode shifts before damage occurs. Heuristic-based risk labeling with 20+ threat categories.
# Install
pip install agentsec
# Use in your agent
from agentsec import AgentSecClient, policy
client = AgentSecClient(agent_id="my-agent")
# Wrap tools with policy enforcement
@policy.guard
def search_database(query: str) -> list:
# Your tool implementation
pass
# All calls are now logged + policy-checked
results = search_database("SELECT * FROM users")
# CLI - tail events in real-time
agentsec tail -f
# CLI - inspect with risk analysis
agentsec inspect
Automatically capture all agent behavior:
Define security policies in YAML:
version: 1
name: security-baseline
default: allow
rules:
- id: block-credential-access
match:
type: file_op
path: "*credentials*"
decision: deny
reason: "Credential file access blocked"
Automatic risk detection with labels like:
Install AgentSec and capture your first events in under 5 minutes.
Standardized event format for prompts, responses, tool calls, and more.
YAML policy language for allow/deny/escalate decisions.
Guides for OpenAI, Anthropic, LangChain, and more.
+------------------+ +-------------------+ +------------------+
| Your Agent | --> | AgentSec SDK | --> | Policy Engine |
| (OpenAI/Claude/ | | - Telemetry | | - Allow/Deny |
| LangChain/etc) | | - Tool Wrappers | | - Escalate |
+------------------+ +-------------------+ +------------------+
|
v
+-------------------+
| Event Storage |
| - Local files |
| - Remote ingest |
+-------------------+