Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@sanity/assist
Advanced tools
This is a Sanity Studio v3 plugin.
Free your team to do more of what they’re great at (and less busy work) with the AI assistant that works with structured content. Attach reusable AI instructions to fields and documents to supercharge your editorial workflow.
You create the instructions; Sanity AI Assist does the rest. Learn more about writing instructions in the Sanity documentation.
Read the release announcement here.
Using this feature requires Sanity to send data to OpenAI.com for processing. It uses generative AI; you should verify the data before using it.
In your Studio project folder, install the following plugin dependency:
npm install @sanity/assist sanity@latest
This plugin requires sanity
version 3.16.0
or greater.
Note: Before using the plugin, your project must have Sanity AI Assist enabled at the API level.
Contact your Sanity enterprise representative to get started, or contact the sales team.
In sanity.config.ts
, add assist
to the plugins
array:
import { assist } from '@sanity/assist'
export default defineConfig({
/* other config */
plugins: [
/* other plugins */
assist()
]
})
After installing and adding the plugin and having the AI Assist feature enabled for your project and its datasets, you need to create a token for the plugin to access the AI Assist API. This needs to be done by a member of the project with token creation permissions (typically someone with an admin or developer role).
You will find a new API token entry for your project named “Sanity AI” in your project's API settings on sanity.io/manage.
The plugin will now work for any dataset in your project.
Note: You can revoke this token at any time to disable Sanity AI Assist service. A new token has to be generated via the plugin UI for it to work again.
By default, most object, array, and string field types have AI writing assistance enabled. Your assistant can write to all compatible fields that it detects.
The assistant can also create array items, including Portable Text blocks, when the type has been imported to the Studio's schema as a custom type (learn more about strict schemas).
// this will disable AI assistance wherever it is used,
// ie: as field, document, array types
defineType({
name: 'policy',
type: 'document',
options: {
aiWritingAssistance: {exclude: true}
},
fields: [
// ...
]
})
// this disables AI assistance only for the specific field
defineType({
name: 'product',
type: 'object',
fields: [
defineField({
name: 'sku',
type: 'string',
options: {
aiWritingAssistance: {exclude: true}
}
})
]
})
// this disables AI assistance for the specific array member
// if all types in the `of` array are excluded, the array type is also considered excluded
defineType({
name: 'product',
type: 'array',
of: [
defineArrayMember({
type: 'customProduct',
options: {
aiWritingAssistance: {exclude: true}
}
})
]
})
The following types are not supported, and behave as excluded types:
Types and fields with hidden
or readonly
with a truthy value (true
or function
) are not supported.
(Hidden and readOnly fields can be referenced in instructions still)
Fields with these types will not be changed by the assistant, do not have AI Assist actions, and cannot be referenced in instructions.
Objects where all fields are excluded or unsupported and arrays where all member types are excluded or unsupported will also be excluded.
There are limits to how much text the AI can process when processing an instruction. Under the hood, the AI Assist will add information about your schema, which adds to what's commonly referred to as “the context window.”
If you have a very large schema (that is, many document and field types), it can be necessary to exclude types to limit how much of the context window is used for the schema itself.
We recommend excluding any and all types which rarely would benefit from automated workflows. A quick win is typically to exclude array types. It can be a good idea to exclude most non-block types from Portable Text arrays. This will ensure that the Sanity Assist outputs mostly formatted text.
This plugin adds an AI Context
document type.
If your Studio uses Structure Builder to configure the studio structure, you might have to add this document type to your structure.
The document type name can be imported from the plugin:
import {contextDocumentTypeName} from '@sanity/assist'
// put into structure in structure
S.documentTypeListItem(contextDocumentTypeName)
Large Language Models (LLMs) are a new technology. Constraints and limitations are still being explored, but some common caveats to the field that you may run into using AI Assist are:
AI Assist can optionally generate captions for images. This has to be enabled on an image-type/field,
by setting the options.captionField
on the image type, where captionField
is the field name of a
custom string-field on the image object:
defineField({
type: 'image',
name: 'inlineImage',
title: 'Image',
fields: [
defineField({
type: 'string',
name: 'caption',
title: 'Caption',
}),
],
options: {
captionField: 'caption',
},
}),
This will add a "Generate caption" action to the configured field. "Generate caption" action will automatically run whenever the image changes.
This version of the feature uses OpenAI.com as a third-party sub-processor. Their security posture has been vetted by Sanity's security team, and approved for use.
MIT © Sanity
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.
Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".
Semantic release will only release on configured branches, so it is safe to run release on any branch.
FAQs
You create the instructions; Sanity AI Assist does the rest.
The npm package @sanity/assist receives a total of 3,131 weekly downloads. As such, @sanity/assist popularity was classified as popular.
We found that @sanity/assist demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 61 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.