Mighty
Why MightyCitadel
Use cases
LendingIncome files before you fundInsuranceAppraisals to claim photosClaimsPhotos and estimates at first noticeAll use cases
SecurityDocsLog in
See it on your files

Docs

Direct SaaS purchase is no longer offered

New commercial terms are enterprise or custom, scoped on a call.

See it on your files
Browse docs
Start Here
Citadel Docs5-Minute QuickstartMighty PlatformUse CasesFAQ
Core Concepts
How Citadel WorksModalities And AttacksModes And ToleranceChoose Scan SettingsGlossarySessions And Scan GroupsDriftBilling, SCU, And Limits
Integration Guides
Integration GuidesMultimodal SupportScan Text And OCR OutputScan File UploadsDamage Photo AI Fraud ReviewScan Model OutputAsync Deep ScansError Handling
Frameworks
Framework Integration MapVercel AI SDK Chat GuardrailNext.js Upload GuardrailBackend API HelpersDocument Processing PipelineLangChain + LangGraph Guardrail
Workflows
Workflow Playbooks
API Reference
POST /v1/scan
Use With AI
Use With AI
Start Here
Citadel Docs5-Minute QuickstartMighty PlatformUse CasesFAQ
Core Concepts
How Citadel WorksModalities And AttacksModes And ToleranceChoose Scan SettingsGlossarySessions And Scan GroupsDriftBilling, SCU, And Limits
Integration Guides
Integration GuidesMultimodal SupportScan Text And OCR OutputScan File UploadsDamage Photo AI Fraud ReviewScan Model OutputAsync Deep ScansError Handling
Frameworks
Framework Integration MapVercel AI SDK Chat GuardrailNext.js Upload GuardrailBackend API HelpersDocument Processing PipelineLangChain + LangGraph Guardrail
Workflows
Workflow Playbooks
API Reference
POST /v1/scan
Use With AI
Use With AI
Loading docs…
Mighty

Citadel is Mighty's product. It finds generated or AI-edited fakes in customer files.

See it on your files

Platform

  • For Lending
  • For Insurance
  • For Claims
  • Product
  • Use Cases
  • Contact
  • Docs

Company

  • Why Mighty
  • Blog

Trust

  • Security
  • Status
  • Privacy
  • Terms
© 2026 Nine Suns Inc. All rights reserved.Citadel, from Mighty

Sessions And Scan Groups

Use session IDs, scan groups, and request IDs to connect multistep scans across chats, files, OCR, output, and review.

Most real integrations are multistep. A user uploads a file, OCR extracts text, an AI system summarizes it, and a reviewer makes a decision. Citadel gives you IDs so those scans stay connected.

This also protects against drift. When OCR, model output, review notes, or policy changes create new trusted material, rescan that material and keep it connected to the original item.

Multistep workflows

A session is the case. A scan group is one evidence chain.

1
1. First input scanSend the prompt, file, image, or OCR text with scan_phase=input.no session_id required
2
2. Citadel returns IDsStore session_id for the workflow and scan_group_id for this item.session_id + scan_group_id
3
3. Derived scans reuseOutput scans, OCR rescans, and summaries reuse the same scan_group_id.scan_phase=output requires scan_group_id
Optional app-owned IDchat thread, claim, case, batch, or agent runsession_id
Citadel-generated chain IDprompt plus response, file plus OCR, photo plus analysisscan_group_id
For the first input scan, you can omit both IDs. Citadel returns them. If your app already has a stable chat, claim, or case ID, you may send it as session_id. Output scans must reuse the returned scan_group_id.
Citadel superhero reviewing a bright session map that connects scan groups across prompts, files, OCR output, AI summaries, and review decisions
Sessions keep the whole workflow connected.Use one session for the chat, claim, case, batch, or agent run. Use scan groups for each evidence chain.

Use this rule:

  • session_id is the whole workflow, such as one claim, chat, batch, case, or agent run.
  • scan_group_id is one item or message inside that workflow.
  • Reuse scan_group_id only for derived scans from the same item.
  • Create a new scan_group_id for a different photo, file, invoice, chat turn, or evidence item.
  • For the first input scan, you can omit both IDs. Citadel returns them in the response and response headers.
  • If your app already has a stable chat, claim, case, or batch ID, you may send it as session_id.

The Three IDs

IDWhat it meansWhen to create it
request_idOne API request. Use it for idempotency and logs.Create a new one per scan request or let Citadel generate it.
scan_group_idOne item or related evidence chain inside the session.Let Citadel generate it on the first input scan, then reuse it for OCR text, model output, and review from the same item.
session_idOne ongoing workflow.Let Citadel generate it, or pass your own stable chat, claim, case, upload batch, or agent run ID.

Example Multistep Claim

  1. Claim note arrives.
  2. Scan the note with scan_phase=input.
  3. Store the returned session_id and scan_group_id.
  4. Upload a PDF and scan it with the same session_id.
  5. OCR extracts text from the PDF.
  6. Scan OCR text using the PDF scan's scan_group_id.
  7. AI summarizes the PDF.
  8. Scan the summary with scan_phase=output and the PDF scan_group_id.
  9. A second photo arrives, so let Citadel create a different scan_group_id under the same session_id.
  10. Review stores all scan IDs and final human decision.

Input Scan

{
  "content": "Customer note text",
  "content_type": "text",
  "scan_phase": "input"
}

Citadel returns session_id, scan_group_id, request_id, and scan_id. Store them.

{
  "action": "ALLOW",
  "scan_id": "4e7c5fc1-6947-492b-bd22-0589d6477c8b",
  "request_id": "ab82f4ad-8d64-4bb4-b4ed-77df63291198",
  "scan_group_id": "9b3e4f8d-96c9-4f42-8338-8cf9571c1c70",
  "session_id": "sess_generated_by_mighty"
}

Output Scan

{
  "content": "Generated summary shown to an adjuster.",
  "content_type": "text",
  "scan_phase": "output",
  "session_id": "sess_generated_by_mighty",
  "scan_group_id": "9b3e4f8d-96c9-4f42-8338-8cf9571c1c70"
}

scan_phase=output requires scan_group_id. This prevents generated output from becoming disconnected from the material that caused it.

Common Patterns

Workflowsession_idscan_group_id
Chat appChat thread IDPrompt and response pair
File uploadCase or user workflow IDOriginal file, OCR text, extracted fields
Damage photo reviewClaim IDOne photo and any generated analysis
Batch intakeBatch IDOne item in the batch
Agent runAgent run IDPrompt, retrieved content, tool output, final answer

Common Mistakes

  • Creating a new scan_group_id for model output. Reuse the input group.
  • Using one scan_group_id for a whole batch. Use one group per item.
  • Dropping request_id from logs. You need it to debug retries.
  • Treating Citadel scan results as review decisions. Store human review outcomes separately.
Next step

Ready to scan real traffic?

Book a working session on your files. Starting October 1, 2026, new commercial terms are enterprise or custom.

See it on your filesUnderstand SCU

AI-Agent Prompt

AI-ready prompt
Add session and scan group tracking

Paste this into Cursor, Codex, Claude Code, or Windsurf.

Add Citadel session and scan group tracking to this product.

Requirements:
- Generate or preserve request_id per scan request.
- Reuse session_id across one chat, claim, case, upload batch, or agent run.
- Store scan_group_id returned by input scans.
- Reuse scan_group_id for OCR output, extracted fields, model output, agent output, and review artifacts from the same item.
- Require scan_group_id when scan_phase=output.
- Store scan_id, request_id, scan_group_id, session_id, action, risk_score, threats, and review outcome.

Acceptance criteria:
- Input and output scans are connected.
- Batch items do not share one scan_group_id unless they are the same item.
- Logs can find all scans from one session_id.
- Tests cover retry idempotency and output scan group reuse.

On this page

The Three IDsExample Multistep ClaimInput ScanOutput ScanCommon PatternsCommon MistakesAI-Agent Prompt