AI coding agents
An AI coding agent can wire openshield into your project in minutes, if it has the right facts. These pages give it three things. To check what an agent itself reads and writes, see Moderate an AI agent.
The prompt
The dashboard builds an integration prompt for your organization, with its API base URL, the documentation links and the workflow you pick. You find it in the dashboard under Get started, with a copy button and a curl example next to it.
The prompt asks the agent to:
- list every place where users upload images or submit text that other people can see;
- add one server-side moderation module, with a timeout, that calls
POST /v1/imageandPOST /v1/text; - act on
summary.action: go on foraccept, keep the content hidden forreview, refuse it forrejectwith a message chosen from the reason'sid; - handle errors: refuse for
400,413and415, log and alert for401and403, retry afterRetry-Afterfor429and503, and fail closed for anything else; - write tests with the HTTP call stubbed.
The prompt never contains your key. It tells the agent to read the key from the OPENMOD_API_KEY environment variable, and never to hard-code it, log it or send it to a browser. Put the key in your server's environment yourself.
llms.txt and llms-full.txt
These docs publish the machine-readable files that agents look for:
/docs/llms.txt: an index of the pages, with a line about each;/docs/llms-full.txt: the text of every page in one file, which an agent can read in one go.
Every page is also available as raw Markdown, at https://openshield.dev/raw/docs/<page>.md: for example /raw/docs/quickstart.md.
The OpenAPI document
The API is described by an OpenAPI 3.1 document, generated from the gateway's code, so it is always the document of the running version:
https://api.openshield.dev/openapi.json, from the API itself;/docs/api/openapi.json, a copy published with these docs.
Most agents and code generators can read it directly.
Tips for good results
- Name the workflow in the prompt if you use one other than
default. - Ask the agent to show you the list of places it will moderate before it changes code.
- Review what it writes about failures: the safe default is to hold content when a check cannot be made, not to publish it.