Grok API adds content "guidelines": apps can now ask Grok to avoid sexual content, graphic violence and profanity. How it works, from the official docs

Checked 2026-10-29 / About 6 min read

Contents
  1. Three-line summary
  2. Background knowledge: APIs, requests and moderation
  3. What happened
  4. Why it matters
  5. Background: why features like this are needed
  6. How it works: what happens to a request
  7. Timeline
  8. Takeaways you can explain to a friend
  9. A question to continue
  10. Read next
  11. Sources

According to xAI (SpaceXSI) developer documentation, since October 2026 Chat Completions and Responses API requests to Grok can include a "guidelines" array. Each entry has a type (always "policy"), a category (nsfw, violence or profanity) and a behavior (currently only "decline"). Grok then avoids that kind of content while writing its answer. Categories you leave out keep the model's default behavior. Guidelines apply only to the request that carries them, so multi-turn apps must send them every time.

AI-generated image: a control panel with several switches placed between an app screen and an AI's reply (conceptual; not an actual product screen)
Figure 1: Illustration (AI-generated).

Three-line summary

  • In its October 2026 developer release notes, xAI (SpaceXSI) launched custom moderation controls for the Grok API: a new `guidelines` field on requests.
  • Three categories are available — nsfw, violence and profanity — and the only behavior today is "decline" (avoid).
  • Guidelines apply per request. Apps with ongoing conversations must send them with every request.

Background knowledge: APIs, requests and moderation

An API is an ordering window between programs. When you use Grok, you type into an app or website. When another company builds Grok into its own app, its program sends orders directly — "answer this text" — without any screen. That order window is the API (application programming interface). Think of a restaurant: eating in is the Grok app; phoning in a takeout order is the API. The kitchen that cooks the answer is the same.

Orders are sent as "requests" in a fixed format. A request is written in JSON, plain text listing "field: value" pairs — for example, "model: grok-4.7" and "input: write a short story about a knight." More fields on the order form means more things you can ask for. This feature simply adds one new field, `guidelines`, to the order form.

Moderation means adjusting what content is acceptable. An AI writes by predicting words, so depending on the request it can produce sexual content, gory scenes or foul language. AI companies give their models a default line. But the right line depends on where the AI is used: helping with an adult novel and running a children's study app need different lines. This feature lets app builders move that line to the stricter side, request by request.

HTTP status codes are receipt numbers for orders. An API returns a three-digit code with each reply. The 200s mean success; the 400s mean the order form was wrong. The docs mention 400 and 422. Both mean the request was rejected at the form-checking stage, before the model runs, so no expensive computation starts.

What happened

The October 2026 section of xAI's developer release notes lists "Custom moderation controls." The guide page shows a request body with a `guidelines` array:

```json { "model": "grok-4.7", "input": "Write a short story about a knight.", "guidelines": [ { "type": "policy", "category": "violence", "behavior": "decline" }, { "type": "policy", "category": "nsfw", "behavior": "decline" } ] } ```

FieldMeaningAllowed values today
typeKind of entryAlways "policy"
categoryWhich areansfw / violence / profanity
behaviorHow to behavedecline only

How Grok's behavior changes (summarized from the official docs):

CategoryEffect of "decline"
nsfwAvoids sexual innuendo or sexualized conversation, but still answers educational and clinical questions about sexual topics
violenceAvoids graphic violence; engages with history and news without graphic detail
profanityWrites without profanity; declines requests for profanity alone or highly offensive content

Why it matters

It changes how Grok answers, not whether it answers. The docs say Grok applies the guidelines while writing its response, in its own words, and the response has the same shape as one without guidelines. Declining violence does not stop Grok from answering a question about the history of a war; it leaves out the graphic detail.

App builders can set the line for their own setting. Children's learning apps, company help-desk chat and family voice assistants all need gentler answers than the default. Previously, apps had to add their own work, such as checking and filtering answers afterwards. In my view, being able to ask for this with a single field makes it easier for small teams to fit answers to their setting.

Background: why features like this are needed

Many very different apps share the same AI. Each service has different users and purposes, so one default line cannot suit them all. Letting builders choose "this far, in this setting" makes the model easier to use.

Asking in plain text every time is unreliable. In my view, developers could always write "please don't swear" in their instructions, but phrasing varies from person to person. Fixed fields (category and behavior) make requests consistent, and typos are caught as errors before the model runs.

How it works: what happens to a request

StepWhat happens
1. IntakeThe API checks how `guidelines` is written
2. ErrorsUnknown category or behavior → 422. Same category twice, type not "policy", or unsupported model/option → 400. The model does not run
3. GenerationGrok writes the answer while avoiding the chosen categories
4. ReplySame response shape as without guidelines

Rules of use:

  • List only the categories you want to change. Omitted categories keep the default behavior. Each category may appear once.
  • Guidelines apply only to the request that carries them. For multi-turn conversations, send them every time. In the xAI Python SDK, `chat.create` stores them on the chat so each `sample` call sends them.
  • Where it works: Chat Completions, the Responses API, and `chat.create` in the xAI Python SDK. With the OpenAI Python SDK, pass them in `extra_body`.
  • Where it doesn't: multi-agent models (e.g. grok-4.20-multi-agent) and deferred completions. Also, a request with no server-side tools and no file attachments cannot use guidelines if it sets `stop` or sets `n` above 1.

The docs add that these behaviors may be refined over time.

Timeline

  • August 2026: Grok Bot appears in xAI's developer release notes.
  • October 2, 2026: The transcription model grok-voice-transcribe-1.0 reaches end of life; requests go to 2.0 at the same price.
  • October 2026: Grok Voice 3.0 launches for speech-to-speech at the 2.0 price. In the same month, custom moderation controls launch.
  • October 23, 2026: The "Grok for Startups" page goes live (our explainer).

Takeaways you can explain to a friend

  • Moderation is a line, not an on/off switch: the same AI can have its line moved stricter depending on the setting.
  • Decline does not mean refuse: educational questions about sex and questions about war history still get answers, phrased differently.
  • Three categories, one behavior: nsfw, violence and profanity, with only "decline." There is no option to loosen the default.
  • Send it every time: guidelines are per request. Send them only on the first turn of a chat, and later turns fall back to the default.
  • Common misconception: it is not an after-the-fact filter. According to the docs, Grok follows the guidelines while writing the answer.

A question to continue

How does an AI tell "depicting violence" apart from "explaining history"? Understanding how AI writes text — by predicting the next word — makes clear both why the line is hard to draw and why asking through guidelines helps.

Read next

Sources

*Features, supported endpoints and error codes were checked against xAI's official documentation (as of 2026-10-29). Status: the release notes give only "October 2026"; the exact release date and any pricing effect of using guidelines are not stated in the docs.

Thank you for reading. Was this article useful to you?