Skip to main content
Glama
fairquery-llm-data-guard

fairquery-llm-data-guard

Official

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
APIFY_TOKENNoOptional Apify API token.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
guard_textA

WHAT: The only tool in this server that inspects content. Scans text documents (or public document URLs: txt/md/json/csv/HTML/PDF) for PII (emails, phones, US SSNs, Luhn-valid cards, IBANs, UK NINOs, IPs, optional person names/addresses) and secrets (AWS/GitHub/Slack/Stripe/OpenAI/... keys, JWTs, private keys, URL credentials, high-entropy key=value). mode="detect" reports findings; mode="redact" (default) also returns sanitized text and, on request, the placeholder map that restore_placeholders needs later. WHEN TO USE: before sending prompts, tickets, logs or files to an LLM or third party; to audit text for leaked credentials. Step 2 of the round trip (list_detectors -> guard_text -> [get_run_results] -> LLM -> restore_placeholders). WHEN NOT TO USE: to put originals back into an LLM answer, use restore_placeholders (free, local; mode="restore" here gives the same output but starts a paid run and is only kept for Actor pipelines outside MCP). To see entity types, list_detectors (free). To fetch rows of a run you already started, get_run_results (free; calling guard_text again starts and bills a new run). Not for images/scanned PDFs (text layer only, no OCR) or email deliverability. COST: paid. Runs Apify Actor fairquery/llm-data-guard-pii-secrets with your APIFY_TOKEN; pay-per-event: $0.0015 per document processed + $0.0002 per finding (error rows free). Example: 10 documents with 20 findings ~ $0.02. RETURNS: findings[] hold masked previews only, never raw values; placeholder_map (ORIGINAL values) only with returnPlaceholderMap=true. With waitForFinish=false: items is empty and run.run_id is the input for get_run_results. EXAMPLE: {"texts":["Mail jane@acme.com, key AKIAIOSFODNN7EXAMPLE"],"mode":"redact","redactionStyle":"placeholder"} -> output_text with the email replaced by [EMAIL_1] and the key by a placeholder; findings lists EMAIL and AWS_ACCESS_KEY. PARAMETERS: texts and/or documentUrls: at least one is required although the schema marks both optional (neither -> a free INPUT_EMPTY error row); both may be combined, and every text or URL is one billed document (max 1000 per run; extras get a free MAX_DOCUMENTS_EXCEEDED row). mode decides which other fields apply: "detect" ignores redactionStyle / returnPlaceholderMap; "redact" uses them; "restore" ignores all detector options and only replaces placeholders found in texts with values from placeholderMap (a placeholder missing from the map stays unchanged; restore rows have 0 findings, so they cost the per-document fee only). returnPlaceholderMap only works with mode="redact" + redactionStyle="placeholder" and is what restore_placeholders consumes; placeholders are consistent across all documents of one call ([EMAIL_1] is the same address everywhere) but numbering restarts on every call, so keep each call's map. detectNames / detectAddresses must be true before PERSON / LOCATION / STREET_ADDRESS can be found or used in entityTypes. entityTypes filters findings after detection (unknown names match nothing, no error) and is the main lever to cut per-finding cost. waitForFinish=false returns at once with run.run_id while the run continues in your Apify account (same price, billed once); use it for big batches or many URLs/PDFs that may not finish within this call's 280 s wait, then poll get_run_results with that run_id.

get_run_resultsA

WHAT: Read-only follow-up to guard_text(waitForFinish=false): returns the run status and one page of its result rows. It scans nothing itself. WHEN TO USE: only after guard_text returned run.run_id (large batches, many documentUrls or PDFs); poll until run.finished is true and page with nextOffset. Rows already written are returned while the run is RUNNING. WHEN NOT TO USE: to scan or redact (guard_text; a synchronous guard_text call already returns its rows, so there is nothing to poll). To restore placeholders in the rows' output_text after the LLM step, restore_placeholders (free). Cannot read runs of other Actors. BEHAVIOR: GET requests to your Apify account only (actor, run, dataset); never starts, aborts or re-bills a run. Typically <1 s; poll every 10-30 s. To stop a run early, abort it in the Apify console (run.console_url); this server has no abort tool. COST: free; needs the APIFY_TOKEN that started the run. The run was billed once, per document and finding, when it ran. RETURNS: run.status is READY | RUNNING | SUCCEEDED | FAILED | ABORTED | TIMED-OUT; finished=true for the last four, after which total no longer changes (FAILED/TIMED-OUT runs still return the rows they wrote). Rows are exactly the ones guard_text returns, including placeholder_map with ORIGINAL values if requested. Errors: APIFY_TOKEN_MISSING, RUN_NOT_FOUND, RUN_NOT_FOR_THIS_ACTOR, APIFY_TOKEN_INVALID, APIFY_RUN_LOOKUP_FAILED / APIFY_DATASET_READ_FAILED (retryable). PARAMETERS: runId comes from guard_text run.run_id. Pages are in write order; total counts rows written so far, so keep calling with nextOffset until it is null and finished is true. EXAMPLE: {"runId":"a1B2c3D4e5F6g7H8i"} -> {"run":{"status":"SUCCEEDED","finished":true},"count":1,"total":1,"items":[{"type":"document","risk_level":"high",...}]}

list_detectorsA

WHAT: Reference data, not a scan: the PII and secret entity types guard_text can detect, its redaction styles and its billable events. Inspects no text. WHEN TO USE: optional step 1, before guard_text, to choose entityTypes / redactionStyle, to estimate guard_text cost, or to explain coverage to a user. WHEN NOT TO USE: to check whether a given text contains PII or secrets (guard_text; this catalog cannot tell you that). Not needed before every guard_text call: guard_text runs all default detectors when entityTypes is omitted. To undo a redaction, restore_placeholders. BEHAVIOR: the catalog ships with this server version and is not fetched from the Actor, so a newer Actor build can support types that an older server version does not list. COST: free; no APIFY_TOKEN. RETURNS: pii / secret entries are valid guard_text entityTypes once the parenthesised note is dropped ("CREDIT_CARD (Luhn)" -> "CREDIT_CARD"); "opt-in" entries need guard_text detectNames / detectAddresses / entropyScan; redaction_styles keys are the allowed redactionStyle values (only "placeholder" can be undone with restore_placeholders). PARAMETERS: none; call with {}. EXAMPLE: {} -> {"pii":["EMAIL","PHONE",...],"secret":["AWS_ACCESS_KEY",...],...}

restore_placeholdersA

WHAT: The last step of the round trip and the default way to restore: puts original values back into texts (typically an LLM answer) that contain placeholders such as [EMAIL_1], using the placeholder_map from a guard_text redact call. Does no detection. WHEN TO USE: after the LLM answered a prompt you redacted with guard_text (mode="redact", redactionStyle="placeholder", returnPlaceholderMap=true), before showing the answer to the user. Prefer it over guard_text mode="restore": same output_text, but free and local. WHEN NOT TO USE: to find or redact PII/secrets (guard_text) or list entity types (list_detectors). Masked and hashed values cannot be restored; only placeholder style is reversible. BEHAVIOR: no network call; the map never leaves your machine; milliseconds. Up to 1000 texts and 5,000,000 chars in total per call. COST: free; no APIFY_TOKEN. RETURNS: replacements counts substituted placeholders; unknown_placeholders lists [TYPE_N] tokens the map does not cover (left as is, e.g. invented by the LLM). Errors: INPUT_TOO_LARGE. The output holds the ORIGINAL sensitive values: show it to the user, do not send it back to the LLM. PARAMETERS: placeholderMap must be the map of the redact call that produced the placeholders (numbering restarts on every call); only [UPPERCASE_TYPE_N] keys are used (exact, case-sensitive, one pass). A placeholder the LLM rewrote (e.g. "EMAIL_1" without brackets) is not restored. EXAMPLE: {"texts":["I will email [EMAIL_1] today."],"placeholderMap":{"[EMAIL_1]":"jane@acme.com"}} -> output_text "I will email jane@acme.com today.", replacements 1.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.7/5.0

Scored across 4 tools

Disambiguation4/5

Each tool has a distinct role (scan, poll, list reference types, restore), and descriptions explicitly tell agents when to use one over another. The only real overlap is guard_text mode="restore" versus restore_placeholders, but the description flags this and steers agents to the free tool.

Naming Consistency5/5

All four names follow a clean verb_noun snake_case pattern (guard_text, get_run_results, list_detectors, restore_placeholders). No casing or verb-style deviations.

Tool Count4/5

Four tools is on the lean side but each maps to a distinct stage of the redact/restore round trip, so nothing feels redundant. It is well-scoped for the domain, though there is little slack.

Completeness4/5

The lifecycle (discover types -> detect/redact -> poll async run -> restore) is fully covered, including an async path and a free local restore. Minor gaps exist: no abort/run-management tool (explicitly deferred to the Apify console) and no OCR/image handling.

Maintenance

ActivityNo data
ResponsivenessSyncing