Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsSanity can help control which catalog data an AI agent sees and whether AI-generated document changes match a content schema. It does not, by itself, determine whether a recommendation is relevant, fair, legally eligible, or compliant with your business rules. For those decisions, put explicit policy checks in the application that selects and serves recommendations.
What Sanity is
Sanity is a structured content platform. Teams define content models in Sanity Studio, manage records there, and store the structured content in Content Lake. GROQ, Sanity’s query language, can filter documents, follow relationships, and return selected fields. That makes a structured product catalog usable as source data for a recommendation workflow. See Sanity’s GROQ introduction.
As an Amazon Associate I earn from qualifying purchases.
Sanity Context adds an agent-facing access layer. It is a hosted Model Context Protocol (MCP) server that provides scoped access to selected content; it does not run the model or the agent loop. Your application supplies the model, API key, and harness. Context has two relevant modes: GROQ mode accesses a live dataset at request time, while Knowledge Base mode serves material indexed ahead of time. The former suits structured fields that need to be queried as the request arrives; the latter suits knowledge assembled from prose sources. See Sanity Context.
Which rules Sanity can enforce
| Control | What it can do | What it does not establish |
|---|---|---|
| GROQ filters and projections | Select documents and fields to return. | That a returned product is suitable for a particular person. |
| Roles, dataset access, and Context source filters | Restrict which content users or agents can access. | That accessible content is appropriate to recommend. |
| Schema-aware Agent Actions | Constrain the structure of AI-generated document changes. | That field values are true, eligible, fair, or policy-compliant. |
| AI Assist instructions and allowed fields | Target instructions to documents or fields and limit the fields involved. | A complete recommendation policy or an independent quality check. |
| Application policy logic | Check domain-specific eligibility and business rules before serving or saving results. | Nothing automatically: these checks must be designed, implemented, and tested by the application team. |
Sanity documents GROQ’s filtering and projection capabilities in its GROQ syntax reference. Its documentation also says that `*` returns documents the current user can read, so query logic and access permissions both matter.
#1 Best Overall
How to build a controlled recommendation flow
- Model the rules-relevant data. Give products structured fields your application can check, such as publication status, category, intended audience, or inventory state. The field names and the meaning of “eligible” are implementation choices; Sanity supplies the content model and structured access, not your business policy.
- Restrict the agent’s source. Configure the Context MCP sources and a server-side GROQ filter so the agent receives only records intended for the workflow. Sanity describes the server-side filter as a hard boundary; a filter supplied by a caller can narrow that boundary, not widen it. Keep access permissions aligned with the filter.
- Return only the necessary fields. Use GROQ to filter eligible records and project the fields the agent needs. Avoid treating retrieval as approval: being readable and returned by a query does not mean an item should be recommended.
- Apply semantic checks in application code. Before ranking, evaluate explicit eligibility and policy predicates. After the model responds, verify that selected item IDs belong to the eligible result set. Re-check important conditions before display or write, particularly when facts such as availability can change.
- Validate generated changes separately. Sanity Agent Actions can create or modify documents using schema-aware AI instructions. Treat schema validation as a structural gate, then run independent checks for domain rules and recommendation suitability. Agent Actions are experimental, and APIs may change; see the Agent Actions introduction.
- Limit instructions and their authors. AI Assist supports instructions targeted at documents or fields, schema context, explicit inclusion of field content, and allowed-field choices. Use roles and content resources to control who can create instructions and which documents they can access. See AI Assist instructions and Sanity roles.
- Review the complete authorization path. Roles are additive, so a broader grant from another role or dataset scope can undermine a narrower restriction. Public datasets also expose published content to project members. Review all grants, dataset visibility, token handling, and query filters together; Sanity’s content access and security guide explains the access controls.
What to prepare before implementation
Context setup
Sanity’s Context setup documentation lists an organization-level API token with Context Viewer permission, a model and API key, and—when using GROQ mode—a Sanity project, Studio 5.1.0 or later for server-side schema support, and a deployed schema. Keep the token on the server. A project token is refused for Context authentication regardless of how broad its project permissions are. Check the current Context setup documentation when configuring a deployment.
Agent Actions setup
The documented requirements for the current Agent Actions feature set include an execution environment, `@sanity/client` 7.4.0 or later, and API version vX. Generate, Transform, and Translate are available from client version 7.1.0; Prompt and Patch require 7.4.0. Because the feature is experimental, confirm the current package and API requirements in the Agent Actions documentation before implementation.
How to choose an approach
| Decision | Choose this when | Important consideration |
|---|---|---|
| GROQ mode or Knowledge Base mode | GROQ mode fits structured content queried live; Knowledge Base mode fits material indexed ahead of time, often from prose. | Consider whether recommendations depend on current structured fields or curated indexed knowledge. |
| Retrieval controls or semantic policy checks | Use filters and permissions to constrain accessible source material; use application logic to decide whether an item may be recommended. | Content access is not recommendation approval. |
| Agent Actions or other document workflows | Agent Actions fit schema-aware AI creation or modification of Sanity documents. | The feature is experimental; verify current API requirements and treat schema checks as structural validation only. |
Recommendation quality, fairness, and policy compliance require their own testing. Sanity’s cited documentation describes platform capabilities, not a quantified evaluation of recommendation accuracy, conversion lift, latency, or bias.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Keep recommendation decisions explainable
For a production workflow, retain enough provenance to identify the catalog records and policy version used for a recommendation. That is an application design recommendation, not an automatic Sanity feature. It helps teams investigate why an item was shown and whether the eligibility logic or source data needs correction.
Quick Recap
Rank #4
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




