---
title: "Citadel Docs"
description: "Add Citadel before a lending or claims workflow funds, binds, or pays."
---

# Citadel Docs

Add Citadel before a lending or claims workflow funds, binds, or pays.

Source URL: https://trymighty.ai/docs

Citadel checks the file a borrower or claimant sent, before your workflow funds, binds, or pays. Mighty is the company. The API host stays `gateway.trymighty.ai`. Keep the key in `MIGHTY_API_KEY`.

Citadel flags generated or edited files, and hidden instructions inside those files. It does not score whether a claim is true.

Citadel flow: customer file -> POST /v1/scan -> route allow, review, or block before funding or payout. The API names review as WARN.

Choose the guide that matches the file: income documents, claim photos, file upload, text your existing reader already pulled, or production controls.

## The call

Scan the file when it arrives (`scan_phase=input`). If your workflow later reads text out of that file, or a model writes a summary, scan that too (`scan_phase=output`) and reuse `scan_group_id`.

Reuse `session_id` when the same loan, claim, or chat continues. For setting recipes, start with [Choose Scan Settings](/docs/concepts/configs).

## The basic call

```bash
curl -X POST https://gateway.trymighty.ai/v1/scan \
  -H "Authorization: Bearer $MIGHTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Please process this claim note before the adjuster sees it.",
    "content_type": "text",
    "scan_phase": "input",
    "mode": "secure",
    "focus": "steg",
    "profile": "balanced",
    "data_sensitivity": "standard"
  }'
```

## Read the result

| Action | Meaning | Common routing |
| --- | --- | --- |
| `ALLOW` | No material risk was found. | Continue the workflow. |
| `WARN` | Something deserves review or extra controls. | Continue with friction, queue review, or request more evidence. |
| `BLOCK` | The risk is high enough to stop the action. | Stop the workflow and show a safe message. |

`action` is always one of `ALLOW`, `WARN`, or `BLOCK`. Marketing copy says allow, review, or block. The API names review as `WARN`.

The forensics block can return `authenticity.verdict = "indeterminate"` when evidence is weak, incomplete, or conflicting. That is a verdict on the file, not a routing action. Treat `indeterminate` as a review route.

## What shows up in the file

- Generated or edited damage photos.
- Altered invoices or repair estimates.
- Synthetic paystubs, W-2s, or bank statements.
- Hidden instructions in PDFs, images, or text already read from the file.
- Extracted text that tells an automation to ignore rules.
- Unsafe model output before a reviewer sees it.

Citadel gives you one place to inspect that material and route it before funding, bind, or payout.

## Drift

Risk changes when users submit new formats, a reader produces new text, models change output, tools return new content, or policy moves from tolerant to strict.

Rescan derived output with the same `scan_group_id`. Keep the wider loan, claim, batch, or agent run on the same `session_id`.

## Give this to your AI coding agent

### Implement Citadel in my product

```text
You are adding Citadel, Mighty's product, to an existing lending or claims workflow.

Goal:
Add a server-side scan before a customer-submitted file reaches funding, bind, payout, storage, or automation.

Use:
- API base URL: https://gateway.trymighty.ai
- Endpoint: POST /v1/scan
- Env var: MIGHTY_API_KEY
- Never expose the API key to the browser.

Read these docs first:
- /docs/quickstart
- /docs/use-cases
- /docs/concepts/how-mighty-works
- /docs/concepts/configs
- The guide that matches the file

Implementation rules:
1. Scan the submitted file with scan_phase=input.
2. Store scan_id, request_id, session_id, and scan_group_id.
3. Route ALLOW, WARN, BLOCK. Marketing calls WARN review.
4. Reuse scan_group_id when scanning extracted text or a model summary from the same file.
5. Use data_sensitivity=tolerant only when expected PII should not block the workflow.
6. Add tests for ALLOW, WARN, BLOCK, 400, 402, 413, and 429 paths.
7. Rescan derived output when the reader, model, agent, or policy changes.

Acceptance criteria:
- API key only exists on the server.
- Scan errors use safe fallback behavior.
- Logs include request_id and scan_id.
- A flagged file does not reach funding, bind, or payout without a route.
- Review wording says Citadel flagged risk, not that it proved fraud.
```

## Production checklist

- Keep `MIGHTY_API_KEY` on the server.
- Generate a unique `request_id` per scan or let Citadel generate one.
- Persist `scan_id`, `scan_group_id`, `session_id`, and `action`.
- Route `WARN` to review or a constrained flow.
- Route `BLOCK` to a safe stop.
- Use async for deep image or PDF checks when latency matters.
- Store raw files according to your own retention policy.
- Do not tell users that Citadel proved fraud. Say it flagged risk for review.
