# `audit_sender_domain` — Audit Sender Domain Authentication

> Part of [Domain & Email Deliverability Inspector](https://domain-deliverability.apikeg.com/llms.txt) (`com.apikeg/domain-deliverability`)

Performs a deep sender deliverability audit for a domain: MX & ESP provider fingerprinting, recursive RFC 7208 SPF tree evaluation (10-lookup cap, 2-void-lookup cap, cycle & multi-record permerror detection), DMARC policy & alignment, BIMI logo/VMC, and optional DKIM selector key checks, returning a 0-100 score, prioritized issues, and copy-paste DNS remediation records.

**Why call instead of DIY:** Recursively walks SPF include/redirect graphs with cycle detection and RFC 4408 multi-chunk TXT reassembly in one $0.002 call instead of writing fragile DNS parsers.

- **REST Endpoint:** `POST https://domain-deliverability.apikeg.com/v1/audit-sender-domain`
- **MCP Server:** `https://domain-deliverability.apikeg.com/mcp` (tool: `audit_sender_domain`)
- **Pricing:** $0.002 USD per sender domain authentication audit (x402 instant micropayment)
- **Free Dry-Run:** `POST https://domain-deliverability.apikeg.com/v1/audit-sender-domain?dry_run=true`

## Input JSON Schema
```json
{
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "minLength": 3,
      "maxLength": 253,
      "pattern": "^[^@\\s/]+\\.[^@\\s/]+$",
      "description": "Sender domain name to audit (e.g. 'acme.com')."
    },
    "dkimSelectors": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 63,
        "pattern": "^[a-zA-Z0-9._-]+$",
        "description": "DKIM selector name (e.g. 'google', 'selector1', 's1', 'k1', 'default')."
      },
      "maxItems": 10,
      "description": "Optional DKIM selectors to probe at <selector>._domainkey.<domain>."
    },
    "bimiSelector": {
      "type": "string",
      "default": "default",
      "minLength": 1,
      "maxLength": 63,
      "pattern": "^[a-zA-Z0-9._-]+$",
      "description": "BIMI selector to inspect at <selector>._bimi.<domain>."
    }
  },
  "required": [
    "domain"
  ],
  "additionalProperties": false
}
```

## Examples
### Full domain audit with DKIM selectors
```bash
curl -X POST "https://domain-deliverability.apikeg.com/v1/audit-sender-domain" \
  -H "Content-Type: application/json" \
  -d '{"domain":"acme.com","dkimSelectors":["google","s1"],"bimiSelector":"default"}'
```
Expected output: Returns 0-100 deliverability score, recursive SPF lookup tree, DMARC/DKIM/BIMI status, and copy-paste TXT fixes.
