Runtime security firewall for LangChain agents — intercepts tool calls, enforces YAML policy, logs to SQLite.
Project description
agentguard-runtime
Runtime security firewall for LangChain agents. Intercepts every tool call, checks it against a YAML policy, blocks disallowed calls, and logs everything to SQLite.
Install
pip install agentguard-runtime
Quick start
1. Write a policy file (policy.yml):
agent: pr-summarizer
rules:
- tool: GitHubTool
allow: [read]
block: [admin, write]
- tool: SlackTool
allow: [write]
- tool: "*"
block: [exec, delete]
2. Add one line to your agent:
from agentguard_runtime import AgentFirewall
agent = initialize_agent(
tools=[GitHubTool, SlackTool, ShellTool()],
llm=llm,
callbacks=[AgentFirewall(policy="policy.yml")]
)
If ShellTool tries to call exec, the agent gets a PolicyViolation and the event is logged.
CLI
# Show last 20 audit events
agentguard-runtime logs
# Start dashboard API on port 7070
agentguard-runtime dashboard
Dashboard endpoints
| Endpoint | Description |
|---|---|
GET /events |
Recent audit events (filterable by ?decision=block&agent=x) |
GET /summary |
Allowed vs blocked counts per tool today |
Policy rules
allowlist: only these actions are permitted on this toolblocklist: these actions are always rejected"*"tool: catch-all wildcard for unmatched tools- Default: if no rule matches, the call is blocked
Audit log
Events are stored at ~/.agentguard/audit.db (SQLite).
id | timestamp | agent | tool | action | input_preview | decision | reason
Dev setup
git clone <repo>
cd agentguard2
pip install -e ".[dev]"
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
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 agentguard_runtime-0.1.0.tar.gz.
File metadata
- Download URL: agentguard_runtime-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e82a149767a570c6d91ecd5c8618ee20a59d0d9a8c4c25c21b902e9e269edde
|
|
| MD5 |
f0a5f73a7f1c5c05f49c546372fda401
|
|
| BLAKE2b-256 |
bf6d82662db658abe53fa57ab49a4aeaed3d9671cd609697eec791220faab5dc
|
File details
Details for the file agentguard_runtime-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentguard_runtime-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2973e57475c5ffcda91ae794f00a72955c1148e9ed980d9259941c5aa73ff8ab
|
|
| MD5 |
ac556c0d7f5435d0442a48a60ac0869e
|
|
| BLAKE2b-256 |
ce8a3e8521f6c4ed7a52db683d2467d8c4dea07771019a0f127d96184717d776
|