Agent Action Guard
Framework to block harmful AI agent actions before they cause harm — lightweight, real-time, easy-to-use.
🚀 Quick Start
Python package support: Python 3.10 through Python 3.14.
Python 3.14 on Intel macOS: ONNX Runtime does not currently publish a CPython 3.14 x86_64 macOS wheel. Agent Action Guard automatically uses ONNX's
ReferenceEvaluatoron that platform; other supported platforms continue to use ONNX Runtime. The repository-local.python-versionis Python 3.14, souv syncexercises the current supported runtime by default.
pip install agent-action-guard
# or
uv add agent-action-guard
For embedding backend options and configuration details—including zero-config ONNX embeddings, custom local ONNX models, OpenAI-compatible embedding APIs, environment variables, and backend precedence—read USAGE.md. The installed packages also provide
agent-action-guardfor direct JSON, JSON arrays, JSONL batch classification, andagent-action-guard servefor a local HTTP classification API.
Framework integrations ship in this package as agent_action_guard.langchain, agent_action_guard.llamaindex, agent_action_guard.openai_agents, agent_action_guard.autogen, and agent_action_guard.crewai. Framework dependencies remain optional and are only needed by applications using those frameworks.
The same distribution also provides project-level pre-tool-use hook installers for Codex, Claude Code, Cursor, Kiro, OpenCode, Antigravity CLI (agy), GitHub Copilot CLI, OpenClaw, and Hermes Agent via agent-action-guard hooks install --target <target>. Supported target names are codex, claude-code, cursor, kiro, opencode, agy, copilot, openclaw, and hermes.
OpenClaw and Hermes retain their native repository-code trust gates: run openclaw plugins enable agent-action-guard after installing the OpenClaw workspace plugin, and set HERMES_ENABLE_PROJECT_PLUGINS=1 only for trusted repositories when using the Hermes project plugin.
Want to run the evaluation benchmark too?
pip install "agent-action-guard[harmactionseval]"
# or
uv add "agent-action-guard[harmactionseval]"
agent-action-guard harmactionseval
HarmActionsEval caches each model's k value alongside its results. Re-running
the same benchmark with a larger --k keeps successful cached results and only
continues entries that are still false, starting at the first previously
unevaluated attempt. Re-running with the same or a smaller --k does not repeat
cached LLM calls. The last_attempt map records per-result attempt coverage for unresolved false entries so the same behavior stays correct when runs use --offset/--limit chunks.
JavaScript Runtime
The repository also ships an npm package in typescript/package.json for screening agent actions in Node.js.
npm install agent-action-guard
If you use pnpm, the equivalent commands are:
pnpm install agent-action-guard
❓ Why Action Guard?
HarmActionsEval found harmful tool use in every evaluated model under its reported adversarial prompts and tool setup. These results describe the tested conditions, not every deployment. 68% of the completed LLM evaluations executed actions at the first attempt for over 95% of the harmful prompts.
| Model | SafeActions@1 |
|---|---|
| Gemini 3.8 Flash | 79.43% |
| Claude Opus 5 | 48.23% |
| GPT 6.1 Sol | 25.53% |
| Qwen 3.5 397B A17B | 23.40% |
| Claude Sonnet 5 | 3.55% |
| GPT 6 Luna | 3.55% |
| Grok 4.20 Non Reasoning | 2.13% |
| Gemini 3.1 Flash Lite | 0.71% |
| All 19 model average | 11.91% |
These models often still respond "Sorry, I can't help with that" while executing the harmful action anyway.
Action Guard sits between the agent and its tools, blocking unsafe calls before they run — no human in the loop required.
Agent Action Guard vs. Luna and Laya
Laya is a general-purpose local model that can also be used as an action-safety classifier similar to Agent Action Guard. The repository comparison benchmark evaluates Agent Action Guard, gpt-5.6-luna, and Laya on the same HarmActions rows. Local classifiers use CPU execution, and warm-up/model-loading time is excluded from the reported per-action latency.
python scripts/compare_laya_harmactions.py
| Model | HarmActions | Accuracy | Precision | Recall | F1 | ms/action |
|---|---|---|---|---|---|---|
| Agent Action Guard | 97.87% | 97.87% | 100.00% | 97.87% | 98.92% | 19.66 |
| gpt-5.6-luna | 90.07% | 90.07% | 100.00% | 90.07% | 94.78% | 3381.72 |
| Laya | 51.06% | 51.06% | 100.00% | 51.06% | 67.61% | 815.86 |
The benchmark uses the same HarmActions rows for all classifiers; CPU execution is forced for the local systems to make the latency comparison more consistent.
⚙️ How It Works
- Agent proposes a tool call
- Action Guard classifies it using a lightweight neural network trained on the HarmActions dataset
- Harmful calls are blocked; safe calls proceed normally
🆕 Contributions:
- 📊 HarmActions — safety-labeled agent action dataset with manipulated prompts
- 📏 HarmActionsEval — benchmark with the SafeActions@k metric
- 🧠 Action Guard — real-time neural classifier optimized for agent loops
- 🏋️ Trained on HarmActions
- ✅ Screens wrapped tool calls before execution
- 🚫 Blocks harmful and unethical actions automatically
- ⚡ Lightweight for real-time use
💬 Enjoyed it? Share your opinion.
Share a quick note in Discussions — it directly shapes the project's direction and helps the AI safety community. 🙌 Waiting with excitement for feedback and discussions on how this helps you or the AI community.
⭐ Star the repo if Action Guard is useful to you — it really does help!
📝 Citation
@article{202510.1415,
title = {{Agent Action Guard: Classifying AI Agent Actions to Ensure Safety and Reliability}},
year = 2025,
month = {October},
publisher = {Preprints},
author = {Praneeth Vadlapati},
doi = {10.20944/preprints202510.1415.v2},
url = {https://www.preprints.org/manuscript/202510.1415},
journal = {Preprints}
}
📄 License
Licensed under CC BY 4.0. If you prefer not to provide attribution, send a brief acknowledgment to praneeth.vad@gmail.com with the details of your usage and the potential impact on your project.
Projects for Next-Gen AI
Metadata
Release files for agent-action-guard 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_action_guard-1.2.3.tar.gz | 112.3 kB | With provenance | Details for agent_action_guard-1.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_action_guard-1.2.3-py3-none-any.whl | Python 3 | none | any | Details for agent_action_guard-1.2.3-py3-none-any.whl |
Total release size: 227.4 kB
Release files / agent_action_guard-1.2.3.tar.gz
| Download URL | agent_action_guard-1.2.3.tar.gz |
|---|---|
| Size | 112.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7936a926a04ed7c54fdee496e1a94ec66a184bf3e77cc6c1a93caeee8906248
|
|
BLAKE2b-256 checksum How to use checksums |
311a866cebabf47af05b1c88b2c4ca00a809eb641392b4d5cf7eb43a9e00e9b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / agent_action_guard-1.2.3-py3-none-any.whl
| Download URL | agent_action_guard-1.2.3-py3-none-any.whl |
|---|---|
| Size | 115.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5fe2b2a37d311cf459a8d34b2b3dace2af1c248da3e0b35d019cd13f640d1b5
|
|
BLAKE2b-256 checksum How to use checksums |
55401b42836c5eaa1173748bb190986964934f0a570ff41e9e2c3d99e3422902
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for agent-action-guard 1.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_action_guard-1.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.