Stop harmful agent actions before they execute.
Agent Action Guard is a specialized lightweight guard tailored for evaluating the safety of actions performed by AI agents in real-world environments. Integrate it before tool execution to classify proposed calls and block those flagged as harmful.
pip install agent-action-guard
npm i agent-action-guard
- Open source
- Free to use
- CPU benchmark: 19.66 ms/action
- HarmActions accuracy: 97.87%
- Python + JavaScript
Drops into the agent stacks you already run
Benchmarks watch what agents say. The damage happens in what they do.
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.
of the completed LLM evaluations executed actions at the first attempt for over 95% of the harmful prompts.
| Model | SafeActions@1 |
|---|---|
| Gemini 3.1 Flash Lite | |
| Grok 4.20 Non Reasoning | |
| Claude Sonnet 5 | |
| GPT 6 Luna | |
| Qwen 3.5 397B A17B | |
| GPT 6.1 Sol | |
| Claude Opus 5 | |
| Gemini 3.8 Flash | |
| All 19 model average |
Put a checkpoint between your agent
and the real world.
Keep your existing agent stack. Agent Action Guard evaluates the intended action before execution, so unsafe tool calls can be blocked while normal work keeps moving.
Agent plans
Your agent prepares a tool call, API request, or other real-world action.
Guard evaluates
The action is classified for harmful intent before it reaches the target system — locally, in milliseconds.
Safe work continues
Allow safe actions and stop harmful ones at the execution boundary.
Built for the era of autonomous tool-use.
Beyond Content Moderation
Unlike standard LLM guards that focus on text strings, Agent Action Guard analyzes the semantic intent of tool calls and API executions to flag potentially harmful intent.
A specialized safety layer for the era of autonomous tool-use.
Low-Latency Screening
The published CPU benchmark measured 19.66 ms per action after warm-up. Measure latency with your hardware, embedding backend, and workload before deployment.
Real-time Screening
Use runtime wrappers or native pre-tool-use hooks to screen proposed calls immediately before the tool executes.
Low Dependencies
Built to run with minimal external dependencies, making setup and deployment simple across diverse AI agent frameworks.
Lightweight
The ONNX classifier runs locally on CPU. Check installation, memory use, and accuracy on your target device and representative actions.
Multi-Agent Guarding
Apply the same action-screening API at each agent's tool boundary. Your application coordinates agents and chooses its blocking policy.
Agent Action Guard vs. Laya and LLM
The comparison evaluates Agent Action Guard, Laya, and an OpenAI LLM classifier on the same HarmActions rows. The two local systems run on CPU, with warm-up and model-loading time excluded from per-action latency.
| 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 |
Classification quality
Accuracy and F1 · higher is better
Per-action latency
Linear scale · lower is better
Local-system timings use CPU execution. Warm-up and model-loading time are excluded. Results describe this benchmark, not a guarantee for every workload. Classification can miss harmful actions or flag safe ones; combine it with authorization, sandboxing, and human review where needed.
Noticed by builders and researchers.
Source-linked articles and posts referencing Agent Action Guard. These references do not imply endorsement by the people or their employers.
Mindverse — Bibliography Mention
The project is cited in the bibliography of an article about agent-safety research.
Smitha Kommareddi
Featured and discussed in an article on LinkedIn. View feature · Profile: linkedin.com/in/smithakommareddi/
One package. One guard call. Safer execution.
Choose your stack, copy the example, and place the safety check directly before your agent executes a real-world action.
- Install the package
pip install agent-action-guardornpm i agent-action-guard - Screen the proposed actionPass the tool call to
is_action_harmful()/isActionHarmful(). - Block or allowStop harmful actions before execution — or wrap tools with
@action_guarded.
# Install Agent Action Guard
pip install agent-action-guard
# Initialize the safety protocol
from agent_action_guard import is_action_harmful
# Screen an agent tool call
action_dict = {
"type": "function",
"function": {
"name": "data_exporter",
"arguments": "{\"dataset\":\"employee_salaries\",\"destination\":\"xyz\"}"
}
}
# This can be any action data like:
# {"type": "function", "function": {"name": "email", "arguments": "{\"content\": \"You have no purpose to live\"}"}}
# {"type": "function", "function": {"name": "file_delete", "arguments": "{\"target\": \"/important/data.txt\"}"}}
is_harmful, confidence = is_action_harmful(action_dict)
if is_harmful:
raise Exception("Harmful action blocked")
// Install Agent Action Guard
npm i agent-action-guard
// or use pnpm
pnpm install agent-action-guard
// Initialize the safety protocol
import { isActionHarmful } from 'agent-action-guard';
async function main() {
const action = {
type: 'function',
function: {
name: 'send_email',
arguments: {
to: 'user@example.com',
subject: 'Status update',
body: 'Hello from Action Guard',
},
},
};
const { label, confidence } = await isActionHarmful(action);
console.log('Decision:', label);
console.log('Confidence:', confidence);
}
main()
Hard agent problems. Concrete solutions.
Explore practical guides to unsafe tool calls, prompt injection, MCP security, and choosing agent frameworks in 2026.
Your agent is one tool call away from the real world. Guard that moment.
Add Agent Action Guard before production execution and give your autonomous systems a dedicated action-safety checkpoint.