Skip to main content
Glama

create_csp

Create a contextual security policy (CSP) defining scoped rules for schedule, behavior, data, origin, or custom enforcement, with top-down inheritance and tool-level restrictions.

Instructions

Cria uma nova política de segurança contextual (CSP).

Escopos: tenant (global), team, agent, user — herança automática de cima para baixo. Tipos: schedule (horários), behavior (comportamento), data (dados), origin (origens), custom.

⚠️ Campo fora do contrato é ACEITO em silêncio (o schema permite propriedades extras) e fica INERTE. Não invente nome de campo: leia zihin://schemas/csp_config e use exatamente os de $defs.{tipo}Rules.

Exemplos de rules por tipo (todos os campos abaixo existem no contrato E são aplicados):

  • schedule: { allowed_hours: { start: "08:00", end: "18:00" }, allowed_days: ["mon","tue","wed","thu","fri"], blocked_dates: ["2026-12-25"], timezone: "America/Sao_Paulo" }

  • behavior: { max_tokens_per_request: 4096, max_iterations: 10, max_tool_calls: 20, must_not_tools: ["web_search","fetch_url"] }

  • data: { sensitive_fields: ["cpf","email"], never_expose: ["password_hash"], restricted_entities: ["folha_pagamento"], restriction_message: "Não posso consultar esse dado." }

  • custom: qualquer shape — é passado ao prompt como bloco de política sem interpretação do runtime.

Controle de superfície de tools (behavior):

  • must_not_tools: nomes de tools que o agente NUNCA executa, mesmo carregadas. Filtrado antes do turno nos dois runtimes (inclui o resume de HITL). É o único jeito de tirar uma tool nativa do agente sem desligar o recurso no tenant.

⚠️ policy_type "origin" NÃO é aplicado em runtime: nenhum entrypoint propaga o IP/origem do cliente até o loop, e countries/vpn/tor exigem provedor de geo que a plataforma não integra. A CSP é aceita e armazenada, mas não bloqueia nada — não use como controle de segurança.

Contrato formal: resource zihin://schemas/csp_config (envie só name/policy_type/scope/rules/... — tenant_id é injetado pelo servidor).

Aprovação por escopo (OE-2a, só chat nativo) — campos de behavior:

  • require_approval_for: array de string (nome de tool) ou objetos { tool_name } | { mcp_server_id } | { source: "mcp"|"api"|"db" } — tools casadas exigem aprovação HITL antes de executar

  • approval_policy_id: UUID de política criada via create_approval_policy — define QUEM aprova (sem ela, aprova o próprio solicitante) Ex: behavior: { require_approval_for: ["create_deal", { source: "db" }], approval_policy_id: "" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNome da política
rulesYesRegras da política (estrutura varia por tipo — veja descrição acima)
scopeYesEscopo de aplicação
priorityNoPrioridade (maior = mais importante, default: 0)
exceptionsNoExceções às regras (mesma estrutura de rules, sobrescreve campos específicos)
descriptionNoDescrição da política
policy_typeYesTipo da política
scope_target_idNoID do alvo (obrigatório para escopos team, agent, user)
Install Server

TDQS

A4.7/5.0
Behavior5/5

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

The description adds substantial behavioral detail beyond annotations: unknown fields are accepted silently and remain inert, origin policies are stored but never enforced at runtime, tenant_id is injected by the server, and must_not_tools is filtered before turns in both runtimes. No annotation contradiction found.

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 long but information-dense and well organized, with the core purpose front-loaded. Some repetition around schema warnings and rule examples prevents a perfect conciseness score, but every substantial section earns its place given the tool's complexity.

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

Completeness5/5

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

For a create tool with 8 parameters, nested rule objects, and no output schema, the description is exceptionally complete. It covers required fields, per-type shapes, scope behavior, runtime limitations, approval setup, and a formal schema reference. The exact return payload is not described, but that is not necessary for correct invocation.

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?

Even though schema coverage is 100%, the description adds far richer meaning: per-type rules structures with concrete examples, scope_target_id requirements, approval-related fields, and the note that tenant_id is server-injected. This goes well beyond the bare input schema.

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 opening sentence names a specific action and resource: "Cria uma nova política de segurança contextual (CSP)". The scopes and policy types further clarify what the tool is for, and the create verb distinguishes it from sibling update/delete/list tools.

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

Usage Guidelines4/5

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

The description gives rich context for when to create CSPs, explains scope inheritance, identifies prerequisites like create_approval_policy, and explicitly warns that origin policies are not a security control. It does not explicitly mention update_csp or list_csps as alternatives, but the usage context is clear.

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

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/zihin-ai/zihin-mcp'

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