Current collected state Current
Observed since 20 Oct, 23:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AI Agent security guard - policy engine for LLM tool calls
Policy engine for securing AI agent tool calls. | AI Agent 工具调用安全策略引擎。
pip install agent-guard
Requires Python >= 3.10. | 需要 Python >= 3.10。
From source | 源码安装:
cd python
pip install -e ".[dev]"
import asyncio
from agent_guard import PolicyEngine, guard
engine = PolicyEngine("policy.yaml")
@guard(engine, session_id="demo")
async def shell_execute(command: str) -> str:
return f"执行结果: {command}"
async def main():
result = await shell_execute("echo hello")
print(result)
asyncio.run(main())
PolicyEngine(config_path: str = "policy.example.yaml")Load policies from a YAML file. | 从 YAML 文件加载策略。
execute_pre(tool_name, args, session_id) — Run pre-execution policies | 执行前置策略检查execute_post(tool_name, result, session_id) — Run post-execution policies | 执行后置策略处理@guard(engine, session_id="default")Decorator that wraps an async function with policy enforcement. | 装饰器,为异步函数添加策略防护。
SuspensionManagercreate_request() — Create a suspension request | 创建挂起请求wait_for_approval() — Wait for human approval (asyncio.Event) | 等待人工审批approve(request_id) / reject(request_id, reason) — External wake-up | 外部唤醒接口list_pending() — List all pending requests | 列出待审批请求cd python
pip install -e ".[dev]"
pytest --cov=agent_guard --cov-report=term-missing
MIT License — Copyright (c) 2026 guorui999
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 26 Jun 2026 | 9 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 23:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:ba9972d6ea1e665a4b47fd7a37bbc2abc6040b2ffba7d5ab4a9ba3193e71df34