{"openapi":"3.1.0","info":{"title":"TrustFetch","description":"Safety and content tools for AI agents. Scan text for hidden prompt-injection attempts, or fetch and clean a webpage -- with built-in injection screening -- before your agent acts on what it reads.","version":"1.0.0"},"paths":{"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}},"security":[]}},"/":{"get":{"summary":"Landing","operationId":"landing__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/llms.txt":{"get":{"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}},"security":[]}},"/tools/injection-scan":{"post":{"tags":["injection_scan"],"summary":"Injection Scan Endpoint","description":"Fast tier: heuristics first, LLM only on the ambiguous confidence band.","operationId":"injection_scan_endpoint_tools_injection_scan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/injection-scan/deep":{"post":{"tags":["injection_scan_deep"],"summary":"Injection Scan Deep Endpoint","description":"Deep tier: always gets the LLM's read on the text, skipping the fast\ntier's confidence-gate shortcuts. For callers about to act on high-stakes\nuntrusted input (execute code, approve a transaction) who want the more\nthorough verdict rather than the cheap triage.","operationId":"injection_scan_deep_endpoint_tools_injection_scan_deep_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/injection-scan/batch":{"post":{"tags":["injection_scan_batch"],"summary":"Injection Scan Batch Endpoint","description":"Volume tier: scan up to INJECTION_SCAN_BATCH_MAX_ITEMS texts for a\nsingle flat price -- cheaper per item than calling the fast tier that\nmany times separately, for agents chunking a document or a page's worth\nof untrusted fragments at once.","operationId":"injection_scan_batch_endpoint_tools_injection_scan_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/fetch-clean":{"post":{"tags":["fetch_clean"],"summary":"Fetch Clean Endpoint","operationId":"fetch_clean_endpoint_tools_fetch_clean_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/fetch-clean/batch":{"post":{"tags":["fetch_clean_batch"],"summary":"Fetch Clean Batch Endpoint","description":"Volume tier: fetch and clean multiple URLs for a single flat price --\ncheaper per item than calling fetch-clean that many times separately,\nfor agents processing a page's worth of links at once.","operationId":"fetch_clean_batch_endpoint_tools_fetch_clean_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchFetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchFetchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/safe-fetch":{"post":{"tags":["safe_fetch"],"summary":"Safe Fetch Endpoint","description":"Flagship combined product: fetch a URL, extract clean Markdown, and\ninjection-scan the extracted text in one priced call -- the exact\npipeline an agent needs before acting on an arbitrary web page, for less\nthan the two calls would cost separately.","operationId":"safe_fetch_endpoint_tools_safe_fetch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeFetchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafeFetchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tools/echo":{"post":{"tags":["echo (stub)"],"summary":"Echo Endpoint","operationId":"echo_endpoint_tools_echo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EchoRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EchoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BatchFetchRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array","maxItems":5,"minItems":1,"title":"Urls"}},"type":"object","required":["urls"],"title":"BatchFetchRequest"},"BatchFetchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/BatchFetchResultItem"},"type":"array","title":"Results"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["results","count"],"title":"BatchFetchResponse"},"BatchFetchResultItem":{"properties":{"url":{"type":"string","title":"Url"},"final_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"markdown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown"},"word_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Word Count"},"truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Truncated"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["url"],"title":"BatchFetchResultItem"},"BatchScanRequest":{"properties":{"texts":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Texts"}},"type":"object","required":["texts"],"title":"BatchScanRequest"},"BatchScanResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/ScanResponse"},"type":"array","title":"Results"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["results","count"],"title":"BatchScanResponse"},"EchoRequest":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"EchoRequest"},"EchoResponse":{"properties":{"text":{"type":"string","title":"Text"},"note":{"type":"string","title":"Note","default":"stub tool demonstrating the multi-tool portfolio pattern"}},"type":"object","required":["text"],"title":"EchoResponse"},"FetchRequest":{"properties":{"url":{"type":"string","maxLength":2000,"minLength":1,"title":"Url"}},"type":"object","required":["url"],"title":"FetchRequest"},"FetchResponse":{"properties":{"url":{"type":"string","title":"Url"},"final_url":{"type":"string","title":"Final Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"markdown":{"type":"string","title":"Markdown"},"word_count":{"type":"integer","title":"Word Count"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["url","final_url","title","markdown","word_count","truncated"],"title":"FetchResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InjectionTechnique":{"type":"string","enum":["invisible_unicode","override_phrase","fake_system_block","role_impersonation","encoded_payload","html_comment_injection","none"],"title":"InjectionTechnique"},"SafeFetchRequest":{"properties":{"url":{"type":"string","maxLength":2000,"minLength":1,"title":"Url"}},"type":"object","required":["url"],"title":"SafeFetchRequest"},"SafeFetchResponse":{"properties":{"fetch":{"$ref":"#/components/schemas/FetchResponse"},"injection_scan":{"$ref":"#/components/schemas/ScanResponse"}},"type":"object","required":["fetch","injection_scan"],"title":"SafeFetchResponse"},"ScanRequest":{"properties":{"text":{"type":"string","maxLength":50000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"ScanRequest"},"ScanResponse":{"properties":{"injection_suspected":{"type":"boolean","title":"Injection Suspected"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"technique":{"$ref":"#/components/schemas/InjectionTechnique"},"flagged_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flagged Snippet"},"reasoning":{"type":"string","title":"Reasoning"},"detector_tier":{"type":"string","enum":["heuristic","llm_fallback"],"title":"Detector Tier"},"signals":{"items":{"$ref":"#/components/schemas/SignalDetail"},"type":"array","title":"Signals","description":"Every heuristic signal found, not just the top one. Empty for clean text."}},"type":"object","required":["injection_suspected","confidence","technique","flagged_snippet","reasoning","detector_tier"],"title":"ScanResponse"},"SignalDetail":{"properties":{"technique":{"$ref":"#/components/schemas/InjectionTechnique"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"snippet":{"type":"string","title":"Snippet"},"reasoning":{"type":"string","title":"Reasoning"}},"type":"object","required":["technique","confidence","snippet","reasoning"],"title":"SignalDetail","description":"One individual heuristic hit. A scan can carry several of these at\nonce (e.g. an override phrase AND a fake system block in the same text)\n-- the top-level fields on ScanResponse summarize the single\nhighest-confidence signal for callers that just want a verdict, while\n`signals` exposes everything found for callers that want the full\npicture."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}