# Agent Guard Prompt Injection & PII Firewall (x402)

> Hybrid Edge AI firewall (Llama Guard 3 + heuristics) for prompt injection & PII via x402 USDC.

- name: io.github.brunopompeo1/agent-guard-x402
- version: 2.7.1
- connection class: R0 (autonomous)
- trust: 92/100 flags: duplicate-repo
- quality: 89/100 (good)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/io.github.brunopompeo1%2Fagent-guard-x402
- tools: https://api.protogrid.dev/v1/servers/io.github.brunopompeo1%2Fagent-guard-x402/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "agent-guard-x402": {
      "type": "http",
      "url": "https://agent-guard-x402.architect-x402.workers.dev/mcp"
    }
  }
}
```


## Trust

- hygiene: 80
- liveness: 98
- freshness: 100
- provenance: 90
- drivers: +repository +namespace-matches-repo +website +reachable +uptime-96% +updated-4d-ago -duplicate-repo(13 names)
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 89/100 (good)

### protocol: 75 (weight 25)

- warn `protocol.modern`: newest supported version is 2025-06-18; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
- n/a `protocol.stateless`: only applies to 2026-07-28 servers
- pass `protocol.transport`: streamable HTTP
- n/a `protocol.list_ttl`: only applies to 2026-07-28 servers

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 94 (weight 30)

- pass `tools.descriptions`: every tool has a description
- warn `tools.description_length`: 3 tools have descriptions over 1,024 characters, which crowds the context
- pass `tools.schemas`: every tool has an object input schema
- pass `tools.annotations`: 3 of 3 tools declare readOnlyHint or destructiveHint
- pass `tools.directory_hints`: every tool declares readOnlyHint, destructiveHint, idempotentHint and openWorldHint
- pass `tools.token_cost`: about 1,352 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump
- pass `tools.hidden_text`: no hidden text in tool names, descriptions, schemas or annotations
- pass `tools.poisoning`: no instructions aimed at the model in tool definitions

### stability: 100 (weight 15)

- pass `stability.changes`: 5 tool changes in 30 days
- pass `stability.rug_pull`: no tool changed its meaning under the same name
- pass `stability.new_links`: no tool change named a new site

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 3, about 1,352 tokens to load them all
- tool set hash: e6a29833964104e24862630c466533ea
- tools last changed: 2026-11-25T04:10:08.185Z
- badge: [![protogrid quality](https://protogrid.dev/badge/io.github.brunopompeo1/agent-guard-x402.svg)](https://protogrid.dev/servers/io.github.brunopompeo1/agent-guard-x402)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Definition changes

- 2026-11-25 `agent_guard_sanitize` removed
  - Hybrid Edge AI firewall (@cf/meta/llama-guard-3-8b + multi-language regex + Base64 decoder) that detects prompt injection and masks corporate PII/secrets (0.008 USDC via x402 on Base).
- 2026-11-25 `redact_pii_text` added
  - Replaces personal data and credentials in one block of text with stable placeholders: CPF, CNPJ, email, credit card, API keys and bearer tokens, and crypto private keys. It returns the masked text, the number of occurrences replaced and an estimate of the tokens saved. Use it to scrub logs, prompts, support tickets or documents before they reach a third-party model or a storage layer, and when low latency matters because the semantic model pass is deliberately skipped. Do not use it to decide whether text is hostile, since pattern-level injection signals are still reported but the semantic pass is off (use scan_prompt_injection for a verdict, or sanitize_untrusted_input for verdict plus masking in one call). Deterministic, read-only and idempotent: nothing is stored, no outbound request is made, and re-running it over its own output changes nothing. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header, and an empty or non-string 'text' returns HTTP 400 with success:false rather than an exception. Redaction is pattern-based, so it is a strong reduction of exposure and not a legal guarantee of anonymisation.
- 2026-11-25 `scan_prompt_injection` added
  - Classifies one block of untrusted text as clean, suspicious or critical for prompt injection, jailbreak and tool-abuse attempts, combining a multi-language pattern engine, a Base64 payload decoder and a Llama Guard 3 8B semantic pass. It leaves the text byte-identical, so use it as a gate when the original wording must survive for audit, display or downstream parsing, and branch on isSafe or threatLevel. Do not use it when the goal is to strip personal data (use redact_pii_text) or when you want the verdict and the masked text in one call (use sanitize_untrusted_input). Read-only and idempotent: nothing is stored, no outbound request is made, and a retry is always safe. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header, and an empty or non-string 'text' returns HTTP 400 with success:false rather than an exception. If the semantic pass is unavailable the call still succeeds with aiAudit.verdict 'skipped', meaning the score came from the pattern engine alone.
- 2026-11-25 `sanitize_untrusted_input` added
  - Runs the complete firewall over one block of untrusted text in a single call: the multi-language pattern engine plus Base64 decoder for prompt-injection detection, and the regex redactor for Brazilian and corporate PII and secrets. Returns the threat verdict and the masked text together. Use this as the default guard in front of any model call that ingests third-party content such as scraped pages, inbound email, tool output or user uploads. Do not use it when you only need the verdict and must keep the original wording intact (use scan_prompt_injection) or when you only need redaction and want to skip the model latency (use redact_pii_text). Read-only and idempotent: nothing is stored, no outbound request is made and the same text returns the same verdict, so a retry is always safe, although the semantic pass can degrade to verdict 'skipped' under model pressure. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header, and an empty or non-string 'text' returns HTTP 400 with success:false rather than an exception, so an agent loop never breaks.
- 2026-11-17 `agent_guard_sanitize` changed (description)
  - before: Hybrid Edge AI firewall (@cf/meta/llama-guard-3-8b + multi-language regex + Base64 decoder) that detects prompt injection and masks corporate PII/secrets (0.02 USDC via x402 on Base).
  - after: Hybrid Edge AI firewall (@cf/meta/llama-guard-3-8b + multi-language regex + Base64 decoder) that detects prompt injection and masks corporate PII/secrets (0.008 USDC via x402 on Base).

Full history: https://api.protogrid.dev/v1/servers/io.github.brunopompeo1%2Fagent-guard-x402/changes

## Remotes

- https://agent-guard-x402.architect-x402.workers.dev/mcp (streamable-http, auth none, reachable true, uptime30d 0.96153843)

## Packages

_none_

## Tools (3)

- `redact_pii_text`: Replaces personal data and credentials in one block of text with stable placeholders: CPF, CNPJ, email, credit card, API keys and bearer tokens, and crypto private keys. It returns the masked text, the number of occurrences replaced and an estimate of the tokens saved. Use it to scrub logs, prompts, support tickets or documents before they reach a third-party model or a storage layer, and when low latency matters because the semantic model pass is deliberately skipped. Do not use it to decide whether text is hostile, since pattern-level injection signals are still reported but the semantic pass is off (use scan_prompt_injection for a verdict, or sanitize_untrusted_input for verdict plus masking in one call). Deterministic, read-only and idempotent: nothing is stored, no outbound request is made, and re-running it over its own output changes nothing. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header, and an empty or non-string 'text' returns HTTP 400 with success:false rather than an exception. Redaction is pattern-based, so it is a strong reduction of exposure and not a legal guarantee of anonymisation.
- `sanitize_untrusted_input`: Runs the complete firewall over one block of untrusted text in a single call: the multi-language pattern engine plus Base64 decoder for prompt-injection detection, and the regex redactor for Brazilian and corporate PII and secrets. Returns the threat verdict and the masked text together. Use this as the default guard in front of any model call that ingests third-party content such as scraped pages, inbound email, tool output or user uploads. Do not use it when you only need the verdict and must keep the original wording intact (use scan_prompt_injection) or when you only need redaction and want to skip the model latency (use redact_pii_text). Read-only and idempotent: nothing is stored, no outbound request is made and the same text returns the same verdict, so a retry is always safe, although the semantic pass can degrade to verdict 'skipped' under model pressure. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header, and an empty or non-string 'text' returns HTTP 400 with success:false rather than an exception, so an agent loop never breaks.
- `scan_prompt_injection`: Classifies one block of untrusted text as clean, suspicious or critical for prompt injection, jailbreak and tool-abuse attempts, combining a multi-language pattern engine, a Base64 payload decoder and a Llama Guard 3 8B semantic pass. It leaves the text byte-identical, so use it as a gate when the original wording must survive for audit, display or downstream parsing, and branch on isSafe or threatLevel. Do not use it when the goal is to strip personal data (use redact_pii_text) or when you want the verdict and the masked text in one call (use sanitize_untrusted_input). Read-only and idempotent: nothing is stored, no outbound request is made, and a retry is always safe. Costs 0.008 USDC per call via x402 v2 on Base (eip155:8453) or a B2B X-API-Key; an unpaid call returns HTTP 402 with a PAYMENT-REQUIRED header, and an empty or non-string 'text' returns HTTP 400 with success:false rather than an exception. If the semantic pass is unavailable the call still succeeds with aiAudit.verdict 'skipped', meaning the score came from the pattern engine alone.
