Skip to main content
Glama

create_csp

Create a scoped security policy for tenant, team, agent, or user to control tool blocking, execution limits, and approval requirements.

Instructions

Create a contextual security policy with tenant, team, agent or user scope. Read zihin://schemas/csp_config: unknown rule fields may be accepted but have no effect. behavior.must_not_tools blocks named tools; execution ceilings use max_iterations, max_tool_calls and max_tokens_per_request. Native-chat human approval uses require_approval_for with tool names or matchers (tool_name, mcp_server_id, source=mcp|api) and approval_policy_id. Data rules are model instructions, not programmatic masking. origin policies are stored but not enforced; never use them as an access-control boundary. Custom rules become prompt instructions. See zihin://skills/governanca-e-operacao for examples.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "policy_type": "<policy_type>",
      "scope": "<scope>",
      "rules": "<rules>"
    },
    "name": "create_csp"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesPolicy name
rulesYesPolicy rules; structure depends on the policy type. See zihin://schemas/csp_config.
scopeYesScope where the policy applies
priorityNoPriority; higher values take precedence. Defaults to 0.
exceptionsNoRule exceptions using the same structure as rules; overrides specific fields
descriptionNoPolicy description
policy_typeYesPolicy type
scope_target_idNoTarget ID; required for team, agent and user scopes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv2.2.4
    • changedInput schema / properties / description / description
      Previous value: -"Descrição da política"New value: +"Policy description"
    • changedInput schema / properties / exceptions / description
      Previous value: -"Exceções às regras (mesma estrutura de rules, sobrescreve campos específicos)"New value: +"Rule exceptions using the same structure as rules; overrides specific fields"
    • changedInput schema / properties / name / description
      Previous value: -"Nome da política"New value: +"Policy name"
    • changedInput schema / properties / policy_type / description
      Previous value: -"Tipo da política"New value: +"Policy type"
    • changedInput schema / properties / priority / description
      Previous value: -"Prioridade (maior = mais importante, default: 0)"New value: +"Priority; higher values take precedence. Defaults to 0."
    • changedInput schema / properties / rules / description
      Previous value: -"Regras da política (estrutura varia por tipo — veja descrição acima)"New value: +"Policy rules; structure depends on the policy type. See zihin://schemas/csp_config."
    • changedInput schema / properties / scope / description
      Previous value: -"Escopo de aplicação"New value: +"Scope where the policy applies"
    • changedInput schema / properties / scope_target_id / description
      Previous value: -"ID do alvo (obrigatório para escopos team, agent, user)"New value: +"Target ID; required for team, agent and user scopes"
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent, closed-world create. The description goes well beyond that by disclosing that unknown rule fields are silently ignored, that origin policies are stored but not enforced, and that data/custom rules degrade to prompt instructions rather than programmatic enforcement — exactly the kind of surprising behavior an agent needs. It omits idempotency consequences (duplicate creates) and any auth/permission requirements, which keeps it off a 5.

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?

It is front-loaded with purpose and scope, then moves through rules semantics to caveats, with points routed to the schema resource and a skill doc rather than inlined. It is dense and slightly run-on in the middle sentences, but nearly every clause carries operational information.

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 an 8-parameter tool with a nested free-form rules object and no output schema, the description covers the semantics that matter most and delegates full structure to zihin://schemas/csp_config. It leaves unaddressed what the call returns and whether policy names must be unique per scope, which are the remaining gaps.

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?

Schema coverage is 100%, so the baseline is 3, but the free-form `rules` object (additionalProperties: {}) is opaque in the schema and the description decodes it: behavior.must_not_tools, max_iterations, max_tool_calls, max_tokens_per_request, require_approval_for with tool_name/mcp_server_id/source matchers and approval_policy_id. That is substantive meaning added beyond the schema, not repetition.

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

Purpose4/5

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

The first sentence states a specific verb and resource ('Create a contextual security policy') and enumerates the four scopes, so the agent knows exactly what is produced. It does not explicitly distinguish itself from update_csp or toggle_csp, but the create/read/update/delete naming makes the distinction inferable.

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 gives conditional guidance embedded in semantics ('never use origin policies as an access-control boundary', 'data rules are model instructions') and points at zihin://skills/governanca-e-operacao for examples. It never states when to prefer create_csp over update_csp or how to handle an existing policy of the same scope, so tool-selection guidance remains implicit.

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

Deploy Server

Other Tools