Skip to main content
Glama
mzaid007

Universal Poison Armor

Scan Dataset For Anomalies

scan_dataset_for_anomalies

Scan document collections, training examples, or RAG retrieval sets to uncover semantic anomalies and poisoned clusters using local embeddings and Isolation Forest.

Instructions

Scan a collection of documents, training examples, or retrieved RAG items for semantic anomalies and poisoned clusters.

Uses dense sentence embeddings (all-MiniLM-L6-v2) and Isolation Forests to detect statistical outliers that diverge from expected corpus distributions (identifying backdoor triggers, data poisoning, or trojans).

Usage Guidelines:

  • WHEN TO USE: Use on collections, batches, or lists of documents (RAG retrieval sets, dataset splits, multi-file contents) to identify poisoned outlier clusters.

  • WHEN NOT TO USE: Do NOT use for single-document regex sanitization, prompt injection stripping, or tracking pixel removal (use sanitize_document instead), nor for domain authority auditing across web search results (use verify_article_consensus instead).

Behavior & Side Effects:

  • Computes dense vector embeddings locally (100% offline, privacy-preserving).

  • Fits an Isolation Forest model and calculates centroid cosine distance metrics.

  • Appends timestamped anomaly entries to security_audit.json when outliers are detected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentsYesA list of text documents or context chunks to analyze for distribution anomalies.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are provided, so the description takes full responsibility for behavioral disclosure. It discloses offline embedding computation, Isolation Forest fitting, cosine distance metrics, and the side effect of appending to security_audit.json. This is unusually transparent for a tool definition.

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 organized with clear sections and front-loaded purpose. It is longer than average but every section earns its place. Minor redundancy exists in repeatedly describing anomaly detection, but not enough to harm usability.

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 tool with one parameter, no annotations, and an output schema (so return details are covered elsewhere), the description is complete: it gives method, use cases, exclusions, and side effects. Nothing an agent needs to decide whether to call it is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents the 'documents' parameter. The description adds examples (training examples, RAG items) and aligns with the schema's 'context chunks', but does not provide critical additional syntax or formatting semantics. Baseline 3 applies.

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 begins with a specific verb and resource: 'Scan a collection of documents, training examples, or retrieved RAG items for semantic anomalies and poisoned clusters.' It clearly differentiates from siblings by focusing on batch-level anomaly detection rather than single-document sanitization or web consensus verification.

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

Usage Guidelines5/5

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

Explicit WHEN TO USE and WHEN NOT TO USE sections name exact conditions and alternatives (sanitize_document, verify_article_consensus). It leaves no ambiguity about appropriate invocation contexts.

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