Skip to main content
Glama

guarded_generate

Scans prompts for security risks and enforces policy thresholds to block unsafe requests, recording usage and only generating responses when permitted.

Instructions

[WRITE][risk=medium] Scan + policy-gate a prompt, record it, then run if allowed.

The route-through guard: scans the prompt (secrets/PII/code/jailbreak), checks the model against policy, blocks if the risk band >= block_threshold or the model is disallowed, records the interaction to the usage log, and only calls Ollama if allowed. The raw prompt is never stored.

Args: model: Model to run. prompt: The prompt text (scanned before any model call). agent / user: Actor attribution recorded in the usage log. block_threshold: Block when risk band >= this (none/low/medium/high/critical). target: Ollama target name from config; omit for the default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNo
agentNounknown
modelYes
promptYes
targetNo
block_thresholdNohigh
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: scanning for secrets/PII/code/jailbreak, policy checking, blocking based on risk band, recording to usage log, and that the raw prompt is never stored. This is comprehensive for a guarded generation tool.

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 a header, a paragraph explaining the guard mechanism, and bullet points for args. It is slightly verbose but every sentence adds value, making it efficient for an agent.

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?

The description covers the process and parameters well but does not explain the return value or response format. Given no output schema, a brief mention of what the tool returns (e.g., success/error, generated text) would improve completeness.

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?

The schema has 0% description coverage, but the description provides meaningful explanations for each parameter (e.g., `model` is the model to run, `block_threshold` blocks when risk band >= this), adding value beyond the schema's titles.

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: a write operation that scans and policy-gates a prompt, records it, and runs Ollama if allowed. It distinguishes itself from siblings like `scan_prompt` which only scans without generation.

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 explains when to use the tool: when a prompt needs to go through the guard. It implies alternatives like `scan_prompt` for just scanning, but does not explicitly state when not to use it or name all alternative tools.

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/AIops-tools/AI-Guardian'

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