{"schema_version":"1","site":"https://decosa.ai","id":"ma-dd-redflags","num":"69","name":"M&A due-diligence red flags","tool_name":"Write a due-diligence red-flag memo","short":"DD red flags","blurb":"For deal counsel and corporate development teams. Give it a data room: contracts, board minutes, the disclosure schedule, revenue by customer, financial summaries. For ten red-flag categories (change of control, anti-assignment, exclusivity and non-compete, MFN pricing, uncapped liability, debt covenants, IP assignment gaps, litigation missing from the disclosure schedule, customer concentration, key person), a reranked search pulls the passages that could hold one and an open model says which do, quoting the exact words. Code checks every quote word for word against the passage and byte span it cites, and a grounding check reads each finding against that passage. You get a red-flag memo with what to ask the seller, and a signed record. A triage aid for counsel, not legal advice.","status":"live","labels":{"industry":["legal","finance"],"job":["review","attest"],"input":["text","files"],"deploy":["selfhost"],"status":"live","output":["record","text"],"data":["confidential"],"hardware":"gpu-96","licence":"permissive"},"industries":["legal","finance"],"runs_in":["selfhost"],"part_of":[],"built_from":["evidence-retrieval","grounding","signed-record"],"models":"Qwen3.8-27B (one call per category, grounding of each finding) · Qwen3-Embedding + Qwen3-Reranker (the evidence retrieval block)","where":"Self-host for a real data room; the hosted demo takes invented rooms only","hardware":"1x RTX PRO 6000 (96 GB) for Qwen3.8-27B plus about 10 GB for the embedder and reranker; the quote checks, memo and record run on CPU","final_artifact":"A red-flag memo for counsel (flag, severity, document, verbatim quote with byte span, why it matters, what to ask) and a signed decosa.record.v1 with the retrieval index hash.","self_host_first":true,"verification":{"receipt_coverage":"full","summary":"Receipt per model call; signed search receipts with the index hash; every quote found word for word at the cited byte span; findings grounded; signed hash-chained record","manual_qa":{"hosted":{"date":"2026-09-27","result":"pass","p50_ms":92855,"p95_ms":null,"runs":null,"receipts_per_run":3,"cost_per_run_usd":0.002531},"selfhost":{"date":"2026-09-27","result":"pass","method":"fresh clone into a clean directory, api image from docker/api/Dockerfile, compose api with a named volume, direct route to the local Qwen3.8-27B and the running retrieval service, local signing; torn down after","notes":"The rehearsal bundle passed 13/13 in 101 s (Kestrel with its planted flags, the record verified and failed when changed, the clean Linnet room with no flags; every receipt attested). The retrieval service was not built from the compose file here: the running one was used."},"known_limits":["Hosted verification ran on the pre-release server (decosa-api the pre-release branch on our server, gateway route). The production API gets this tool when the branch merges.","Measured on five small invented rooms written by the same author as the prompts, and 28 public contracts; not on a real data room or against a lawyer's issues list.","Ten categories only; tax, employment, data protection, environmental and sanctions issues are not looked for.","Text only: scanned documents must go through the document reader block first.","'No flag found' means nothing turned up in the passages the search returned for that category; a run where model calls failed is marked incomplete."],"nightly_covers":null},"nightly":"https://api.decosa.ai/verify/status"},"eval_summary":{"metrics":[{"name":"Planted red flags caught","value":"20 / 20","unit":null,"n":20,"split":"test","note":"two held-out invented rooms (Osprey 11, Heron 9), wording set B, run once with prompts frozen"},{"name":"Flags raised in a clean room of near misses","value":"0","unit":null,"n":null,"split":"test","note":"held-out room Wren"},{"name":"Quotes found word for word at the cited byte span","value":"22 / 22","unit":null,"n":22,"split":"test","note":null},{"name":"Planted flags caught in 40-document rooms (48 public contracts added)","value":"20 / 20","unit":null,"n":20,"split":"test","note":"direct route; 0 flags raised in the added contracts"},{"name":"CUAD anti-assignment clauses found","value":"9 / 12","unit":null,"n":12,"split":"heldout","note":"28 public CUAD contracts, precision 0.75; BM25 only: 11 / 12"},{"name":"CUAD exclusivity and non-compete clauses found","value":"3 / 7","unit":null,"n":7,"split":"heldout","note":"precision 3/3; BM25 only: 4 / 7"},{"name":"Planted red flags caught, dev","value":"11 / 11","unit":null,"n":11,"split":"dev","note":"Kestrel; clean dev room Linnet: 0 flags"}],"dataset":"Five invented data rooms of 16 documents (dev Kestrel and clean Linnet; held-out Osprey, Heron and clean Wren, worded from a second clause set written before any model run); the held-out rooms padded with 48 CUAD v1 contracts (CC BY 4.0); 28 further CUAD contracts scored against CUAD's expert labels.","held_out":true,"caveats":["Same author wrote the rooms, the gold and the prompts; the rooms are short and tidy compared with real data rooms.","The invented rooms are at the ceiling: BM25 search and reading the whole room also found every planted flag, so they do not separate retrieval methods.","On public CUAD contracts BM25 did as well or better than the reranked hybrid; small n (28 contracts).","No real data room and no lawyer's review of the memos.","Stress and CUAD runs used the direct route to the same model because the gateway was down."],"date":"2026-09-27","doc_url":"https://decosa.ai/metrics/evals/ma-dd-redflags"},"stack":{"summary":"For deal counsel, corporate development and private-equity deal teams doing buy-side diligence. Give it a data room as text: contracts, board minutes, the disclosure schedule, revenue by customer, financial summaries. The evidence retrieval block cuts every document into chunks with byte offsets and hashes the corpus into one index hash. For each of ten red-flag categories (change of control, anti-assignment, exclusivity and non-compete, MFN pricing, uncapped liability, debt covenants, IP assignment gaps, litigation missing from the disclosure schedule, customer concentration, key person), fixed queries are searched and reranked, and Qwen3.8-27B reads the best passages and names the flags in their exact words. Code checks every quote word for word against the passage it cites and drops what it cannot find; the grounding block judges each finding against that passage. You get a Markdown memo (flag, severity, document, quote, byte span, why it matters, what to ask the seller) and a signed record of hashes. A triage aid for counsel, not legal advice.","tagline":"A data room in, a red-flag memo for counsel out: every flag quotes the exact words and the byte span it came from.","deployment":"self-host-first","regulatory_note":"Not a regulated activity in itself, but the output feeds legal advice, so a lawyer must review it. Written 27 Sep 2026. ABA Formal Opinion 512, Generative Artificial Intelligence Tools (29 Jul 2024; https://www.americanbar.org/content/dam/aba/administrative/professional_responsibility/ethics-opinions/aba-formal-opinion-512.pdf) reads the duties of competence (Model Rule 1.1), confidentiality (1.6) and supervision (5.1, 5.3) as requiring lawyers to understand a tool's limits, check its output and protect client information put into it (unverified: the ABA site blocked our fetch on 27 Sep 2026, so the date and summary are from the published opinion as we recall it; read it before relying on this). This tool supports those duties by quoting its sources word for word and running on the firm's own box; it does not replace the lawyer's review. Data rooms are usually under NDA: check the NDA before sending any document to a hosted service, which is why the hosted demo takes invented rooms only.","components":[{"id":"review","role":"Categories and queries, the quote gate, merging, the memo and the signed record (no model; CPU)","name":"decosa-api DD red flags (decosa_api/verticals/madd), importing the evidence retrieval block and the grounding judge (17)","hf_repo":null,"license":"AGPL-3.0-or-later","params":null,"quant":null,"vram_gb":0,"memory_gb_estimate":null,"engine":"Python 3.12; ten categories with written definitions and near-miss rules; verbatim quote search with whitespace, quote and dash normalisation; decosa.record.v1 hash chain","receipt_coverage":"partial","in_hosted_demo":null,"tiers":["lite","standard"],"alternative_to":null},{"id":"model","role":"One call per category (which passages show a flag, in their exact words, why it matters, what to ask) and the grounding judge on each finding","name":"Qwen3.8-27B (NVFP4)","hf_repo":"nvidia/Qwen3.8-27B-NVFP4","license":"Apache-2.0","params":"27.8B","quant":"NVFP4 (MLP NVFP4, GDN/attention FP8) + FP8 KV cache; MTP head, 3 draft tokens","vram_gb":20,"memory_gb_estimate":null,"engine":"vLLM 0.29.0, temperature 0, thinking off, JSON answers","receipt_coverage":"strong","in_hosted_demo":true,"tiers":["lite","standard"],"alternative_to":null},{"id":"retrieval","role":"Chunking with byte offsets, the index hash, hybrid search (dense + BM25) and reranking, with a signed receipt per search","name":"Evidence retrieval block: Qwen3-Embedding-0.6B + Qwen3-Reranker-4B (decosa-retrieval service)","hf_repo":"Qwen/Qwen3-Reranker-4B","license":"Apache-2.0","params":"0.6B + 4B","quant":"BF16","vram_gb":9,"memory_gb_estimate":null,"engine":"services/retrieval (transformers, one process, loaded once); decosa_api.retrieval in the API","receipt_coverage":"partial","in_hosted_demo":true,"tiers":["standard"],"alternative_to":null}],"tiers":[{"id":"lite","label":"Lite · BM25 retrieval, no retrieval service","summary":"The same review with DECOSA_MADD_RETRIEVAL=bm25: keyword search picks the passages, no embedder or reranker, so only the language model needs a GPU. Same quote gate, grounding and record.","components":["review","model"],"hardware":"1x GPU for Qwen3.8-27B","quality_evidence":[{"metric":"Planted flags caught, held-out rooms, BM25 only","value":"20 / 20, 0 in the clean room","source":"decosa-api docs/evals/ma-dd-redflags.md, test split (direct route), 27 Sep 2026"},{"metric":"CUAD public contracts: anti-assignment / exclusivity found, BM25 only","value":"11/12 (precision 0.917) / 4/7","source":"decosa-api docs/evals/ma-dd-redflags.md, CUAD check"}],"latency_note":"measured: seconds per data room on the direct route","in_hosted_demo":false,"receipt_coverage":"strong","receipt_note":"Every model call is receipted; searches are BM25 in code, so there are no embed or rerank attestations.","hosting":null},{"id":"standard","label":"Standard · retrieval service + the model (hosted demo)","summary":"The evidence retrieval block (Qwen3-Embedding-0.6B + Qwen3-Reranker-4B) picks the passages per category, Qwen3.8-27B names the flags, code checks the quotes and the grounding block checks the findings. This is what the hosted demo runs, on invented rooms only.","components":["review","model","retrieval"],"hardware":"1x RTX PRO 6000 96 GB (measured on shared cards)","quality_evidence":[{"metric":"Planted flags caught, held-out rooms (Osprey, Heron)","value":"20 / 20","source":"decosa-api docs/evals/ma-dd-redflags.md, test split, 27 Sep 2026"},{"metric":"Flags raised in the clean held-out room (Wren)","value":"0","source":"decosa-api docs/evals/ma-dd-redflags.md, test split"},{"metric":"Quotes found word for word at the cited byte span","value":"22 / 22 (held-out memo flags)","source":"decosa-api docs/evals/ma-dd-redflags.md, test split"},{"metric":"Planted flags caught with 48 public contracts added as distractors (40-document rooms)","value":"20 / 20, 0 flags in the added contracts","source":"decosa-api docs/evals/ma-dd-redflags.md, stress split (direct route)"},{"metric":"CUAD public contracts: anti-assignment / exclusivity / change of control found","value":"9/12 (precision 0.75) / 3/7 / 2/2","source":"decosa-api docs/evals/ma-dd-redflags.md, CUAD check, 28 contracts"}],"latency_note":"measured: under a minute per data room on the shared gateway route, a few minutes under heavy load; about a minute for a larger room self-hosted.","in_hosted_demo":true,"receipt_coverage":"strong","receipt_note":"Every Qwen3.8 call is a separate gateway call with a gateway-signed receipt; every search has a signed search receipt with the index hash; the record lists them all.","hosting":null}],"alternates":[{"id":"scans","label":"Scanned data rooms (document reader)","components":["review","model","retrieval"],"hardware":"1x RTX PRO 6000 96 GB (estimate)","use":"Read scanned PDFs into text with page and box cites first, then review. The document reader block exists; the two are not wired together here yet.","status":"not built"}],"services":[{"name":"decosa-api","port":8445,"image":"${DECOSA_REGISTRY}/decosa-api:<tag>","purpose":"GET /madd/info, /madd/samples; POST /madd/review (SSE or JSON); POST /record/verify. Keeps no document text."},{"name":"decosa-retrieval","port":8499,"image":"built from services/retrieval (no published image yet)","purpose":"Embedder and reranker for the evidence retrieval block, on the same GPU box; nothing leaves it."},{"name":"vLLM (model)","port":8114,"image":"vllm/vllm-openai@sha256:c2914767605584b6d8f45686b82de173ecc99e781897aa3d0a66dacd72c51ae1","purpose":"Qwen3.8-27B NVFP4 behind our gateway (hosted) or called directly (self-host)."}],"tools":[{"name":"CUAD v1 (Contract Understanding Atticus Dataset)","url":"https://huggingface.co/datasets/theatticusproject/cuad","license":"CC BY 4.0","purpose":"Public contracts with expert clause labels, eval only: 24 contracts added to each held-out room as distractors, and 28 more scored against CUAD's labels (credit: The Atticus Project)."},{"name":"ABA Formal Opinion 512, Generative Artificial Intelligence Tools (29 Jul 2024)","url":"https://www.americanbar.org/content/dam/aba/administrative/professional_responsibility/ethics-opinions/aba-formal-opinion-512.pdf","license":"ABA publication","purpose":"Lawyers' duties when using AI tools; cited in the regulatory note (not fetched: the site blocked us on 27 Sep 2026)."}],"hardware":[{"tier":"1x RTX PRO 6000 Blackwell 96 GB","fits":true,"notes":"Measured on our server: the eval and the hosted demo ran Qwen3.8-27B through the shared gateway on one card and the retrieval service on another GPU (about 10 GB)."},{"tier":"1x RTX 5090 32 GB","fits":false,"notes":"Estimate: Qwen3.8-27B NVFP4 (about 20 GB with a small KV cache) plus the 4B reranker (about 9 GB) is too tight; run the lite tier (BM25, no retrieval service) or put the retrieval service on a second card."},{"tier":"CPU only","fits":false,"notes":"The model needs a GPU. The quote checks, memo and record run on CPU."}],"latency":[{"lane":"one 16-document room, 10 categories with grounding, hosted gateway route","typical_ms":32100,"source":"measured on our server 2026-09-27: held-out rooms Osprey 34.5 s, Heron 32.1 s, Wren (clean) 20.8 s, gateway shared with other workloads"},{"lane":"the same, under heavy gateway load","typical_ms":218500,"source":"measured on our server 2026-09-27: dev room Kestrel, 22 model calls"},{"lane":"smoke test: 3 categories, no grounding, hosted gateway route","typical_ms":92855,"source":"measured on our server 2026-09-27, three runs 86-93 s while the gateway was slow (one run lost two calls to gateway errors and was marked incomplete)"},{"lane":"40-document room (about 550 chunks), self-hosted direct route","typical_ms":52000,"source":"measured on our server 2026-09-27: stress rooms 47 s and 58 s"}],"benchmark":null,"notes":["On three held-out invented rooms (20 planted red flags, plus a clean room of near misses) it caught 20 of 20 in the right category and raised no flag in the clean room; every quote was found word for word at its byte span.","Those rooms are at the ceiling: plain BM25 search and reading the whole room also found all 20. What retrieval buys is bounded prompts (a third of the tokens of reading the room) and a signed trail of which corpus version and passages the model saw.","On 28 public CUAD contracts scored against expert labels it is weaker: anti-assignment 9/12 found (precision 0.75), exclusivity and non-compete 3/7, change of control 2/2; BM25 did as well or better there (11/12, 4/7).","A triage aid: ten categories, never says a room is clean, and every flag is for counsel to confirm."]},"buyer_facts":[{"label":"Data retention","value":"Nothing stored: the documents live in memory for the request. The signed record holds hashes (documents, index, quotes) and receipt ids, never document text; logs carry counts only."},{"label":"What leaves the box","value":"Self-hosted on the direct route: nothing. The model, the retrieval service and the checks run on the same machine. Hosted: model calls go through the Decosa API, and only invented rooms are accepted."},{"label":"What it checks","value":"Ten categories: change of control, anti-assignment, exclusivity and non-compete, MFN pricing, uncapped liability, debt covenants, IP assignment gaps, litigation missing from the disclosure schedule, customer concentration, key person."},{"label":"What it is not","value":"Legal advice or a materiality call. A triage aid: every flag quotes the data room so counsel can confirm it in seconds."}],"data_handling":{"page":"/data#ma-dd-redflags","self_host":{"level":"confidential","leaves":"nothing","summary":"Runs on your machine; nothing is sent to Decosa or a third party by default."},"hosted":{"level":"operator-processed","demo_only":true,"summary":"Hosted demo on sample or public data only; self-host for real data.","gpus":"operator-contracted","third_parties":[],"retention":"Nothing stored: the documents live in memory for the request. The signed record holds hashes (documents, index, quotes) and receipt ids, never document text; logs carry counts only.","used_for_training":false,"encrypted_while_processed":false},"sealed_tier":{"applies":false,"note":"The sealed tier (raw chat only, never use-case pipelines) is paused at launch (/docs/sealed-tier)."},"external_calls":[]},"console":{"href":"/legal/ma-dd-redflags","input":"madd","lanes":[{"id":"index","title":"Index","kind":"json"},{"id":"flags","title":"Red flags","kind":"list"},{"id":"checks","title":"Checks","kind":"list"},{"id":"record","title":"Memo and signed record","kind":"json"}],"samples":[{"n":1,"id":"kestrel","title":"Kestrel","deep_link":"/legal/ma-dd-redflags?sample=1&autorun=0"},{"n":2,"id":"linnet","title":"Linnet","deep_link":"/legal/ma-dd-redflags?sample=2&autorun=0"}],"deep_link_params":{"sample":"1-based index into samples, or a sample id","autorun":"1 = start the run once the sample is loaded; 0 (default) = only preselect","reduce-motion":"1 = turn off animations"}},"api":{"base":"https://api.decosa.ai","contract":"/api/contract.json","contract_markdown":"/api/contract.md","reference":"/docs/api","keys":"/account/keys"},"prompts":{"hosted":"/prompts/ma-dd-redflags-hosted.md","selfhost":"/prompts/ma-dd-redflags-selfhost.md","assemble":"/prompts/ma-dd-redflags-assemble.md","mac":null},"rehearsal":{"bundle":"/samples/ma-dd-redflags.zip","bundle_url":"https://decosa.ai/samples/ma-dd-redflags.zip","folder":"/samples/ma-dd-redflags/","expected":"/samples/ma-dd-redflags/expected.json","files":["/samples/ma-dd-redflags/expected.json","/samples/ma-dd-redflags/inputs/clean-room.json","/samples/ma-dd-redflags/inputs/room.json"],"bytes":16440,"checks":["the customer MSA's change-of-control termination right is flagged","the demand letter in the March minutes, missing from the disclosure schedule, is flagged","the covenant breach is flagged with the figure","the 41.1% customer is flagged from the revenue table","the contractor who kept the IP is flagged","at least ten flags in all","nothing is flagged in the plain NDA","the memo is written for counsel and says it is not legal advice","every search is tied to one index hash","the signed record verifies","the record fails once its flag count is changed","the clean room comes back with at most one flag","every model call has a signed receipt"],"licence":"Synthetic: every company, person, clause and number is invented (scripts/madd_rooms.py, decosa_api/verticals/madd/data/rooms.json). Part of decosa-api, AGPL-3.0-or-later.","about":"Project Kestrel: an invented buyer (Halvard Capital) acquiring an invented target (Brightwater Analytics). Sixteen documents: a customer MSA, an inbound software licence, a reseller agreement, a supply agreement, a county services agreement, a credit agreement, a contractor agreement, the IP assignment register, the CEO employment agreement, an office lease, an NDA, two sets of board minutes, the disclosure schedule, revenue by customer and a financial summary. Planted: change of control in the MSA and a single-trigger CEO payment, a key-person clause, an anti-assignment clause that reaches mergers, exclusivity binding affiliates, MFN pricing, uncapped data-breach liability, a leverage covenant breach (3.42x against 3.00x), a contractor who kept the IP and has no assignment on file, a demand letter in the March minutes that the disclosure schedule leaves out, and one customer at 41.1% of revenue. The run must find them with verbatim quotes, keep the NDA clean, sign a record that verifies and fails when changed, and then return no flags on Project Linnet, a clean room of near misses.","run":{"containers":"docker compose exec api python scripts/rehearse.py ma-dd-redflags","checkout":"python scripts/rehearse.py ma-dd-redflags --bundle ma-dd-redflags.zip --base-url http://127.0.0.1:8445","mac":".venv/bin/python scripts/rehearse.py ma-dd-redflags"},"guidance":"Set up with a coding agent (we recommend Claude Code with Claude Opus 5.5; any capable coding agent works) on mock data only, run the rehearsal until every check passes, then run your own data locally yourself. Never give the agent real data during setup."},"hardware_fit":{"check":"/self-host/hardware?use=ma-dd-redflags","data":"/api/hardware.json","tiers":[{"id":"lite","gpu_gb":57.6,"basis":"stack","unknown":[]},{"id":"standard","gpu_gb":66.6,"basis":"stack","unknown":[]},{"id":"alternate-scans","gpu_gb":66.6,"basis":"stack","unknown":[]}],"mac":null},"links":{"page":"/legal/ma-dd-redflags","json":"/use-cases/ma-dd-redflags.json","metrics":"/metrics/ma-dd-redflags","console":"/legal/ma-dd-redflags","console_sample":"/legal/ma-dd-redflags?sample=1&autorun=0","stack":"/legal/ma-dd-redflags#stack","try_live":"/legal/ma-dd-redflags","watch":"/legal/ma-dd-redflags","build":"/legal/ma-dd-redflags#build","self_host":"/legal/ma-dd-redflags#self-host","prompts":{"hosted":"/prompts/ma-dd-redflags-hosted.md","selfhost":"/prompts/ma-dd-redflags-selfhost.md","assemble":"/prompts/ma-dd-redflags-assemble.md","mac":null}}}