---
name: audit-anything
description: Polymorphic 5-domain deterministic technical pre-audit engine across Passive Web TLS/Headers (web_tls), OWASP/SOC2/GDPR Config Baselines (compliance_config), SBOM & Copyleft License/CVE Audits (sbom_license), Privacy/ToS Poison-Pill Clauses (privacy_tos), and Zero-Echo Secret-Leak Scanning (secret_scan) via REST, JSON-RPC 2.0 /mcp, 0%-commission Treg Hub, or run_hand.py. Strictly bills $0 on invalid input, HTTP 422, SSRF, or error.
---

# Audit-Anything — Agent-Executable Skill Contract

Use **Audit-Anything** (`https://audit.fastmesh.dev`, local dev `http://127.0.0.1:9001`) whenever an autonomous engineering agent, DevSecOps CI pipeline, or procurement workflow needs a deterministic, tamper-evident **`AuditDossier`** covering public HTTPS posture, infrastructure/API config baselines, dependency/SBOM license & CVE compliance, vendor Privacy/ToS poison-pill clauses, or zero-echo secret-leak detection.

> **Non-Licensed Technical Tooling Disclaimer**: Audit-Anything provides deterministic technical pre-audit tooling only. It is **not a CPA firm**, **not a law firm**, does **not provide legal advice**, and does **not issue a formal audit report** or SOC 2 certification.

---

## Core Surfaces & Distribution Channels

- **Web 5-Second Try-Now Console (zero signup)**: `https://audit.fastmesh.dev/`
- **Single Audit REST API**: `POST https://audit.fastmesh.dev/api/audit` (alias: `POST /audit`)
- **Concurrent Batch Audit API**: `POST https://audit.fastmesh.dev/api/batch` (alias: `POST /batch`)
- **Multi-Format Exporter (JSON / Markdown / CSV / SARIF 2.1.0)**: `POST https://audit.fastmesh.dev/api/export` (alias: `POST /export`)
- **Native Streamable MCP Server (JSON-RPC 2.0)**: `POST https://audit.fastmesh.dev/mcp`
- **OpenAPI 3.1.0 Spec**: `GET https://audit.fastmesh.dev/openapi.json`
- **Health & Readiness**: `GET https://audit.fastmesh.dev/health`
- **Treg Hub 0%-Commission Package**: `audit-anything-deterministic-auditor` (`c01_audit_anything_v1`)
- **Causal Bazaar Edge Hand**: `run_hand.py` (`hand_id: c01_audit_anything_hand_v1`, `card_id: c01_audit_anything_v1`)
- **Discovery Manifest**: `https://audit.fastmesh.dev/llms.txt`

---

## Per-Call Pricing, Credit Packs & Security Invariants

| Domain | Scope | Live / New-Tenant Cache (`100%`) | Same-Tenant Recheck (`10%`) | Invalid / `422` / SSRF / Error |
| :--- | :--- | :---: | :---: | :---: |
| `web_tls` | Passive TLS version/cipher/cert expiry, HSTS, CSP, CORS, cookies, `security.txt`, info-leak headers | `$0.05` (`50,000` micros) | `$0.005` (`5,000`) | `$0.00` |
| `compliance_config` | OpenAPI 3.x, JSON arch specs, Nginx, Caddyfile, Dockerfile, docker-compose vs OWASP/SOC 2/GDPR | `$0.05` (`50,000` micros) | `$0.005` (`5,000`) | `$0.00` |
| `sbom_license` | `package.json`, `requirements.txt`, `pyproject.toml`, `Cargo.toml`, `go.mod`, CycloneDX, SPDX (copyleft + unpinned + CVE thresholds) | `$0.04` (`40,000` micros) | `$0.004` (`4,000`) | `$0.00` |
| `privacy_tos` | Privacy Policy & ToS poison-pill scanner (§7.1 AI training, data resale, §9.2 confidentiality carve-outs, GDPR Art. 17/46) + redlines | `$0.06` (`60,000` micros) | `$0.006` (`6,000`) | `$0.00` |
| `secret_scan` | AWS, Stripe, Creem, GitHub PAT, Slack, Google, JWT, PEM, DB URI prefix + Shannon entropy detection with zero plaintext echo | `$0.05` (`50,000` micros) | `$0.005` (`5,000`) | `$0.00` |
| `auto` | Deterministic format classifier routing to one of the 5 domains | Matched rate (`$0.04–$0.06`) | `10%` of matched rate | `$0.00` |

**Prepaid Non-Expiring Creem Credit Packs**: Starter `$19` (`sku_audit_starter_19`, `$19.00` credits), Growth `$79` (`sku_audit_growth_79`, `$86.90` credits, `+10%`), Scale `$249` (`sku_audit_scale_249`, `$298.80` credits, `+20%`).

### Non-Negotiable Security & Billing Guarantees

1. **SSRF Protection (Strict HTTP `422`, `$0` Billed)**: Before any outbound socket/HTTP request, hostnames are resolved and unconditionally blocked if targeting loopback (`127.0.0.0/8`, `::1`, `localhost`), RFC 1918 private networks (`10/8`, `172.16/12`, `192.168/16`), link-local / cloud metadata (`169.254/16`, `169.254.169.254`, `fe80::/10`, `metadata.google.internal`), CGNAT (`100.64/10`), multicast/reserved IPs, or non-HTTP(S) schemes (`file://`, `ftp://`, `gopher://`).
2. **Zero Plaintext Secret Echo**: `secret_scan` NEVER echoes raw credentials in JSON findings, remediation patches, SARIF/CSV/Markdown exports, logs, error payloads, or SQLite archive cache rows. Every finding emits only a safe masked preview (e.g., `AKIA****REDACTED`), `secret_sha256_prefix_12`, 1-based `line_number`, and a provider rotation checklist.
3. **Strict `$0` on Empty / `422` / SSRF / Fake-200 / Upstream Failure**: Deceptive HTTP `200` error HTML shells, empty/sentinel inputs, SSRF refusals, and unreachable hosts always return `ok: false`, `billed_micros: 0`, and never poison the archive cache.
4. **Hard `$2.00` Spend Cap**: `/api/batch` and `run_hand.py` enforce `max_budget_micros <= 2000000` (`$2.00`).
5. **Zero Data Resale (`zero_data_resale: true`)**: Pure Python 3 stdlib deterministic execution — payloads are never forwarded to third-party AI model APIs, never resold, and never used for training.

---

## Invocation Pattern 1: REST API (`POST /api/audit`, `/api/batch`, `/api/export`)

```bash
# 1. Passive public Web TLS & security headers ($0.05)
curl -fsSL -X POST "https://audit.fastmesh.dev/api/audit" \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: devsecops-ci" \
  -d '{"domain":"web_tls","target":"https://example.com","verify":true}'

# 2. OWASP / SOC2 / GDPR Dockerfile config audit ($0.05)
curl -fsSL -X POST "https://audit.fastmesh.dev/api/audit" \
  -H "Content-Type: application/json" \
  -d '{"domain":"compliance_config","content":"FROM python:3.11-slim\nUSER root\nEXPOSE 80\nCMD [\"python\",\"app.py\"]"}'

# 3. SBOM & viral license conflict audit ($0.04)
curl -fsSL -X POST "https://audit.fastmesh.dev/api/audit" \
  -H "Content-Type: application/json" \
  -d '{"domain":"sbom_license","content":"{\"license\":\"AGPL-3.0\",\"dependencies\":{\"lodash\":\"4.17.15\",\"express\":\"*\"}}"}'

# 4. Privacy Policy & ToS poison-pill scan ($0.06)
curl -fsSL -X POST "https://audit.fastmesh.dev/api/audit" \
  -H "Content-Type: application/json" \
  -d '{"domain":"privacy_tos","content":"Section 7.1 grants a perpetual irrevocable sublicensable license to train models and resell customer outputs."}'

# 5. Secret-leak scan with zero plaintext echo ($0.05)
curl -fsSL -X POST "https://audit.fastmesh.dev/api/audit" \
  -H "Content-Type: application/json" \
  -d '{"domain":"secret_scan","content":"AWS_ACCESS_KEY_ID=AKIA_<REDACTED>\nENV=production"}'

# 6. Export AuditDossier to SARIF 2.1.0 for GitHub Code Scanning
curl -fsSL -X POST "https://audit.fastmesh.dev/api/export" \
  -H "Content-Type: application/json" \
  -d '{"domain":"compliance_config","content":"FROM python:latest\nUSER root","format":"sarif"}'
```

---

## Invocation Pattern 2: Native JSON-RPC 2.0 MCP (`POST /mcp`)

Four flat tools exposed via `initialize`, `tools/list`, and `tools/call`:

| MCP Tool | Purpose | Key Arguments |
| :--- | :--- | :--- |
| `audit_artifact` | Run a single polymorphic audit across any of the 5 domains (`auto` supported) | `domain`, `target` (or `url`/`content`), `format`, `verify` |
| `audit_batch` | Concurrent heterogeneous batch audit with hard `$2.00` budget ceiling | `items` (list of `{domain, target/content}`), `max_budget_micros` |
| `audit_pricing` | Fetch live micro-USD domain pricing, cache tiers, and Creem packs (`$0`) | `{}` |
| `audit_verify_attestation` | Verify deterministic 64-hex `sha256_attestation` of any `AuditDossier` (`$0`) | `dossier` |

```bash
curl -fsSL -X POST "https://audit.fastmesh.dev/mcp" \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: mcp-security-agent" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "audit_artifact",
      "arguments": {
        "domain": "sbom_license",
        "content": "{\"license\":\"MIT\",\"dependencies\":{\"lodash\":\"4.17.15\"}}",
        "verify": true
      }
    }
  }'
```

---

## Invocation Pattern 3: Treg Hub (0%-Commission QuickJS Package)

```bash
treg call audit-anything-deterministic-auditor --data '{
  "domain": "web_tls",
  "target": "https://example.com",
  "format": "json",
  "max_cost_micros": 100000
}'
```

---

## Invocation Pattern 4: Causal Bazaar Edge Hand (`run_hand.py`)

Invoke directly via Python import or CLI (`hand_id: c01_audit_anything_hand_v1`, hard `$2.00` external cap, `$0` on `422`/SSRF/error):

```bash
python3 run_hand.py --json '{"domain":"auto","content":"FROM python:3.12-slim\nUSER root\nEXPOSE 2375"}'
```

```python
from run_hand import run_hand

dossier = run_hand({
    "domain": "privacy_tos",
    "content": "Section 7.1 grants a perpetual irrevocable license to resell prompts to model vendors.",
    "tenant_id": "bazaar-agent-01",
    "max_budget_micros": 100000,
})
assert dossier["ok"] is True
assert dossier["zero_data_resale"] is True
```

---

## Exact `AuditDossier` Response Schema & Grade Scale

Every valid audit returns:
- `ok` (`bool`), `dossier_id` (`str`), `domain` (`str`), `detected_format` (`str`)
- `score_0_100` (`int` `0..100`, starting at `100` with deductions: `critical -25`, `high -14`, `medium -7`, `low -3`, `info 0`)
- `grade` (`"A+"` `95–100`, `"A"` `88–94`, `"B"` `75–87`, `"C"` `60–74`, `"D"` `45–59`, `"F"` `0–44`)
- `summary` (`str`)
- `findings_count` (`{critical, high, medium, low, info, total}`)
- `critical_findings` (`list[dict]` — all `critical` and `high` findings)
- `findings` (`list[dict]` — sorted deterministically by severity, rule ID, location, title; includes `id`, `severity`, `category`, `title`, `description`, `evidence`, `location`, `controls`, `remediation`)
- `remediation_patches` (`list[dict]` — copy-paste config snippets, redline counter-clauses, or provider rotation steps)
- `cache` (`{hit, scope, ttl_seconds, price_percent}`)
- `billing` (`{base_price_micros, billed_micros, billed_usd, external_cost_micros, tenant_id, charge_reason}`)
- `billed_micros` (top-level `int`, ALWAYS `0` on `422`/SSRF/fake-200/error)
- `sha256_attestation` (deterministic 64-hex SHA-256 over canonical core findings & patches)
- `disclaimer` (non-licensed technical tooling notice)
- `zero_data_resale` (`true`), `generated_at_utc` (`ISO-8601 UTC`)

### Agent Recovery Playbook

- **HTTP `422` (`billed_micros: 0`)**: Input was empty, malformed, unparseable, or blocked by the SSRF private-IP/metadata guard. Fix target/format before retrying — zero credits were consumed.
- **Same-Tenant Verification**: Re-submit with the same `X-Tenant-Id` after patching to validate remediation or re-read cached dossier at `10%` of base price.
- **Attestation Check**: Pass any received `AuditDossier` to `audit_verify_attestation` via `/mcp` to confirm tamper-free integrity before attaching evidence to PRs or customer security questionnaires.
