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
Release files for agentguard-runtime 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agentguard_runtime-0.1.0.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentguard_runtime-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / agentguard_runtime-0.1.0.tar.gz
| Download URL | agentguard_runtime-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e82a149767a570c6d91ecd5c8618ee20a59d0d9a8c4c25c21b902e9e269edde
|
|
BLAKE2b-256 checksum How to use checksums |
bf6d82662db658abe53fa57ab49a4aeaed3d9671cd609697eec791220faab5dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|
Release files / agentguard_runtime-0.1.0-py3-none-any.whl
| Download URL | agentguard_runtime-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2973e57475c5ffcda91ae794f00a72955c1148e9ed980d9259941c5aa73ff8ab
|
|
BLAKE2b-256 checksum How to use checksums |
ce8a3e8521f6c4ed7a52db683d2467d8c4dea07771019a0f127d96184717d776
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|