Skip to main content
Glama

create_policy

Define security rules to control AI agent actions by specifying conditions and allow/deny/approval responses based on trust levels and tool patterns.

Instructions

Create or update a security policy for agent governance.

Policies define rules that control what agents can do. Each policy contains conditions and actions (allow/deny/require_approval).

Args: policy_id: Unique identifier for the policy (e.g., "prod-db-access") name: Human-readable name (e.g., "Production Database Access Control") description: Description of what this policy controls rules: JSON array of rule objects. Each rule has: - condition: Object with matching criteria - tool_pattern: Glob pattern for tool names (e.g., "database_*") - action_type: Type of action (e.g., "tool_call") - trust_level_at_least: Minimum trust level required - trust_level_below: Trigger if trust below this level - action: "allow", "deny", or "require_approval" - message: Message to show when rule matches priority: Higher priority policies are evaluated first (default: 100) enabled: Whether the policy is active (default: true)

Returns: JSON string with creation result: - success: Whether creation succeeded - policy_id: The policy's ID - message: Status message

Example: create_policy( policy_id="prevent-deletions", name="Prevent Dangerous Deletions", description="Block delete operations for non-admin agents", rules='[{"condition": {"tool_pattern": "delete_*", "trust_level_below": "admin"}, "action": "deny", "message": "Delete operations require admin access"}]' )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
policy_idYes
nameYes
descriptionYes
rulesYes
priorityNo
enabledNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly indicates this is a write operation ('Create or update') and describes the policy structure, but doesn't mention important behavioral aspects like authentication requirements, rate limits, idempotency, or what happens when updating existing policies versus creating new ones. The example helps but doesn't cover all behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, args, returns, example) and front-loads the core purpose. While comprehensive, some sentences could be more concise (e.g., the rules explanation is detailed but necessary given complexity). No wasted text, though the formatting with line breaks could be optimized for pure conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter mutation tool with no annotations, the description provides substantial context including parameter details, return format, and a complete example. The presence of an output schema reduces the need to fully document return values. The main gap is lack of behavioral context around permissions, side effects, and error conditions, but overall it's quite complete for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage, the description provides excellent parameter semantics that fully compensate. It documents all 6 parameters with clear explanations, including detailed breakdown of the complex 'rules' parameter structure with its nested condition and action components. Default values for 'priority' and 'enabled' are explicitly stated, and the example demonstrates proper usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Create or update') and resource ('security policy for agent governance'). It distinguishes itself from sibling tools like get_audit_log or report_incident by focusing on policy creation/update rather than retrieval or reporting functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through the explanation of what policies do ('define rules that control what agents can do'), but doesn't explicitly state when to use this tool versus alternatives. No guidance is provided about prerequisites, dependencies, or specific scenarios where this tool should be selected over other policy-related tools (though none appear in the sibling list).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PrateekKumar1709/policyguard'

If you have feedback or need assistance with the MCP directory API, please join our Discord server