[{"data":1,"prerenderedAt":563},["ShallowReactive",2],{"navigation_docs":3,"-docs-workflows":114,"-docs-workflows-surround":558},[4,8,12,16,20,24,28,32,36,40,44,82,86,90,94,98,102,106,110],{"title":5,"path":6,"stem":7},"Overview","\u002Fdocs","docs\u002Findex",{"title":9,"path":10,"stem":11},"Quickstart","\u002Fdocs\u002Fquickstart","docs\u002F01.quickstart",{"title":13,"path":14,"stem":15},"Authentication and keys","\u002Fdocs\u002Fauthentication","docs\u002F02.authentication",{"title":17,"path":18,"stem":19},"Images","\u002Fdocs\u002Fimages","docs\u002F03.images",{"title":21,"path":22,"stem":23},"Texts","\u002Fdocs\u002Ftexts","docs\u002F04.texts",{"title":25,"path":26,"stem":27},"Migrating from SightEngine","\u002Fdocs\u002Fmigrating-from-sightengine","docs\u002F05.migrating-from-sightengine",{"title":29,"path":30,"stem":31},"Workflows","\u002Fdocs\u002Fworkflows","docs\u002F06.workflows",{"title":33,"path":34,"stem":35},"Responses and errors","\u002Fdocs\u002Fresponses-and-errors","docs\u002F07.responses-and-errors",{"title":37,"path":38,"stem":39},"Limits and quotas","\u002Fdocs\u002Flimits-and-quotas","docs\u002F08.limits-and-quotas",{"title":41,"path":42,"stem":43},"The journal and ref","\u002Fdocs\u002Fjournal-and-ref","docs\u002F09.journal-and-ref",{"title":45,"path":46,"stem":47,"children":48,"page":81},"Integration guides","\u002Fdocs\u002Fintegration-guides","docs\u002F10.integration-guides",[49,53,57,61,65,69,73,77],{"title":50,"path":51,"stem":52},"Node.js and TypeScript","\u002Fdocs\u002Fintegration-guides\u002Fnodejs","docs\u002F10.integration-guides\u002F1.nodejs",{"title":54,"path":55,"stem":56},"Python","\u002Fdocs\u002Fintegration-guides\u002Fpython","docs\u002F10.integration-guides\u002F2.python",{"title":58,"path":59,"stem":60},"PHP","\u002Fdocs\u002Fintegration-guides\u002Fphp","docs\u002F10.integration-guides\u002F3.php",{"title":62,"path":63,"stem":64},"Go","\u002Fdocs\u002Fintegration-guides\u002Fgo","docs\u002F10.integration-guides\u002F4.go",{"title":66,"path":67,"stem":68},"Supabase Edge Functions","\u002Fdocs\u002Fintegration-guides\u002Fsupabase-edge-functions","docs\u002F10.integration-guides\u002F5.supabase-edge-functions",{"title":70,"path":71,"stem":72},"Cloudflare Workers","\u002Fdocs\u002Fintegration-guides\u002Fcloudflare-workers","docs\u002F10.integration-guides\u002F6.cloudflare-workers",{"title":74,"path":75,"stem":76},"Nuxt and Next","\u002Fdocs\u002Fintegration-guides\u002Fnuxt-and-next","docs\u002F10.integration-guides\u002F7.nuxt-and-next",{"title":78,"path":79,"stem":80},"Moderate an AI agent","\u002Fdocs\u002Fintegration-guides\u002Fmoderate-ai-agents","docs\u002F10.integration-guides\u002F8.moderate-ai-agents",false,{"title":83,"path":84,"stem":85},"AI coding agents","\u002Fdocs\u002Fai-agents","docs\u002F11.ai-agents",{"title":87,"path":88,"stem":89},"Best practices","\u002Fdocs\u002Fbest-practices","docs\u002F12.best-practices",{"title":91,"path":92,"stem":93},"Privacy and data","\u002Fdocs\u002Fprivacy-and-data","docs\u002F13.privacy-and-data",{"title":95,"path":96,"stem":97},"API reference","\u002Fdocs\u002Fapi-reference","docs\u002F14.api-reference",{"title":99,"path":100,"stem":101},"Fraud prevention","\u002Fdocs\u002Ffraud-prevention","docs\u002F16.fraud-prevention",{"title":103,"path":104,"stem":105},"Device token and challenges","\u002Fdocs\u002Fdevice-and-challenges","docs\u002F17.device-and-challenges",{"title":107,"path":108,"stem":109},"MCP server","\u002Fdocs\u002Fmcp-server","docs\u002F18.mcp-server",{"title":111,"path":112,"stem":113},"Changelog","\u002Fdocs\u002Fchangelog","docs\u002F99.changelog",{"id":115,"title":29,"body":116,"description":551,"extension":552,"links":553,"meta":554,"navigation":555,"path":30,"seo":556,"stem":31,"__hash__":557},"docs\u002Fdocs\u002F06.workflows.md",{"type":117,"value":118,"toc":543},"minimark",[119,140,145,148,167,184,188,194,239,250,254,265,281,289,293,296,330,333,337,344,348,354,393,532,539],[120,121,122,123,127,128,131,132,135,136,139],"p",{},"A workflow lists the categories to check and, for each, a ",[124,125,126],"code",{},"reject"," threshold and a ",[124,129,130],{},"review"," threshold. Every check names a workflow with its ",[124,133,134],{},"workflow"," parameter, and ",[124,137,138],{},"default"," when it names none.",[141,142,144],"h2",{"id":143},"how-a-decision-is-made","How a decision is made",[120,146,147],{},"Each category gets a score between 0 and 1. For each category the workflow lists:",[149,150,151,158,164],"ul",{},[152,153,154,155,157],"li",{},"a score at or above ",[124,156,126],{}," rejects the content;",[152,159,160,161,163],{},"else, a score at or above ",[124,162,130],{}," sends it to review;",[152,165,166],{},"a category the workflow does not list is not checked at all.",[120,168,169,170,173,174,176,177,179,180,183],{},"The answer's ",[124,171,172],{},"summary.action"," is ",[124,175,126],{}," when any category reaches its reject threshold, else ",[124,178,130],{}," when any reaches its review threshold, else ",[124,181,182],{},"accept",". The thresholds are numbers from 0 to 1. A category needs at least one of the two, and its review threshold is not above its reject threshold.",[141,185,187],{"id":186},"the-default-workflow","The default workflow",[120,189,190,191,193],{},"Every organization starts with a ",[124,192,138],{}," workflow, copied from openmod's own. It is semi-permissive: it rejects what is plainly unacceptable, sends the doubtful cases to review and lets everyday content pass.",[195,196,197,213],"table",{},[198,199,200],"thead",{},[201,202,203,207,210],"tr",{},[204,205,206],"th",{},"Kind",[204,208,209],{},"Rejected",[204,211,212],{},"Sent to review",[214,215,216,228],"tbody",{},[201,217,218,222,225],{},[219,220,221],"td",{},"Image",[219,223,224],{},"Nudity, gore, weapons, hate symbols and self-harm at 0.8. Extremist text, and links in text or QR codes to adult or unsafe sites.",[219,226,227],{},"The same five categories from 0.5. Drugs and minors from 0.5. Links to gambling sites.",[201,229,230,233,236],{},[219,231,232],{},"Text",[219,234,235],{},"Unsafe text, violence, sexual content, hate, illegal activity and unethical content at 0.8. Bank account numbers, payment card numbers and unsafe links.",[219,237,238],{},"The same six categories from 0.5. Self-harm from 0.5. Email addresses, phone numbers, requests to continue on another messaging app, spam, scams, extremism, and links to adult or gambling sites.",[120,240,241,242,245,246,249],{},"Two more templates are available when you create a workflow: ",[124,243,244],{},"strict",", which checks everything openmod can, and ",[124,247,248],{},"nudity_only",", for profile pictures. Organizations keep their own copy, so a change to a template never changes a workflow of yours. When a newer default is available, the dashboard shows what changed and offers to update, which makes a new version.",[141,251,253],{"id":252},"editing-a-workflow","Editing a workflow",[120,255,256,257,264],{},"Edit workflows in the ",[258,259,263],"a",{"href":260,"rel":261},"https:\u002F\u002Fopenshield.dev\u002Fdashboard\u002Fworkflows",[262],"nofollow","dashboard",":",[149,266,267,270,278],{},[152,268,269],{},"pick the categories from the catalogue, one list for images and one for texts, and set a review and a reject threshold for each;",[152,271,272,273,277],{},"add ",[274,275,276],"strong",{},"custom categories"," (below);",[152,279,280],{},"see every version, and compare any two.",[120,282,283,284,288],{},"A name is 1 to 64 characters. Your tier sets how many workflows you can have: 3 until your first top-up, then 10, 50 or 200 as your top-ups grow (see ",[258,285,287],{"href":286},"\u002Fdocs\u002Flimits-and-quotas#tiers","limits and quotas","). A saved version compiles in the background: until it has, the previous version keeps serving checks, and the dashboard says the new one is waiting.",[141,290,292],{"id":291},"custom-categories","Custom categories",[120,294,295],{},"A custom category teaches a workflow something that is specific to your product, in plain words. You give it:",[149,297,298,309,316,323],{},[152,299,300,301,304,305,308],{},"an ",[274,302,303],{},"id",": lower-case letters, digits and underscores, up to 64 characters, such as ",[124,306,307],{},"competitor_mention",";",[152,310,311,312,315],{},"up to 8 ",[274,313,314],{},"prompts",": short descriptions of what to look for, each up to 200 characters;",[152,317,318,319,322],{},"optionally up to 8 ",[274,320,321],{},"negatives",": descriptions of what looks similar but is fine;",[152,324,325,326,329],{},"a ",[274,327,328],{},"shift",", from -20 to 20, to make the category stricter or more lenient.",[120,331,332],{},"A workflow can have up to 20 custom categories. They count as one check, like any other category. Once defined, a custom category appears in the workflow's category list, and you set its thresholds like any other.",[141,334,336],{"id":335},"versions","Versions",[120,338,339,340,343],{},"Every save makes a new version. The answer says which one decided, in ",[124,341,342],{},"workflow_version",", and so does the journal: you can always tell which rules were in force for a past decision.",[141,345,347],{"id":346},"listing-your-workflows-from-the-api","Listing your workflows from the API",[120,349,350,353],{},[124,351,352],{},"GET \u002Fv1\u002Fworkflows"," lists the names and current versions of the workflows the key may use:",[355,356,361],"pre",{"className":357,"code":358,"language":359,"meta":360,"style":360},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -H \"Authorization: Bearer $OPENSHIELD_API_KEY\" https:\u002F\u002Fapi.openshield.dev\u002Fv1\u002Fworkflows\n","bash","",[124,362,363],{"__ignoreMap":360},[364,365,368,372,376,380,383,387,390],"span",{"class":366,"line":367},"line",1,[364,369,371],{"class":370},"sBMFI","curl",[364,373,375],{"class":374},"sfazB"," -H",[364,377,379],{"class":378},"sMK4o"," \"",[364,381,382],{"class":374},"Authorization: Bearer ",[364,384,386],{"class":385},"sTEyZ","$OPENSHIELD_API_KEY",[364,388,389],{"class":378},"\"",[364,391,392],{"class":374}," https:\u002F\u002Fapi.openshield.dev\u002Fv1\u002Fworkflows\n",[355,394,398],{"className":395,"code":396,"language":397,"meta":360,"style":360},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"status\": \"success\",\n  \"workflows\": [\n    { \"name\": \"default\", \"version\": 3 },\n    { \"name\": \"profile_picture\", \"version\": 1 }\n  ]\n}\n","json",[124,399,400,405,429,444,484,520,526],{"__ignoreMap":360},[364,401,402],{"class":366,"line":367},[364,403,404],{"class":378},"{\n",[364,406,408,411,415,417,419,421,424,426],{"class":366,"line":407},2,[364,409,410],{"class":378},"  \"",[364,412,414],{"class":413},"spNyl","status",[364,416,389],{"class":378},[364,418,264],{"class":378},[364,420,379],{"class":378},[364,422,423],{"class":374},"success",[364,425,389],{"class":378},[364,427,428],{"class":378},",\n",[364,430,432,434,437,439,441],{"class":366,"line":431},3,[364,433,410],{"class":378},[364,435,436],{"class":413},"workflows",[364,438,389],{"class":378},[364,440,264],{"class":378},[364,442,443],{"class":378}," [\n",[364,445,447,450,452,455,457,459,461,463,465,468,470,473,475,477,481],{"class":366,"line":446},4,[364,448,449],{"class":378},"    {",[364,451,379],{"class":378},[364,453,454],{"class":370},"name",[364,456,389],{"class":378},[364,458,264],{"class":378},[364,460,379],{"class":378},[364,462,138],{"class":374},[364,464,389],{"class":378},[364,466,467],{"class":378},",",[364,469,379],{"class":378},[364,471,472],{"class":370},"version",[364,474,389],{"class":378},[364,476,264],{"class":378},[364,478,480],{"class":479},"sbssI"," 3",[364,482,483],{"class":378}," },\n",[364,485,487,489,491,493,495,497,499,502,504,506,508,510,512,514,517],{"class":366,"line":486},5,[364,488,449],{"class":378},[364,490,379],{"class":378},[364,492,454],{"class":370},[364,494,389],{"class":378},[364,496,264],{"class":378},[364,498,379],{"class":378},[364,500,501],{"class":374},"profile_picture",[364,503,389],{"class":378},[364,505,467],{"class":378},[364,507,379],{"class":378},[364,509,472],{"class":370},[364,511,389],{"class":378},[364,513,264],{"class":378},[364,515,516],{"class":479}," 1",[364,518,519],{"class":378}," }\n",[364,521,523],{"class":366,"line":522},6,[364,524,525],{"class":378},"  ]\n",[364,527,529],{"class":366,"line":528},7,[364,530,531],{"class":378},"}\n",[120,533,534,535,538],{},"A workflow with no rule for the kind of content you send answers ",[124,536,537],{},"503 workflow_unavailable"," for it: an image sent to a workflow that only has text rules, for example.",[540,541,542],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":360,"searchDepth":407,"depth":407,"links":544},[545,546,547,548,549,550],{"id":143,"depth":407,"text":144},{"id":186,"depth":407,"text":187},{"id":252,"depth":407,"text":253},{"id":291,"depth":407,"text":292},{"id":335,"depth":407,"text":336},{"id":346,"depth":407,"text":347},"A workflow decides which categories are checked and how strictly, with thresholds, custom categories and versions.","md",null,{},true,{"title":29,"description":551},"J3_Nu5W9BPbjq8DzMFszWpa4Y4sDZ2sTlw6SruWzYcQ",[559,561],{"title":25,"path":26,"stem":27,"description":560,"children":-1},"Three SightEngine workflow routes work here with the same paths, request fields and answer envelope. Change the base URL and key, map the category ids.",{"title":33,"path":34,"stem":35,"description":562,"children":-1},"Every field of an answer, the error envelope with its types, and the headers on every response.",1792938462046]