Skip to content

[FEAT] Action Guard for centralized validation of agent tool calls #1182

@prane-eth

Description

@prane-eth

Is your feature request related to a problem? Please describe.

Background

AI agents have a growing adoption across the industry, including critical applications. AI agents that have access to tools can currently call tools directly with no centralized validation layer that inspects these calls before execution, allowing harmful or disallowed tool calls to be executed without oversight. In this package, Action Guard feature automates the validation, making the workflow secure.

The Agent-Action-Guard experiments proved GPT-5.3 has a safety score of 17.33%, which shows a very high vulnerability, proving the requirement for the Action Guard. 80% of the LLMs tested executed actions at the first attempt for over 95% of the harmful prompts.

Agent-Action-Guard received 962 downloads on PyPI, and 247 clones on GitHub in the first week.

Related Work

Describe alternatives you've considered

If user approval is made mandatory for each action, the workflow becomes slow and inefficient. Existing PRs related to validation check for only roles but not the actions.

Proposed Change

Introduce an action_guard parameter in the Python client that allows developers to define a centralized validation function for agent actions.

This guard would be invoked whenever the agent attempts a tool call (including MCP actions). The guard function can decide whether to allow or block the action.

Example:

import { isActionHarmful, GuardDecision } from "agent_action_guard";

// Guard function
function actionGuard(action) {
  if (isActionHarmful(action)) {
    return GuardDecision.BLOCK;
  }
  return GuardDecision.ALLOW;
}

const agent = new Agent({
  name: "safe-agent",

  guardrails: {
    toolInput: [actionGuard],
  },
});

Benefits

  • Centralized enforcement of action policies
  • Reduced boilerplate in tool implementations
  • Improved safety for agentic systems
  • Seamless integration with existing tool and MCP ecosystems

If you express interest, I will write the code and create a Pull Request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions